Andrewgosu
The Silent Pandaren Helper
- Reaction score
- 716
The point of this guide is to show variables and custom scripts in example triggers and teach those, who don't know how to set up variables and how to use custom scripts.
I am going to show you how to use most used custom scripts and variables in real triggers.
I recommend:
Variables in Detail - Daelin
Variables and Arrays - Laika.
Basic Variables - MrApples
Memory leaks and custom scripts - Emjlr3
Lets get started.
Unit&String Variables in a trigger.
This trigger stores the casting unit, target unit of ability being cast and a string. Then it shows the target unit of ability being cast the string.
Unit&Real Variables in a trigger.
This trigger stores the casting unit, target unit of ability being cast and the life of the casting unit. Then it sets the life of target unit of ability being cast to half of the stored real value. (Life of the casting value). Reals can have decimals.
Unit&Point variables plus Custom Scripts in a trigger.
Firstly, this trigger declares locals, then it stores the casting unit and the target point of ability being cast. Then it creates one captain at the position of the target point of ability being cast and fianlly removes the location leak. The local unit variable has to be nulled in the end.
Unit&Integer Variables in a trigger.
This trigger stores the casting unit and gives him the level of the casting unit times 10 bonus Xp in addition to his current xp. Integers cannot have decimels.
Unit Group&Point variables plus Custom Scripts in a trigger.
This trigger stores the target point of ability being cast and picks all units in the set unit group. Unit groups leak, so we have to take care of the leaks with a custom script and as well use a custom script to fix the location leak.
Alternatevely the same trigger:
This trigger adds a hero to a unit group after it died.
Then another trigger revives all the units in the unit group and removes all the unit from it every 30 seconds.
There is alot of functions in the unit group category, go and check them out.
Player Group variables in a trigger.
This trigger adds player Red and Blue to Player group 1 and Teal, Purpel to player group 2.
Then, every 15 seconds, player group 1 recieves 50 gold and player group 2 50 wood.
Discover the other player group functions aswell.
Item&Point variables plus Custom Scripts in a trigger.
If a unit dies, it decalares locals, and stores the position of the the dying unit. Then, it creates an item at the position of the died unit, removes the leak with a custom script and stores the last created item. After 120 seconds, it makes the item undroppable.
Special Effect&Point variables plus Custom Scripts in a trigger.
Firstly, it stores the target point of ability being cast, then it creates 10 a special effects in a circle using an integer loop. (TFT) After few seconds, it uses the integer loop again to destroy the special effects, removing the special effect memory leaks and fianlly it fixes the location leak.
Dialog&Dialog Buttons Variables in a trigger.
Firstly, it creates a dialog with 2 buttons and sets the buttons into the variables and then shows the dialog.
If the player has made the choice, the trigger makes sure which button was pressed and does the right action(s).
I hope these example triggers gave you some experience and knowhow how to set up and use variables and custom scripts in triggers. Updates coming soon. Feedback appriciated.
I am going to show you how to use most used custom scripts and variables in real triggers.
I recommend:
Variables in Detail - Daelin
Variables and Arrays - Laika.
Basic Variables - MrApples
Memory leaks and custom scripts - Emjlr3
Lets get started.
Unit&String Variables in a trigger.
This trigger stores the casting unit, target unit of ability being cast and a string. Then it shows the target unit of ability being cast the string.
Unit&Real Variables in a trigger.
This trigger stores the casting unit, target unit of ability being cast and the life of the casting unit. Then it sets the life of target unit of ability being cast to half of the stored real value. (Life of the casting value). Reals can have decimals.
Unit&Point variables plus Custom Scripts in a trigger.
Firstly, this trigger declares locals, then it stores the casting unit and the target point of ability being cast. Then it creates one captain at the position of the target point of ability being cast and fianlly removes the location leak. The local unit variable has to be nulled in the end.
Unit&Integer Variables in a trigger.
This trigger stores the casting unit and gives him the level of the casting unit times 10 bonus Xp in addition to his current xp. Integers cannot have decimels.
Unit Group&Point variables plus Custom Scripts in a trigger.
This trigger stores the target point of ability being cast and picks all units in the set unit group. Unit groups leak, so we have to take care of the leaks with a custom script and as well use a custom script to fix the location leak.
Alternatevely the same trigger:
This trigger adds a hero to a unit group after it died.
Then another trigger revives all the units in the unit group and removes all the unit from it every 30 seconds.
There is alot of functions in the unit group category, go and check them out.
Player Group variables in a trigger.
This trigger adds player Red and Blue to Player group 1 and Teal, Purpel to player group 2.
Then, every 15 seconds, player group 1 recieves 50 gold and player group 2 50 wood.
Discover the other player group functions aswell.
Item&Point variables plus Custom Scripts in a trigger.
If a unit dies, it decalares locals, and stores the position of the the dying unit. Then, it creates an item at the position of the died unit, removes the leak with a custom script and stores the last created item. After 120 seconds, it makes the item undroppable.
Special Effect&Point variables plus Custom Scripts in a trigger.
Firstly, it stores the target point of ability being cast, then it creates 10 a special effects in a circle using an integer loop. (TFT) After few seconds, it uses the integer loop again to destroy the special effects, removing the special effect memory leaks and fianlly it fixes the location leak.
Dialog&Dialog Buttons Variables in a trigger.
Firstly, it creates a dialog with 2 buttons and sets the buttons into the variables and then shows the dialog.
If the player has made the choice, the trigger makes sure which button was pressed and does the right action(s).
I hope these example triggers gave you some experience and knowhow how to set up and use variables and custom scripts in triggers. Updates coming soon. Feedback appriciated.