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,463
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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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