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

Corpse Decay prevention

Status
Not open for further replies.
Level 1
Joined
Dec 9, 2018
Messages
2
Hello. I have a question on the WC3 Editor.
If Possible, How do I prevent corpses from dissapearing from the map, indefinetly? (if possiple, in flesh form)
From what I gather Corpses have 2 forms, First, in flesh, which uses the actual unit model, and then Bone form, which sorta resembles what the unit skeleton would look like.
I would like to make a map, where if one of your units gets killed, it's corpse would stay, and you'd be able to collect it with a meat wagon, use if for ressurection, raise skeletons with it, but Overall, I just want to more or less create an effect of sort of what would be the aftermath of a Great battle, and have all the corpses layed out, of the fallen soilders.

So far
I know that there is a gameplay constant on decay flesh and decay bones, but that has a limit to how long it goes, (about maybe like 5-10 minutes) and simply it just doesnt quite cut it for me.

I also know there is a unit setting "doesn't decay, Can rise" but I found that when I used this setting, when the unit died, it would go into death animation, fall on the ground, and it's corpse just simply dissapeared.

I also was reccomended to use a trigger
Event: Unit {generic unit event} - A unit decays
Action: Unit - Suspend Corpse Decay for (triggering Unit)
When I used this trigger, it seemed to not have any effect on the Unit and Corpse decay at all.

I may or may have not used the trigger properly, i am not quite used to the Trigger editor. Infact, I wouldn't say I am quite adept at the WC3 Map editor in general, so if anyone would have a solution for me, please try to explain it abit more in detail, for a newbie, such as myself.

Thank you for reading, I hope you have a nice day.
 
Level 13
Joined
May 10, 2009
Messages
868
This might the function you are looking for.

upload_2018-12-10_19-12-55.png
 
Level 21
Joined
May 29, 2013
Messages
1,567
If the time set in 'Art - Death Time (seconds)' field is longer than the duration of the model's death animation, the unit will stay frozen in the last frame of the death animation until the time defined in this field passes. However, Heroes cannot begin reviving and some abilities like Raise Dead and Cannibalize cannot be used on the unit until the time set in this field had passed.

This might the function you are looking for.

View attachment 311383
Action: Unit - Suspend Corpse Decay for (triggering Unit)
When I used this trigger, it seemed to not have any effect on the Unit and Corpse decay at all.
 
Level 1
Joined
Dec 9, 2018
Messages
2
Thank you for your responses.

Aeryn
You can use "Create permanent corpse" then remove the dead unit from the game.
I used the trigger as it follows:
Events:
Unit - A unit Dies
Actions:
Unit - Remove (Triggering unit) grom the game
Unit - Create a permanent Fleshy (Unit-type of (Triggering unit)) corpse for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees

Okey, so first couple of times i have tried this, For some "mysterious" reason, the corpse of the unit that was created also seemed to vanish. Later after some playtasting, I decided to disable the Gameplay Constants (which I had shortened for faster testing, for about 4 seconds each for both Flesh and Bones), and I found out that the created corpse didn't Vanish after 88 seconds (of the defult decay time). {The issue that I was having was the edited gameplay constants.}
To which my goal was somewhat reached. The only downside to this is, that after the corpse is picked up with a meat wagon, the Pernament Flesh corpse is turned into a normal bones corpse with a lifespan of 88 seconds.

Warseeker
I don't know if this gonna work but perhaps you can open the model in question with War3ModelEditor and rename his "Decay Flesh" animation to "Decay Bone" instead in the Sequence Manager.

I have never dabbled in War3ModelEditor, and to be perfectly honest with you, I was hoping that I wouldn't need to use it. However, it is in my opinion, that it wouldn't exactly solve my issue, as the animation isn't the problem, it's what the game mechanicly understands as a corpse is what I am after.

BloodSoul
This might the function you are looking for. (unit - suspend corpse decay)

I don't know what to tell you. After considerable testing (including disabling/enabling custom gameplay constants) the Trigger action hasn't had any effect on the corpse decay. At first I thaught that I wasn't using the right event (which might still be the case), but I tried - the unit dying, map initialization, the unit decaying, the time is day/night, specificly selected unit that when it died, and/or decayed it's corpse would have suspended decay but no matter what I have tried, that Trigger action just didn't want to work.

Hermit
If the time set in 'Art - Death Time (seconds)' field is longer than the duration of the model's death animation, the unit will stay frozen in the last frame of the death animation until the time defined in this field passes. However, Heroes cannot begin reviving and some abilities like Raise Dead and Cannibalize cannot be used on the unit until the time set in this field had passed.

