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

[General] Fling Corpse ability for Meat Wagon

I had this idea of an actively used ability for the Undead's Meat Wagon unit:
Aslong there is atleast one corpse inside the Meat wagon it can be used.
Click the button, select target point location. Only locations eligible where a corpse can exist are accepted.
Meat Wagon fires a projectile there, which becomes a corpse on the ground.
-1 corpse carried on moment of firing as it was the ammo used for this.

Basically, the Meat Wagon flings one of the carried corpses over the distance, animated like a regular artillery attack, results in a corpse on the ground at target point when projectile lands.

However i dont really know how it should be setup to function, so any help would be appreciated.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,555
It was no easy task but here you go. I'm using Bribe's Unit Indexer to manage tracking the Corpses in the Meat Wagons and Chopinski's Relativistic Missiles system to manage the custom Corpse missiles. You'll want to make sure that these systems don't interfere with anything you already have in your map (they probably won't unless you have a lot of imported triggers). Also, there are some rules for using Bribe's Unit Indexer which you may be breaking, but again, you most likely aren't. The main rule is the use of the Set Custom Value action - which you should NOT be using anymore if you have a Unit Indexer in your map.
 

Attachments

  • Corpse Artillery 1.w3m
    86 KB · Views: 8
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,555
Hmm... 'Level info data missing or invalid' on trying to open, what version of the game is that intended for ?
I'll always be on the latest version, 1.36 in this case.

Here are the triggers:
  • Corpse Artillery Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Corpse Artillery
    • Actions
      • Set VariableSet CA_Wagon = (Triggering unit)
      • Set VariableSet CA_CV = (Custom value of CA_Wagon)
      • -------- --------
      • Custom script: set udg_CA_Corpse = FirstOfGroup( udg_CA_Corpse_Group[udg_CA_CV] )
      • Custom script: set udg_CA_Corpse_Id = GetUnitTypeId( udg_CA_Corpse )
      • Unit Group - Remove CA_Corpse from CA_Corpse_Group[CA_CV].
      • Unit - Remove CA_Corpse from the game
      • -------- --------
      • -------- Missile Properties: --------
      • Set VariableSet MissileData = CA_Corpse_Id
      • Set VariableSet MissileSource = CA_Corpse
      • Set VariableSet MissileStart = (Position of CA_Wagon)
      • Set VariableSet MissileFinish = (Target point of ability being cast)
      • Set VariableSet MissileOwner = (Owner of MissileSource)
      • Set VariableSet MissileModel = Abilities\Weapons\MeatwagonMissile\MeatwagonMissile.mdl
      • Set VariableSet MissileScale = 1.00
      • Set VariableSet MissileStartZ = 0.00
      • Set VariableSet MissileFinishZ = 0.00
      • Set VariableSet MissileSpeed = 900.00
      • -------- Arc should be between 0 and 80: --------
      • Set VariableSet MissileArc = 60.00
      • Set VariableSet Missile_onFinish = Corpse Artillery Impact <gen>
      • Trigger - Run MissileCreate <gen> (ignoring conditions)
      • -------- --------
      • Set VariableSet CA_Corpse_Count[CA_CV] = (CA_Corpse_Count[CA_CV] - 1)
      • Wait 0.01 game-time seconds
      • Set VariableSet CA_Wagon = (Triggering unit)
      • Set VariableSet CA_CV = (Custom value of CA_Wagon)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CA_Corpse_Count[CA_CV] Equal to 0
        • Then - Actions
          • Unit - For CA_Wagon, Ability Corpse Artillery , Disable ability: True, Hide UI: False
          • Custom script: call DestroyGroup( udg_CA_Corpse_Group[udg_CA_CV] )
        • Else - Actions
  • Corpse Artillery Impact
    • Events
    • Conditions
    • Actions
      • Custom script: set udg_CA_Corpse_Type = udg_MissileData
      • Unit - Create a CA_Corpse_Type corpse for MissileOwner at MissileFinish
      • Set VariableSet CA_Point = (Position of (Last created unit))
      • Special Effect - Create a special effect at CA_Point using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation( udg_CA_Point )
  • Corpse Artillery Disable 1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Level of Corpse Artillery for (Matching unit)) Greater than 0)) and do (Actions)
        • Loop - Actions
          • Unit - For (Picked unit), Ability Corpse Artillery , Disable ability: True, Hide UI: False
  • Corpse Artillery Disable 2
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Level of Corpse Artillery for (Triggering unit)) Greater than 0
    • Actions
      • Unit - For (Triggering unit), Ability Corpse Artillery , Disable ability: True, Hide UI: False
  • Corpse Artillery Load Corpse
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Get Corpse
    • Actions
      • Set VariableSet CA_Wagon = (Triggering unit)
      • Set VariableSet CA_CV = (Custom value of CA_Wagon)
      • -------- --------
      • Set VariableSet CA_Corpse_Count[CA_CV] = (CA_Corpse_Count[CA_CV] + 1)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CA_Corpse_Count[CA_CV] Equal to 1
        • Then - Actions
          • Unit - For CA_Wagon, Ability Corpse Artillery , Disable ability: False, Hide UI: False
          • Custom script: set udg_CA_Corpse_Group[udg_CA_CV] = CreateGroup()
        • Else - Actions
      • -------- --------
      • Unit Group - Add (Target unit of ability being cast) to CA_Corpse_Group[CA_CV]
  • Corpse Artillery Unload Corpse 1
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Drop Corpse
    • Actions
      • Wait 0.01 game-time seconds
      • Set VariableSet CA_Wagon = (Triggering unit)
      • Set VariableSet CA_CV = (Custom value of CA_Wagon)
      • -------- --------
      • Unit Group - Pick every unit in CA_Corpse_Group[CA_CV] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is loaded into CA_Wagon.) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from CA_Corpse_Group[CA_CV].
              • Set VariableSet CA_Corpse_Count[CA_CV] = (CA_Corpse_Count[CA_CV] - 1)
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CA_Corpse_Count[CA_CV] Equal to 0
                • Then - Actions
                  • Unit - For CA_Wagon, Ability Corpse Artillery , Disable ability: True, Hide UI: False
                  • Custom script: call DestroyGroup( udg_CA_Corpse_Group[udg_CA_CV] )
                • Else - Actions
            • Else - Actions
  • Corpse Artillery Unload Corpse 2
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Level of Corpse Artillery for (Triggering unit)) Greater than 0
      • (Issued order) Equal to (Order(unload))
    • Actions
      • Set VariableSet CA_Wagon = (Triggering unit)
      • Set VariableSet CA_CV = (Custom value of CA_Wagon)
      • -------- --------
      • Set VariableSet CA_Corpse_Count[CA_CV] = (CA_Corpse_Count[CA_CV] - 1)
      • Unit Group - Remove (Target unit of issued order) from CA_Corpse_Group[CA_CV].
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CA_Corpse_Count[CA_CV] Equal to 0
        • Then - Actions
          • Unit - For CA_Wagon, Ability Corpse Artillery , Disable ability: True, Hide UI: False
          • Custom script: call DestroyGroup( udg_CA_Corpse_Group[udg_CA_CV] )
        • Else - Actions
The variables you need to create yourself:
variables.png

The non-CA variables come from the two systems I mentioned before.
You'll also need those two systems I mentioned before copied into your Trigger Editor, I'll update my last post with links to them.

All of this will work on version 1.31+ but you may need to find versions of the systems that are compatible.
 
Last edited:
Top