HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Automatic Sleeping Units

02-16-2004, 01:49 AM#1
gandalf_03246
I originally wanted to make some user human units sleep at night and some orc player units sleep during the day. I'm thinking maybe the orc part might not be possible now.

What's the best route for achieving this? If I change a units race to creep will it sleep like a neutral? Is there anyway I can make a unit sleep during the day? Is there a better route using abilities (I was thinking of maybe somehow combining shadowmeld with the forced sleep ability)....
02-16-2004, 01:51 AM#2
Bulletcatcher
My suggestion would be to, at 1800, pause all units that should sleep during the night and attach a sleep special effect to them. Whenevery they are attacked by an enemy or the time turns to 0600, destroy the effects and unpause the units.

Do the reverse for units that would sleep during the day.
02-16-2004, 12:58 PM#3
Andyx
Bulletcatcher is right about that part. When the time reaches the night time, pause the units you wish and create a special effect on them... and I have heard that player-owned units cannot sleep at night like neutral units, although I have never tried it...

Oh, and if you want to make the sleeping unit wake up when attack,first, create an event of: If a unit owned by player x is attacked. then, just remove the special effect and unpause the units.
02-17-2004, 03:49 PM#4
gandalf_03246
this is all true, but I was hoping there was a way without extensive use of triggers. The map is already trigger intensive and runs a little slow...but if it's the only way i guess I can always try it.
02-17-2004, 05:34 PM#5
dexllgamer
You could put all the units in a group and compare the unit to the group of preselected units to see if it is a unit that needs to sleep. That way you only need 1 trigger and it will only fire if it is needed.

Event:
Time turns Night time (1800)

Condition: nothing

Action: (pick every unit matching condion and do multiple actions)
PICK EVERY UNIT in whole map who MATCHING CONDITION (picked unit is in pre-selected group) AND Action: Paused picked unit. Attach special effect (sleeping) to picked unit. Play sleeping sound effect on picked unit.

Maybe this will work maybe it wont, but it should put you on the right track.

GL
02-18-2004, 07:48 AM#6
Newhydra
If you don't mind them being woken up by being attacked you can just use the "always sleep" ability....Give the unit the always sleep ability during the night, and remove it during the day(and make it affect player slots). It won't, however, put the unit back to sleep after they've been attacked.

The always sleeps ability does not make a human controlled unit always sleep, it just puts the unit to sleep once, and the sleep lasts until the unit is woken up by being attacked...

If you add a second version of the ability while the unit already has it, nothing will happen, so you need to be sure to remove the ability before you add it.

If, however, you give the unit 2 copies of the ability before one has taken effect (start the unit with 2 copies...) the unit will never wake up, and the 'zzz' will never show up.
02-19-2004, 05:39 PM#7
gandalf_03246
yah i was wondering about that ability, it acts really strange. Thanks though that helps a lot. I think I have a plan for what I'll do.