Make all Humans Sleep

Ninva

Анна Ахматова
Reaction score
377
Hi, I'm trying to make a trigger where the game selects all the players of a certain race to sleep at a certain time. This is my trigger, but what doesn't happen is the desired result. The units that are selected are able to sleep (I checked the box in the Object Editor), but they just stand awake. Would there be a way to cast a sleep spell on each individual unit? If so, I might just do that... But I can't figure out how to do that.

Sleeping
Events
Game - The in-game time of day becomes Equal to 22.00
Conditions
Actions
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Unit Group - Pick every unit in (Units owned by (Picked player) matching ((Race of (Picked player)) Equal to Human)) and do (Actions)
Loop - Actions
Unit - Make (Triggering unit) Sleep when unprovoked
 

Syndrome

You can change this now in User CP.
Reaction score
126
Unit - Make Triggering Unit should be Unit - Make Picked Unit
Though what you could do is...

Sleeping
Events
Game - The in-game time of day becomes Equal to 22.00
Conditions
Actions
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Unit Group - Pick every unit in (Units owned by (Picked player) matching ((Race of (Picked player)) Equal to Human)) and do (Actions)
Loop - Actions
Unit - Create 1 SleepDummy at Position of Picked Unit
Unit - Order Last Created Unit to cast Sleep on Picked Unit
Unit - Remove Last Created Unit

Where SleepDummy could be a dummy unit with the Dreadlord sleep ability.
 

Syndrome

You can change this now in User CP.
Reaction score
126
It probably will. If you have tons of units anyways. But only for a moment.
It's best to actually manually place a dummy unit into the map and remove it VIA triggers, then the game would load the unit up then rather than in the middle of a game. It'll definitely alleviate the worst of it.
EDIT- is there an actual trigger to force a unit to sleep without using abilities? I haven't used the world editor in so so long...
 

Ninva

Анна Ахматова
Reaction score
377
It states it makes a unit sleep when unprovoked. A unit must always be in a state of provocation when controlled by a player, and therefore the trigger does not work, unless my logic is just wrong in the trigger I made.
 

MP®

Member
Reaction score
11
Making a unit sleep by triggers works only for neutral (hostile?) units
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Player units don't fall asleep by any means other than magic. You'll have to trigger the whole thing, but there's no need to create a new dummy for every unit. So long as the dummy has no casting times and the ability has no cooldown, you can get one dummy to cast Sleep on every unit on the map at the same time.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top