mikeR needs help!

wardenblack

Member
Reaction score
1
Hello good and kind community. I started making a new wc3 map, you know; to wrap my head around some triggers for old times sake.
I am trying to make a hero defense map so I did the terrain, the storyline, spawn locations, creepwaves, items all that.
I am currently struggling with this:
I have 5 initial creep waves defined as 5 unit-type real variables. So each level is a corresponding creature.
I have set a loop action to make 20 types of that 1 unit-type based on that variable. When the first wave reaches 0 creeps it moves to round 2 so the next wave begins and so on...
My question is, this being a reccuring event of creep waves, how can I incorporate in that a new creep wave at lvl 5, to be like a boss level. So at lvl 5 I would like just a boss creep not 20 of them.

sorry for the long post and thank you for assistance!
 

ZachHandley

New Member
Reaction score
1
I'm assuming you're using a loop to spawn for each player, you could, when Integer A (Or your local variable if in JASS) equals five, just spawn the boss unit. It'd be helpful if you posted the code. But I would do something like this.
Code:
Events
- Whenever they spawn
Conditions
- Whatever
Actions
- For each Integer A from 1 - 9 do actions
    Actions -
    if WAVENUM = 5 then
        Create 1 BOSS for Player(12) at PlayerLoc[IntegerA]
      else
      - For each integer A from 1-20 do Actions
          Actions -
            Create 1 UNIT_TYPE for Player(12) at PlayerSpawnPoint[IntegerA]
Up to you, but keep track of the wave with an integer and that should work fine.
WAVENUM is an integer variable.
 

wardenblack

Member
Reaction score
1
yea I thought of that, thanks for the fast reply btw (wow), but I need bosses for lvls 5-10-15, etc. any way I can make an "if WAVENUM = 5 or 10 or 15.." kind of trigger?
 

afisakov

You can change this now in User CP.
Reaction score
37
if (WAVENUM = 5) or (WAVENUM = 10) or (WAVENUM = 15) then
Create 1 BOSS[WAVENUM/5] for Player(12) at PlayerLoc[IntegerA]
else - For each integer A from 1-20 do Actions
Create 1 UNIT_TYPE[WAVENUM] for Player(12) at PlayerSpawnPoint[IntegerA]
 

Solu9

You can change this now in User CP.
Reaction score
216
You can use the mod function.

If-
(WaveCount_Integer mod 5) Equal to 0)
Then-
Create 1 of Unit_Variable[WaveCount_Integer] at.....
Else-
For each integer A (1 to 20) do action
loop
Create 1 of Unit_Variable[WaveCount_Integer] at.....

Edit:
Where your Unit_Variable[5-10-15..] and so on is a boss unit.
 

wardenblack

Member
Reaction score
1
that sounds interesting if I will have bosses only on lvls divisible by 5; but that makes the game predictable and I don't particularly like that. However I managed to create the first 4 waves of mobs + 1 wave of boss thanks to your help guys. But when I try to make the condition "OR" it doesn't work. I tried a lot of options. I will try to upload the code but it's similar with what Zach wrote.
 

wardenblack

Member
Reaction score
1
Set WAVENUM = Round
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((WAVENUM Equal to 5) or (WAVENUM Equal to 8)) or ((WAVENUM Equal to 10) or (WAVENUM Equal to 13))
Then - Actions
Set CreepAlive = 1.00
Wait 0.50 seconds
Unit - Create 1 CreepType[Round] for Player 12 (Brown) at tempLoc1 facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To tempLoc2
Else - Actions
Set CreepAlive = 40.00
For each (Integer LoopWave) from 1 to 40, do (Actions)
Loop - Actions
Wait 0.50 seconds
Unit - Create 1 CreepType[Round] for Player 12 (Brown) at tempLoc1 facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To tempLoc2

That's what I got and the boss levels doesn't work. :/
 

vypur85

Hibernate
Reaction score
803
Can't really understand the trigger.
But, remove all the waits, and it should work afterwards.
This is assuming all your other actions are done correctly.
 

wardenblack

Member
Reaction score
1
I found the problem. It was an integer problem. I don't know how efficient it is to make so many "OR" conditions (i'll have like 30 bosses in the game) but for now it will do. Again you're awesome thanks!
 

vypur85

Hibernate
Reaction score
803
> I don't know how efficient it is to make so many "OR" conditions
It should be alright, it's just tedious.
I can't see a pattern in your integer increment in the condition. So I guess even the mod method will not work for you.
 

wardenblack

Member
Reaction score
1
If the admins don't mind I'd like to keep this thread opened for further questions; For instance I lost 1h already trying to figure out why an animation doesn't stop after a spell is cast.
ie. Healing spray casted by a hero-type Jaina, after the 3'rd wave of heals is gone the animation keeps casting as if another 2 waves are following. Searched spells, animations, buffs, can't find the stop casting thing anywhere. Do i need to make a trigger just for this?
 

wardenblack

Member
Reaction score
1
I was looking to decrease the animation time for the spell itself but that cast/point swings helped too. Thanks again.
 

wardenblack

Member
Reaction score
1
ok one more question and then I'll stop for a while :)
(I appreciate the answers btw and I try to only post if I don't find answers somewhere else...)

so one of my lack of knowledge problem now is this:
I have a generic trigger of an unit casting an ability. I need to make something happen to the unit that the spell is targeted to.

ie. I have a healer hero, and I want him to channel a spell that drains mana from allies and also enemies. I am using a modified version of Siphon Mana; changed the gameplay constants and inverted the spell damage variables so it will remove mana from allies instead of giving them some. The spell works fine but ONLY if the ally has at least 1 mana spent. If he has full mana I get the "unit already has full mana" block even if I want to take mana from him not give him some.
Can't seem to find a fix to that right now so I want to create a trigger that when the spell Siphon mana is cast it should select that unit that is the target of the spell and remove 1 mana from him. Is that complicated to do? I tried Unit - Select Targeted unit; but doesn't work.

EDIT: I found the Unit - Targeted unit of ability being cast action, but it only works on enemies... the struggle continues :)

EDIT 2: Well now there is the bug that even if the hero has 0 mana I can still drain mana from him. I think I will drop the whole mana skill and just use it as normal. I wanted to take mana from allies though. That would've made so much team-play value. :(
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
You could base the ability of Channel and trigger the mana drain as well as the lightning effect. The only flaw would be that you can still choose to cast on units without mana.
 

wardenblack

Member
Reaction score
1
yeah! nice and I can trigger the spell to not be albe to be cast on units without or with 0 mana. thanks.

Quick question. Is it possible to select all the indexes in an array?
I have some arrays for creeps
Set CreepType[1] = x1
Set CreepType[2] = x2
...

I want to make a condition like
Event: A unit owned by PlayerX dies.
Condition: Triggering unit is of type CreepType[any of the indexes in this array]
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Usually (in pseudocode) it looks like this:
Code:
boolean isAny = false
for i from 0 to ary.length
    if (unit type of (Triggering unit)) == creepTyp[i]
        isAny = true
    end
end

So you would need a boolean variable and a for-each loop.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top