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

[Trigger] A thanks to everyone and a solution

Status
Not open for further replies.
Level 3
Joined
Jul 29, 2008
Messages
30
A few times its been asked how to make devour a multi unit ability, I asked it as well and got several suggestions and help on different parts of scripting an gui triggers. I just wanted to say thanks for the help here and I believe I have found a solution that just might work. I'm looking for reviews on the mechanics of this.

First of all the devour ability is not used at all. Instead a copy of charm with its tooltip and button picture changed to devour. Tone down its range to a small amount so that when used a unit will be close enough to be "loaded" as in transport loaded.

See where I'm going? Add the cargo and load abilities to the unit change the cargo to whatever size desired, then make a trigger that causes a unit who uses the charm ability to load the targeted unit. Also set the units custom value to -2.

In a completely seperate trigger detect a unit changing ownership event. First check the custom value to see if it is -1. This is to see if the unit is changing ownership back to its original team. Else if it is -2 set the custom value of the unit to the player index of its previous owner.

In a seperate trigger detect unit is loaded onto transport. The unit is now in so add it to a unit group called stomach or similar. Set a variable to its custom value then change its custom value to -1. Change its ownership back to the value you saved in a var so that you now have an enemy unit inside the cargo of a friendly unit. Now wait whatever time you wish and order the transporting unit to unload the loaded unit. You could just skip that part if you wish if you want them permanently devoured until the unit dies.

Now in the final trigger do a every 2 seconds or similar event and pick every unit in the stomach unit group and deal damage to them.

I havn't fully tested this yet. Only pieces and parts, but what do you think? Will it work?
 
Level 15
Joined
Aug 18, 2007
Messages
1,390
Aint there an abillity called Devour (Cargo) that you can add to a unit that always have the spell Devour? If i remmember right, Devour Cargo allows you to have up to 12 units devoured at once (2 is base, but it can be changed, and the spell that triggers Devour cargo can too i think, lol imgaine getting devoured after a Storm Bolt xD).
 
Level 3
Joined
Jul 29, 2008
Messages
30
No changing the devour cargo doesnt effect the ability. The devour ability is hardcoded to take one unit into the cargo. At least I think it is. In all my experiments i wasnt able to get it to do more than one.
 
Level 3
Joined
Jul 29, 2008
Messages
30
Yah just confirmed it again changing the devour cargo size doesnt allow any more units to be devoured. The devour ability is hardcoded. That 2 capacity is there so larger units like mortar teams can be eaten since their transport size is 2.
 
Level 3
Joined
Jul 29, 2008
Messages
30
Wow thats a silly idea, and no tried it, doesn't work. If there were a quick fix I wouldn't have gone through the trouble of that horribly complex trigger system I just explained.
 
Status
Not open for further replies.
Top