• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

Help me with the simple spawn striggers...:-)

Status
Not open for further replies.
Level 2
Joined
Aug 6, 2012
Messages
27
I'm building and trying to combine the waves of spawning into 3 triggers like this:


1/ Set data of monsters, the amount of them...:
  • unit
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Tempno = (Center of Region 001 <gen>)
      • Set Tempminh = (Center of Region 002 <gen>)
      • -------- ============wave1======== --------
      • Set unitType1[1] = Ghoul
      • Set unitAmount1[1] = 10
      • -------- ============wave 2 --------
      • Set unitType1[2] = Crypt Fiend
      • Set unitAmount1[2] = 10
      • -------- ============ --------
      • Set unitType1[3] = Skeleton Warrior
      • Set unitAmount1[3] = 10
      • -------- ============ --------
2/ creating monsters :
  • spawning
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Wait 15.00 seconds
      • For each (Integer A) from 1 to unitAmount1[int], do (Actions)
        • Loop - Actions
          • Unit - Create 1 unitType1[int] for Player 3 (Teal) at Tempno facing Default building facing degrees
          • AI - Ignore (Last created unit)'s guard position
          • Unit - Order (Last created unit) to Attack-Move To Tempminh
      • Trigger - Turn off (This trigger)
3/ If enemy's units are nearly terminated, this trigger will make the next wave:
  • dieAll
    • Events
      • Player - Player 3 (Teal)'s Food used becomes Less than or equal to 5.00
    • Conditions
    • Actions
      • Set int = (int + 1)
      • Trigger - Turn on spawning <gen>
But it doesn't work for me :ogre_icwydt: only 1st wave can spawn and the type of monters in this are messy which come from all types I declared above in unit:vw_death:

Hope sb help me!!!
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
I'm building and trying to combine the waves of spawning into 3 triggers like this:


1/ Set data of monsters, the amount of them...:
  • unit
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Tempno = (Center of Region 001 <gen>)
      • Set Tempminh = (Center of Region 002 <gen>)
      • -------- ============wave1======== --------
      • Set unitType1[1] = Ghoul
      • Set unitAmount1[1] = 10
      • -------- ============wave 2 --------
      • Set unitType1[2] = Crypt Fiend
      • Set unitAmount1[2] = 10
      • -------- ============ --------
      • Set unitType1[3] = Skeleton Warrior
      • Set unitAmount1[3] = 10
      • -------- ============ --------
2/ creating monsters :
  • spawning
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Wait 15.00 seconds
      • For each (Integer A) from 1 to unitAmount1[int], do (Actions)
        • Loop - Actions
          • Unit - Create 1 unitType1[int] for Player 3 (Teal) at Tempno facing Default building facing degrees
          • AI - Ignore (Last created unit)'s guard position
          • Unit - Order (Last created unit) to Attack-Move To Tempminh
      • Trigger - Turn off (This trigger)
3/ If enemy's units are nearly terminated, this trigger will make the next wave:
  • dieAll
    • Events
      • Player - Player 3 (Teal)'s Food used becomes Less than or equal to 5.00
    • Conditions
    • Actions
      • Set int = (int + 1)
      • Trigger - Turn on spawning <gen>
But it doesn't work for me :ogre_icwydt: only 1st wave can spawn and the type of monters in this are messy which come from all types I declared above in unit:vw_death:

Hope sb help me!!!

Player - Player 3 (Teal)'s Food used becomes Less than or equal to 5.00
Becomes equal to. That's probably your problem, it doesn't state if it becomes 5 from increasing or decreasing. Thus, it will quickly set int very high and stop spawning.

