• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] How do I make Units appear at a time of day?

Status
Not open for further replies.
Level 4
Joined
Aug 16, 2012
Messages
63
In FOTN by Shadegabriel and the other guy.

They used a system where villagers appear in the morning and at around 18:00 they dissapear and appear at 6:00 the next day. This is a supposed continuous trigger meant to run forever.

The flaw of the trigger is that it does not work properly for single player saved games. Yep I played this game alone and got addicted.

I want to simulate the trigger in Orc Frontiers
I have seen the trigger leak before. Where the trigger starts to stop activating and never the villagers never disappear.
 
Level 4
Joined
Aug 16, 2012
Messages
63
Is it like a continuous thing and not a one time thing? I do not need "Every --seconds" Do action
 
Level 4
Joined
Aug 16, 2012
Messages
63
I need help and i have been stuck for a while now.
 

Attachments

  • desk.PNG
    desk.PNG
    14.7 KB · Views: 32
Level 9
Joined
Jul 30, 2018
Messages
445
Yes, the in-game time of day event will be trigger every in-game day.

About your second trigger: why are you adding the event to that trigger via a trigger action? Why don't you just make another trigger with that event? Or add the event there by default? Because now the trigger is ran over and over every in-game day and in theory the event is added again every time. And the if-then-else is just pointless: it will always just remove all the units you have lastly created (the (Last created unit) variable will change after every time you create a unit with triggers).

Adding event's doesn't work like that: the actions stay the same and all the actions are ran the first time the trigger is fired. You have to make a separate trigger for units entering the region where you remove the entering unit.
 
Level 4
Joined
Aug 16, 2012
Messages
63
Yes, the in-game time of day event will be trigger every in-game day.

About your second trigger: why are you adding the event to that trigger via a trigger action? Why don't you just make another trigger with that event? Or add the event there by default? Because now the trigger is ran over and over every in-game day and in theory the event is added again every time. And the if-then-else is just pointless: it will always just remove all the units you have lastly created (the (Last created unit) variable will change after every time you create a unit with triggers).

Adding event's doesn't work like that: the actions stay the same and all the actions are ran the first time the trigger is fired. You have to make a separate trigger for units entering the region where you remove the entering unit.


Can you show me how to do It? I can Rep you if you do. I tried several things It ain't hitting me. I can't make the villagers dissapear due to the the first trigger where they appear. I tried to use a mix of "A unit enters a region"+"Unit is equal to villager" or Last Created Unit. This is frustrating for me. I need a clear Idea so that I can avoid leaks and nulls especially meaningless loops.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,534
Can you show me how to do It? I can Rep you if you do. I tried several things It ain't hitting me. I can't make the villagers dissapear due to the the first trigger where they appear. I tried to use a mix of "A unit enters a region"+"Unit is equal to villager" or Last Created Unit. This is frustrating for me. I need a clear Idea so that I can avoid leaks and nulls especially meaningless loops.
A unit enters "The Void"

If unit type of TRIGGERING unit = Footman

Kill TRIGGERING unit
 
Level 9
Joined
Jul 30, 2018
Messages
445
Can you show me how to do It? I can Rep you if you do. I tried several things It ain't hitting me. I can't make the villagers dissapear due to the the first trigger where they appear. I tried to use a mix of "A unit enters a region"+"Unit is equal to villager" or Last Created Unit. This is frustrating for me. I need a clear Idea so that I can avoid leaks and nulls especially meaningless loops.

Like Uncle above said, you have to use either Triggering unit or Entering unit, Triggering unit usually being the better option. Last created unit is always tied to the Unit - Create function.

You just have to make two triggers. One being the one you have:
  • Events
    • Game - A in-game time of day becomes Equal to 0.00
  • Conditions
  • Actions
    • Unit - Create 10 Villagers
Then another trigger:
  • Events
    • Unit - A unit enters Void <gen>
  • Conditions
    • (Unity-type of (Triggering unit)) Equal to Villager Neutral
  • Actions
    • Unit - Remove (Triggering unit) from the game
And if you want the wait integrated, you can untick the "Initially on" on the Unit enter trigger and then
  • Wait 60.00 seconds
  • Trigger - Turn on (Villager Enter Void)
 
Status
Not open for further replies.
Top