• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Play doodad's animation when its night time

Status
Not open for further replies.
Level 13
Joined
Aug 19, 2014
Messages
1,111
Hello guys I just want to ask if its possible to play a doodad's animation when its night time and will change its animation in daytime.
 
Yes.

Use this function:
  • Animation - Play the <Animation i.e. "stand"> animation for all doodads of type <Doodad Type> within (Playable map area)
In response to this event:
  • Game - The in-game time of day becomes Equal to 18.00
Or use 6.00 for day-time.

If your doodads are only within a specific area, I highly recommend making a specific region around them using the region editor. It isn't the best idea to run the animation function over the entire map area. If the map is huge, I imagine the engine could take a long time enumerating all of them. But hey, you don't know until you try it. You can try it as it is, and if it doesn't cause a short freeze or anything, then feel free to leave it as it is!
 
If your doodads are only within a specific area, I highly recommend making a specific region around them using the region editor. It isn't the best idea to run the animation function over the entire map area. If the map is huge, I imagine the engine could take a long time enumerating all of them. But hey, you don't know until you try it. You can try it as it is, and if it doesn't cause a short freeze or anything, then feel free to leave it as it is!
I actually played around with the PlayAnimationForDoodadsInRect function a lot for my external highres texture pack and noticed it's pretty damn well optimized. It's not like enumerating destructables or units at all!

I ended up using a single function with almost 200 consecutive PlayAnimation functions (as you don't have much choice... it's not a regular enumeration that allows a custom callback so I couldn't implement a lookup table) in a 50k doodad map and it only creates a barely noticable hickup.
 
Status
Not open for further replies.
Top