This is what happens:
Create ghoul
Oh shit, food became less than 5(it's 2)
Lets create crypt fiend(oh shit, it's 5)
Lets create a skeleton(oh shit, it became 5)
 
Level 2
Joined
Aug 6, 2012
Messages
27
thks all you guys.

I retain the unit, then modify spawning and dieAll as your solutions:

  • spawning
    • Events
    • Conditions
    • Actions
      • Wait 15.00 seconds
      • For each (Integer A) from 1 to unitAmount1[int], do (Actions)
        • Loop - Actions
          • Unit - Create 1 unitType1[int] for Player 3 (Teal) at Tempno facing Default building facing degrees
          • AI - Ignore (Last created unit)'s guard position
          • Unit - Order (Last created unit) to Attack-Move To Tempminh

  • dieAll
    • Events
      • Player - Player 3 (Teal)'s Food used becomes Equal to 0.00
    • Conditions
    • Actions
      • Set int = (int + 1)
      • Trigger - Run spawning <gen> (checking conditions)
But no unit spawn :ogre_rage::ogre_rage::ogre_rage:

help me
 
Level 2
Joined
Aug 6, 2012
Messages
27
As you said, when I remove the Event of Spawning trigger, it must depend on dieAll trigger to run.

But you see, the dieAll trigger seems to never fire bcz the Event "Player - Player 3 (Teal)'s Food used becomes Equal to 5" cannot happen at the beginning of the game
 
Level 2
Joined
Aug 6, 2012
Messages
27
ok, I just did it myself :D

in the Spawning we have to keep the Event: Map initialization

not to remove it
 
Level 2
Joined
Aug 6, 2012
Messages
27
Could you upload the map, please?

That last one should definitely work (tested this myself).
The only thing I changed was that I combined spawning and dieAll, but this should not make any difference whatsoever.

it's here my dear.

Seems like the trigger "dieAll" only run once, so that there's no wave 3 and wave 4 .... for me :vw_unimpressed:
 

Attachments

  • defence.w3x
    79.9 KB · Views: 38
Level 28
Joined
Jan 26, 2007
Messages
4,789
It's because the Skeleton Warrior and the Skeleton mage don't cost any food.
Teals food will remain 0, even after spawning the entire wave, therefore "Food becomes 0" will never run again.

Also: organize your objects better! :p
- All enemy creeps should be under Custom Units - Undead - Melee.
- All player heroes should be under Custom Units - Human - Melee
- All passive buildings should be under Custom Units - Neutral Passive - Melee
(And so on, basically you should give everything its own category)
It makes your life a lot easier.
 
Level 2
Joined
Aug 6, 2012
Messages
27
It's because the Skeleton Warrior and the Skeleton mage don't cost any food.
Teals food will remain 0, even after spawning the entire wave, therefore "Food becomes 0" will never run again.

Also: organize your objects better! :p
- All enemy creeps should be under Custom Units - Undead - Melee.
- All player heroes should be under Custom Units - Human - Melee
- All passive buildings should be under Custom Units - Neutral Passive - Melee
(And so on, basically you should give everything its own category)
It makes your life a lot easier.

can u show me other way to raise next wave which does not use "Food" value ? or simply help me fix my triggers instead
:)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
You could use another integer variable. Increase it by 1 every time a unit gets spawned, decrease it by 1 every time a unit dies.

I would still recommend using food though: it's easier and there's nothing wrong with it.
Edit: The problem is this: the skeleton warrior/mage don't cost any food. What's the easy fix to that, you think?
 
Level 2
Joined
Aug 6, 2012
Messages
27
You could use another integer variable. Increase it by 1 every time a unit gets spawned, decrease it by 1 every time a unit dies.

I would still recommend using food though: it's easier and there's nothing wrong with it.
Edit: The problem is this: the skeleton warrior/mage don't cost any food. What's the easy fix to that, you think?

Don't choose them to spawn, right =.= ?

or modify them in object manager? T.T
 
Level 2
Joined
Aug 6, 2012
Messages
27
No, that would be stupid :).

Well yeah, obviously.

The problem: they don't cost any food.
The solution: make them cost food.
It's as simple as that :p.

thanks much for you huge enthusiasm ap0 :D

again I want to focus on my Unit trigger

you told in one of my previous thread that

  • -------- Level 1 --------
  • Set tempInt = (tempInt + 1)
  • Set waveCreepType[tempInt] = Peasant
  • Set waveCreepAmount[tempInt] = 20
  • -------- Level 2 --------
  • Set tempInt = (tempInt + 1)
  • Set waveCreepType[tempInt] = Footman
  • Set waveCreepAmount[tempInt] = 15

.....or sth like this but I suppose we have to declare specific array, such as:

  • -------- Level 1 --------
  • Set waveCreepType[1] = Peasant
  • Set waveCreepAmount[1] = 20
  • -------- Level 2 --------
  • Set waveCreepType[2] = Footman
  • Set waveCreepAmount[2] = 15
so It takes quite long time to input the data to this one
 
Level 2
Joined
Aug 6, 2012
Messages
27
I know what you mean but I'm still confused :D

The first one, there's no demarcation between waves, only the comments.

and " Set tempInt = (tempInt + 1)" , why computer is not confused between this one, for example, why it doesnt do for wave 2 before do for wave 1?

Sr I'm hard to explainnnn :((
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
The first one, there's no demarcation between waves, only the comments.
Then what's this?
  • Set tempInt = (tempInt + 1)
tempInt is set to 0 at the start (this is default).
If you increase it by 1, then tempInt = 1.

That means that this:
  • Set waveCreepType[tempInt] = Peasant
  • Set waveCreepAmount[tempInt] = 20
Is the same as "waveCreepType[1] = Peasant" and "waveCreepAmount[1] = 20" (because "tempInt" can just be replaced with "1").

Then it increases tempInt again ("Set tempInt = tempInt + 1"). It already was 1, so now it is 2.
When tempInt equals 2, these:
  • Set waveCreepType[tempInt] = Footman
    • Set waveCreepAmount[tempInt] = 15
can be seen as "waveCreepType[2] = Footman" and "waveCreepAmount[2] = 15".
 
Level 2
Joined
Aug 6, 2012
Messages
27
ok I got it. it means the trigger with be read from top to bottom.

hey ap0, the AI guard position remove seems not working fully!

Some of my creeps, (especially the type are neutral hostiles), after destroying some buildings, do not keep walking to next targets to attack, they stand and do nothing
 
Level 2
Joined
Aug 6, 2012
Messages
27
That function only prevents computer-controlled units (this does not include neutrals) from not returning to their spawn position.
It can be fixed by giving the units another attack-move command whenever they destroy a building.

I mean those neutral hostile creeps controlled by computer.

It can be fixed by giving the units another attack-move command whenever they destroy a building.

Can you show me this plz?:ogre_kawaii:
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I mean those neutral hostile creeps controlled by computer.
Then they're not neutral hostile >__>.
Anyway, I said "it prevents them from returning". This means that it doesn't prevent them from just stopping somewhere along the way.
(this also answers Xonox's reply, as the returning is not the problem).
Can you show me this plz?:ogre_kawaii:
  • Building Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by Player 3 (Teal)) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To Tempminh
 
Status
Not open for further replies.
Top