• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

help! last created unit? mui?!?

Status
Not open for further replies.
Level 4
Joined
Aug 3, 2008
Messages
58
i have an ability that is going to be used by all players, and it gets glitchy cause of variable(example.unit) = last created unit. is there a certain custom script or something that can fix this glitchy trigger so the ability can be used by everyone?
 
Level 4
Joined
Aug 3, 2008
Messages
58
OK here it is =)

Cast Arrow
Events
Unit - A unit owned by Player 1 (Red) Starts the effect of an ability
Conditions
(Ability being cast) Equal to Arrow
Actions
Set CastingUnit = (Casting unit)
Unit - Create 1 Arrow for (Owner of CastingUnit) at ((Position of CastingUnit) offset by 100.00 towards (Facing of CastingUnit) degrees) facing (Facing of CastingUnit) degrees
Set Arrow = (Last created unit)
Trigger - Turn on Arrow Shoot <gen>
Trigger - Turn on Arrow Shoot Off <gen>


Arrow Shoot(off)
Events
Time - Every 0.01 seconds of game time
Conditions
Actions
Set location1 = (Position of CastingUnit)
Set location2 = (Position of Arrow)
Set location3 = (location2 offset by 12.00 towards (Angle from location1 to location2) degrees)
Unit - Move Arrow instantly to location3
Custom script: call RemoveLocation(udg_location1)
Custom script: call RemoveLocation(udg_location2)
Custom script: call RemoveLocation(udg_location3)


Arrow Shoot Off
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
Trigger - Turn off Arrow Shoot <gen>
Trigger - Turn off Arrow Shoot Off <gen>



Remove Arrow
Events
Unit - A unit enters Left <gen>
Unit - A unit enters Bottom <gen>
Unit - A unit enters Right <gen>
Unit - A unit enters Top <gen>
Conditions
(Unit-type of (Entering unit)) Equal to Arrow
Actions
Unit - Remove (Entering unit) from the game
 
Level 5
Joined
Oct 3, 2008
Messages
104
create an array for the arrow, so say u hav 12 players using this arrow ability, make the array size 12, and set the array according to the player number of the casting unit
it wont be MUI, but at least MPI, which is usually good enough

u might need to do that for alot of ur other variables as well
i use array size 12 for most of my maps
 
Status
Not open for further replies.
Top