R
Ricky
Guest
Hi~Ricky
This is my first tut so any comments are welcome and feedback would be great.
In this tut im going to say how to make an ability were if you use it a random thing will happen out of as many things as you like.
we are going to do it using triggers.But first we need the ability so open up map editor an create a new map. First make a new unit to use the ability (optional) Then we make a new ability. make its base the naga summoner ability i think it was called summoning ritual and its description was summons energies from the twisted nether or something. anyways change the name and description to your liking.But dont change anything else. Now open the trigger editor and make a new trigger (i called mine first preperation) put the events as a unit startes casting an ability and put conditions as ability being cast equal to <your ability>
Then open the variable editor and creat a new integer (i named mine ability one)it doesnt need to be an array. Put starting value as 0 (it should start like that) Now go back to the trigger editor and to your made trigger. now change the actions. Make a set variable trigger and make the trigger look like the following:
Now we need The thing that makes it all work:More triggers (Note:This is just how i do it i expect there are many more ways)Say you wanted only to things for it to possably be then you make two triggers and put them initialy off then leave them and go back to your first trigger.
Now we make more actions. add the action if/then/else under general and make the conditions (or the if) if integer value is 1. Then under the <Then>
Turn on trigger <one of your possable ability triggers mines called ability outcome one> Then under <else> make another if/then/else action but this tiem make the if conditions as if the value of <your variable> is 2 .And the then actions as turn on trigger <the name of ur other ability outcome mines called ability outcome 2> and repeat the porcess untill you turn on the amount of triggers u want to be the amount of outcomes. Ex: Iwant three outcomes on mine.
Now all we have to do is finish the triggers that let the outcomes happen But first we need to do one last thing place in the unit that uses the ability a lot of problems come from that for instance only that specific unit can use the ability but thats how i make maps and remember this is only one way of doing it. now to finishe the triggers we have go to put in the events i put in time elapsed 0.01 seconds
then you put in the actions what you want to happen if this outcome happens .
for example
Another thing you could do as actions is give the triggering unit an ability wait for _____seconds then take the ability off it again.
If all is done well this is what shoul happen in-game
A player clicks the ability the integer randomises itself then the trigger finds which number the integer has landed on then it carries out what happens.
Well i think i have covers the way i make random abilities. I hope that you found this tut usefull and that you will reply to this tut and give me feedback. ~Ricky A.K.A Tichondrias NOTE: This tut(tutorial) uses only one way of doing this there are i expect a lot more ways. The way i have stated in this tut is just the easyest for me and i though that it would make more sense to some poeple then other ways would.
This is my first tut so any comments are welcome and feedback would be great.
In this tut im going to say how to make an ability were if you use it a random thing will happen out of as many things as you like.
we are going to do it using triggers.But first we need the ability so open up map editor an create a new map. First make a new unit to use the ability (optional) Then we make a new ability. make its base the naga summoner ability i think it was called summoning ritual and its description was summons energies from the twisted nether or something. anyways change the name and description to your liking.But dont change anything else. Now open the trigger editor and make a new trigger (i called mine first preperation) put the events as a unit startes casting an ability and put conditions as ability being cast equal to <your ability>
Code:
[COLOR="Blue"][U]Trigger 001[/U]
Events
A unit starts casting an ability
Conditions
Ability being cast equal to <ur ability[/COLOR]>
Code:
[COLOR="Blue"]Tri[U]gger 001[/U]
Events
A unit starts casting an ability
Conditions
Ability being cast equal to <your ability>
Actions
set variable <your variable name>=random number between <how many randomised things that can happen you want> (example: random number between 1 and 5)[/COLOR]
Now we make more actions. add the action if/then/else under general and make the conditions (or the if) if integer value is 1. Then under the <Then>
Turn on trigger <one of your possable ability triggers mines called ability outcome one> Then under <else> make another if/then/else action but this tiem make the if conditions as if the value of <your variable> is 2 .And the then actions as turn on trigger <the name of ur other ability outcome mines called ability outcome 2> and repeat the porcess untill you turn on the amount of triggers u want to be the amount of outcomes. Ex: Iwant three outcomes on mine.
Code:
[COLOR="Blue"][U]Trigger 001[/U]
events
a unit begins casting an ability
conditions
ability being cast equal to Random outcome ability
actions
Set value of variable 001=random number between 1 and 3
If/then/else
if
Value of variable 001 equal to 1
then
Turn on trigger outcome possability 1
else
if/then/else
if
value of trigger 001 equal to 2
Then
Turn on trigger outcome possability 2
else
if/then/else
if
value of trigger 001 equal to 3
Then
turn on trigger outcome possability 3
else
do nothing[/COLOR]
then you put in the actions what you want to happen if this outcome happens .
for example
Code:
[COLOR="Blue"]trigger outcome possability 1
events
elapsed time 0.01
conditions
actions
set (unit_ability unit001) life percent to 100%.[/COLOR]
If all is done well this is what shoul happen in-game
A player clicks the ability the integer randomises itself then the trigger finds which number the integer has landed on then it carries out what happens.
Well i think i have covers the way i make random abilities. I hope that you found this tut usefull and that you will reply to this tut and give me feedback. ~Ricky A.K.A Tichondrias NOTE: This tut(tutorial) uses only one way of doing this there are i expect a lot more ways. The way i have stated in this tut is just the easyest for me and i though that it would make more sense to some poeple then other ways would.