• 🏆 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!

Day/Night Spawn System.

Status
Not open for further replies.
Level 12
Joined
Nov 24, 2007
Messages
543
So I've been trying to create this system for the better part of two days with little luck.
I'll try to explain as best as I can. The system has to replace the dead units with a day/night cycle. lets say player 2 is night time units and player 3 is day time units.

Now night comes, (18:00) all day units are removed/killed via triggers and all the night units appear or are created if killed. Same goes for day (6:00) night units are removed and day units resurrected /respawned.


My requirements for this system are:

-At the start of the game. All of players 2(night units) and all of player 3(day units) units(they are on the map already) get their position/unit types fixed (they have to respawn at those positions come dusk and dawn).

- If killed they have to remain dead until their time comes (Day for day units and night for night units) when that time comes they respawn.

Now the problems that I ran into are if the units corpse disappears(raise dead/cannibalize/decays on its own) the game can't find where it was and doesn't create it(Increasing bone decay to 360s causes glitches). Same goes for the units type.

SIDE NOTE: needs to be GUI as I can't edit JASS. The creator will the given special thanks in the campaign and +rep ofc. Good luck! :)
 
Level 12
Joined
Nov 24, 2007
Messages
543
Attached is the map. I tried to make it as GUI as possible, though I haven't fully tested it out yet.

The system seems to only resurrect heroes, also if you change anything in the map itself it always gives this error. the Line itself always seems to be different.
error.png
 
Level 12
Joined
Nov 24, 2007
Messages
543
Well this one works better, but there are still a few things wrong, the units respawn at the places they were killed, not at the places where they were at the start of the map. If the corpse gets used(raise dead) it doesn't respawn at all(But this isn't a huge problem).

Also, the game keeps spamming this message constantly: :)
weird.png
 
Oops, I forgot to remove that one. Just look for the function
call BJDebugMsg() in the map header and remove them. As for the OnDeath trigger, set the boolean to false like this
  • Custom Script - if false then
About the resurrection thing, I did not factor that in, but it can be detected by a unit issuing an undefend order. The idea is that the unit issuing the order must have a disabled ability based on Defend (footman). When the unit issues an undefend order, it tells the game that the unit has experienced an event that cannot be detected by conventional means.

Anyways, look up Bribe's Unit Event. You can use that to detect when the unit has been resurrected and pause their associated timers respectively.
 
Last edited:
Level 12
Joined
Nov 24, 2007
Messages
543
Oops, I forgot to remove that one. Just look for the function
call BJDebugMsg() in the map header and remove them. As for the OnDeath trigger, set the boolean to false like this
  • Custom Script - if false then
About the resurrection thing, I did not factor that in, but it can be detected by a unit issuing an undefend order. The idea is that the unit issuing the order must have a disabled ability based on Defend (footman). When the unit issues an undefend order, it tells the game that the unit has experienced an event that cannot be detected by conventional means.

Anyways, look up Bribe's Unit Event. You can use that to detect when the unit has been resurrected and pause their associated timers respectively.

Well, what can I say, it works! Outstanding job. Thank you. Here's your +rep and be sure to look for your personal credit in the new maps ;)
 
Status
Not open for further replies.
Top