• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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