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

MUI Projectile Trouble

Status
Not open for further replies.
Level 2
Joined
Sep 23, 2008
Messages
8
I had a (very rough) triggered spell[1], which caused the caster to fire a "ki ball" towards the area of the ability which it was based upon. The ball would then be destroyed if it came within 50.00 of any unit, and also deal damage to them. I had this working to a satisfactory level and was about to neaten it up when i stumbled upon a problem;

The variables I use in the triggers do not allow Mulit-Unit-Instancing, I spent the next hour researching MUI, and managed to apply it successfully[2]. However the tutorial read that you may not use the local variable in a "pick every unit" action, which my spell contains;

-Are there any loopholes or techniques I can use to make my spell MUI?

Any help will be greatly appreciated.

[1]Ki Ball Trigger 1
  • Events
  • Unit - Unit begins casting a spell
  • Conditions
  • (Abilitiy Being Cast) Equal to Ki Ball (Neutral Hostile)
  • Actions
  • Unit - Create 1 Ki Ball for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
  • Set Combatant1KiBall[1] = (Last created unit)
  • Unit - Add a 5.00 second Generic expiration timer to Combatant1KiBall[1]
  • Unit - Order Combatant1KiBall[1] to Move To (Target point of ability being cast)
Ki Ball Trigger 2

  • Events
  • Time - Every 0.50 seconds of game time
  • Conditions
  • Actions
  • Unit Group - Pick every unit in (Units within 50.00 of (Position of Combatant1KiBall[1])) and do (Actions)
    • Loop - Actions
      • Unit - Cause Combatant1KiBall[1] to damage (Picked unit), dealing 50.00 damage of attack type Spells and damage type Universal
      • Unit - Kill Combatant1KiBall[1]
      • Special Effect - Create a special effect at (Position of Combatant1KiBall[1]) using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl


[2] MUI Test - this worked successfully, with 5 footmen being created and destroyed in the correct order and completely.
  • Events
  • Player - Player 1 (Red) types a chat message containing fire as An exact match
  • Conditions
  • Actions
  • Custom script: local unit udg_muitest
  • Unit - Create 1 Footman for Player 1 (Red) at (Random point in (Playable map area)) facing Default building facing degrees
  • Set muitest = (Last created unit)
  • Wait 10.00 seconds
  • Unit - Kill muitest
*PS. I know it leaks; like I said, rough!

~Tyross
 
Level 2
Joined
Sep 23, 2008
Messages
8
Correct me if im wrong; but the problem im trying to work through in my head is;

If i set Combatant1KiBall[1] a local variable to trigger [1] using the jass script, then trigger [2] will not be able to read that local variable?

But if i make Combatant1KiBall[1] a global variable, then i cannot make the trigger MUI?
 
Level 2
Joined
Sep 23, 2008
Messages
8
Indeed useful for the making the projectile aspect MUI, however I still cant work out how to make the other aspect trigger [2] MUI?

-Blooddancer, I stated in my first post that it leaks, because i just wanted to get the spell working, I can plug the leaks and make it tidier later.
 
Status
Not open for further replies.
Top