2 problems I have with this: - The corpses are temporary, secondly, you said yourself, Corpse-related Abilities wouldn't work.

---
Basicly, Aeryn kinda solved my issue. Create pernament flesh corpse worked, if the Gameplay constants Decay Bones/Decay Flesh warent changed, otherwise, Create pernament flesh corpse doesnt work for some reason.

My only imperfection was that when the corpes ware picked up with a meat wagon, and then dropped again, it would just simply appear as a 88 second bone corpse. To fix this I have tried to change the Event from [unit - A unit dies] to [ unit - A unit decays ] seeing, as when a unit/corpse starts to decay, it would create a new corpse, in it's place and delete the old one. HOWEVER, what happend is that when a unit would die, the game would crash. Like, the game would instantly return me to the desktop with no error or nothing, just compleate breakdown of the program it seems. After giving it some thaught, I think that, what is happening, in actuality, is that A unit decaying is an on-going process, and when an action took place of the event, an action that would create something, it would create that something for as long as the unit is decaying, resulting in infinite corpses being created as a result of the corpse decaying. (I am not sure though, God knows I am no programmer). Just wanted to share my attepmt and state that it doesnt work.
if someone knows a workaround or a better solution, I would be happy to hear it, otherwise, my problem was solved.

Thank you for reading

Edit: After Some playtesting and implementation, for some reason, this morning, another problem arised. After I implemented the Create corpse, remove unit Trigger, for some reason death animations did not play after the unit died, instead it just instantly, a corpse would appear. I understand why that might be happening, however it did not happen the first time I did it. Oh, well.

Edit #2: Another thing I found is that, buildings also seem to leave pernament remains after trigger implementation huh?
 
Last edited:
Level 5
Joined
Mar 5, 2015
Messages
135
So far
I know that there is a gameplay constant on decay flesh and decay bones, but that has a limit to how long it goes, (about maybe like 5-10 minutes) and simply it just doesnt quite cut it for me.

Are you sure there is a limit? Trying to set it in my game constants, I can put it all the way to 100.000 seconds, which is around 27 hours. Haven't tested it in the game, but the constants allows you to set to more than 5-10 minutes.

upload_2018-12-11_10-4-20.png


EDIT: You're right - it has a limit around 10 minutes, even though you can set the constants higher than that. Just ran a test, which proved me wrong.
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
Thank you for your responses.

...

Oh well. It turns out I overlooked your first post, and you are right - that function is useless for that purpose.

My only imperfection was that when the corpes ware picked up with a meat wagon, and then dropped again, it would just simply appear as a 88 second bone corpse. To fix this I have tried to change the Event from [unit - A unit dies] to [ unit - A unit decays ] seeing, as when a unit/corpse starts to decay, it would create a new corpse, in it's place and delete the old one. HOWEVER, what happend is that when a unit would die, the game would crash. Like, the game would instantly return me to the desktop with no error or nothing, just compleate breakdown of the program it seems. After giving it some thaught, I think that, what is happening, in actuality, is that A unit decaying is an on-going process, and when an action took place of the event, an action that would create something, it would create that something for as long as the unit is decaying, resulting in infinite corpses being created as a result of the corpse decaying. (I am not sure though, God knows I am no programmer). Just wanted to share my attepmt and state that it doesnt work.
if someone knows a workaround or a better solution, I would be happy to hear it, otherwise, my problem was solved.

Thank you for reading

Edit: After Some playtesting and implementation, for some reason, this morning, another problem arised. After I implemented the Create corpse, remove unit Trigger, for some reason death animations did not play after the unit died, instead it just instantly, a corpse would appear. I understand why that might be happening, however it did not happen the first time I did it. Oh, well.

Edit #2: Another thing I found is that, buildings also seem to leave pernament remains after trigger implementation huh?

Creating permanent corpses fires the "Unit - A Unit Decays" event, which is why your game is running into an infinite loop. To solve it, you have to disable the trigger, do your actions, and re-enable it.

  • Events
    • Unit - A unit Decays
  • Conditions
  • Actions
    • Trigger - Turn off (This trigger)
    • Set point = (Position of (Triggering unit))
    • Unit - Create a permanent Skeletal (Unit-type of (Triggering unit)) corpse for (Triggering player) at point facing (Facing of (Triggering unit)) degrees
    • Unit - Remove (Triggering unit) from the game
    • Custom script: call RemoveLocation(udg_point)
    • Trigger - Turn on (This trigger)
Also, it's interesting how changing the gameplay constants decay values messes up with the permanent corpses.
 
