• 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.

[Trigger] MUI Custom script commands

Status
Not open for further replies.
i need the custom script commands for my map because i realy need the real local varibile for a knockback so multiple spells can be casted. this is for my minigame map for the units that have guns so they can shoot without haveing there bullet mucking up because some1 else shoots the same spell

Commands Already known:-
local unit
local unittype
local effect
local region
local ability

please list em down cause its realy hard to guess em all but 1 took me 3 hours each to get correct xD

or can you give me a link to a tut that has em listed down D:
 
Level 11
Joined
Oct 13, 2005
Messages
233
You should be able to create a MUI knockback spell without using local variables. I would recommend using global array variables and some sort of indexing system. Whenever a unit needs to be knocked back, get an unused integer index, set the unit's custom value to it, add the unit to a group that contains the units being knocked back, and then set the global array variables appropriately.

In order to create a smooth knockback ability in GUI, you will need to use a timer. Because of this, local variables will not be of any help to you for this purpose. You will need to use a more complex approach if you wish for a smooth knockback.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I'd post the same thing I posted at least 3 times before, but the shitty awesome search engine won't find it. In fact, it only finds 170 of my posts. The other 2500 went to a trip or something.

And no, you do not need any locals whatsoever.


Make an integer.
Make a timer.
Make an array of units (which will be seeded with your bullets), make an array of reals for the facing, and an array for any other attribute (time to live, distance, or anything you want).

I will refer to the variables above as 'Total', 'Tim', 'Units' and 'Faces'.

Make a trigger that runs every time the spell is casted:
1) Set Units[Total] to the newly made bullet.
2) Set Faces[Total] to it's facing.
3) Set Total = Total + 1
4) If Total is equal to 1 start Tim (go with something between 0.03 and 0.05).

Now make another trigger that works when Tim's callback runs:
1) Loop from 0 to Total.
2) Set a temporary unit variable to Units[Integer A] and a temporary real variable to Facing[Integer A].
3) Do whatever you want with the "current" unit.
4) If the unit should be deleted (it hit the target, it's time is ended, etc.), you do:
4a) Set Units[Integer A] = Units[Total]
4b) Set Facing[Integer A] = Facing[Total]
4c) Set Total = Total - 1
4d) If Total is equal to 0, pause Tim to save resources.


Hurray, seems like I DID write this again after all.
 
lol i figuared out the answer use

CODE:
local integer udg_GLOBAL_VARIBLE_NAME

i said global varible name becuase in varibles local is searched befor global meaning the global verible turns into a local varible (only for the triggering trigger )

this took me 1 whole day of searching the hive D:but this will make my KNOCKBACK spell stay ina straight line ^^
and becuase of my bullet having locust ( not added in trigger ) they cant change angle even if they moved it becuase the face angle of the caster is refured to evey cast so it doesnt change xD

meaning i think ive solved my probleme ^^
 
but your way isnt mui :p

listen too ghost

or wait till 1.24 (hashtables <3)

how isnt it MUI its multi-instable if i have local veribles meaning multiple of the same spell can be casted so it is classifed (in my turms MUI )

EDIT*
oh wait i have 3 local varibles in my trigger i juz found out it can only support 1 but i will keep this open so peaple can pist CUSTOM SCRIPT commands for people who need to or juz wanna to use em >:)
 
Status
Not open for further replies.
Top