Last edited:
Level 7
Joined
Apr 17, 2017
Messages
316
Alrighty try this:
  • indexing
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set maxindex = (maxindex + 1)
      • Set deadunit[maxindex] = (Triggering unit)
      • Set unittype[maxindex] = (Unit-type of deadunit[maxindex])
      • Set deadunitloc[maxindex] = (Position of deadunit[maxindex])
      • Set counter[maxindex] = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • maxindex Equal to 1
        • Then - Actions
          • Trigger - Turn on loop <gen>
        • Else - Actions
  • loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer currentindex) from 1 to maxindex, do (Actions)
        • Loop - Actions
          • Set counter[currentindex] = (counter[currentindex] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • counter[currentindex] Equal to 2
            • Then - Actions
              • Unit - Create a permanent Skeletal unittype[currentindex] corpse for (Owner of deadunit[currentindex]) at deadunitloc[currentindex] facing (Facing of deadunit[currentindex]) degrees
              • Unit - Remove deadunit[currentindex] from the game
              • Custom script: call RemoveLocation(udg_deadunitloc[udg_currentindex])
              • Set deadunitloc[currentindex] = deadunitloc[maxindex]
              • Set unittype[currentindex] = unittype[maxindex]
              • Set deadunit[currentindex] = deadunit[maxindex]
              • Set counter[currentindex] = counter[maxindex]
              • Set maxindex = (maxindex - 1)
              • Set currentindex = (currentindex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • maxindex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 
Level 7
Joined
Apr 17, 2017
Messages
316
about the meat vagon thingie, there is no single way to detect whenever unit uses a corpse however, after defining which spells or systems use corpses in your map, you can basically do this for all kinds of spells;
  • meatvagon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Drop Corpse
    • Actions
      • Set maxindex2 = (maxindex2 + 1)
      • Set vagon[maxindex2] = (Triggering unit)
      • Set vagonloc[maxindex2] = (Position of vagon[maxindex2])
      • Set counter2[maxindex2] = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • maxindex2 Equal to 1
        • Then - Actions
          • Trigger - Turn on vagon loop <gen>
        • Else - Actions
  • vagon loop
    • Events
      • Time - Every 6.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer currentindex2) from 1 to maxindex2, do (Actions)
        • Loop - Actions
          • Set counter2[currentindex2] = (counter2[currentindex2] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • counter2[currentindex2] Equal to 2
            • Then - Actions
              • Set getcorpse[currentindex2] = (Units within 200.00 of vagonloc[currentindex2] matching (((Matching unit) is dead) Equal to True))
              • Unit Group - Pick every unit in getcorpse[currentindex2] and do (Actions)
                • Loop - Actions
                  • Set corpseloc = (Position of (Picked unit))
                  • Unit - Create a permanent Skeletal (Unit-type of (Picked unit)) corpse for (Owner of (Picked unit)) at (Position of (Picked unit)) facing (Facing of (Picked unit)) degrees
                  • Unit - Remove (Picked unit) from the game
                  • Custom script: call RemoveLocation(udg_corpseloc)
              • Custom script: call DestroyGroup(udg_getcorpse[udg_currentindex2])
              • Custom script: call RemoveLocation(udg_vagonloc[udg_currentindex2])
              • Set vagonloc[currentindex2] = vagonloc[maxindex2]
              • Set vagon[maxindex2] = vagon[maxindex2]
              • Set counter2[currentindex2] = counter2[maxindex2]
              • Set maxindex2 = (maxindex2 - 1)
              • Set currentindex2 = (currentindex2 - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • maxindex2 Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
However there is tiny little problem, after removing the unit, corpses disappear for a tiny fraction of time, then they reappear.

To sum it up a bit, if a unit dies, this happens before the death animation plays. So your trigger instantly removes them the moment they die. In the first two trigger, I used a timer and indexing system to keep track of dead units, then when the timer expires, it creates corpses amd removes units from the game.

In the last two trigger I used the same thingie with different event. As meat vagon's drop corpse is an ability, you can use "A unit starts the effect of an ability event"
 
Last edited:
Level 28
Joined
Feb 18, 2014
Messages
3,580
I have never dabbled in War3ModelEditor, and to be perfectly honest with you, I was hoping that I wouldn't need to use it. However, it is in my opinion, that it wouldn't exactly solve my issue, as the animation isn't the problem, it's what the game mechanicly understands as a corpse is what I am after.
If I understood correctly, you want the unit to remain on flesh form instead of turning into Bone form after decaying? if that's the case, then you can simply remove the Decay Bone and Decay Flesh animation from the unit and that should solve the problem.

Here's an example :
 

Attachments

  • FootmanNoDecay.mdx
    102.3 KB · Views: 74
Status
Not open for further replies.
Top