While toying in triggers and learning slowly how to use them, I encountered 2 main problems.
I am unable to set trigger that will have X% chance to go «on» and Y%% chance to stay «off», or create a trigger that will stay «on» or «off» depending of a certain type of unit and certain number of it on the map. here are some detailed examples of what I am searching to acheive :
First option :
Condition = Player 15 own less than 1 ultralisk on playable area.
Action : Create one ultralisk for player 15 at XYZ Point facing random angle.
Else : General - Wait for (Conditions), checking every 1.0 Real Time seconds
It seem I can't find how to make something like that work
Second option :
The more ultralisk on the map, the less chance (in %) the trigger will spawn periodically more of them for player 15.
The second option in % is, I guess, way more complex to set in place, but way more attractive in term of cameplay. Lets say that «if 0 ultralisk on the map owned by player 15, give 50% chance of periodically spawn one»,«if 1 ultralisk on the map owned by player 15, give 20% chance of periodically spawn one»,«if 2 ultralisk on the map owned by player 15, give 10% chance of periodically spawn one», and ETC
Last problem : it also seem that my condition «(Player 15 Supplies Used) <= 150» is not woking properly. Why is that so?
Here is my actuall trigger:
Ultralisk Spawn Test
Events
Timer - Every (Random real between 25.0 and 35.0) seconds of Real Time
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player 15 Supplies Used) <= 150
Then
Unit - Create 1 Ultralisk for player 15 at Infested Army Spawn Point 1 facing (Random angle) degrees (No Options)
Player - Modify player 15 Handicap: Add 2
Else
General - Wait for (Conditions), checking every 1.0 Real Time seconds
% chance is easy to create
Make a variable (integer)
click the number(0) go on function a search for "random integer or something" make value 1-10 and you can easy use a 10% chance etc. when you make a trigger that will work with only a number in the borders.
Wait for (Conditions)
sounds like stop the Trigger until, but thats no loop or?
my idea
grab the supplycounter and make it a variable
use another variable or modify it to create a changing percent chance
So Spawn by value 1
Random Integer (1 to supply) more supply used = lower chance
grab the supplycounter and make it a variable use another variable or modify it to create a changing percent chance
So Spawn by value 1 Random Integer (1 to supply) more supply used = lower chance
I have no clue on how to acheive this, my first language is french and all that cooding vocabulary in english puzzle me a little... Could you repeat that with more words to detail the procedure? Sorry for that...
I also took a look at variable and math to set a % but couldn't find any way to set it...
I'm kina clueless since I'm so new with the editor. I continue searching on my side, but please light my path if you carry the candle of solutions XD
Variable A is a Integer, click on the standart 0 in the window and go under "functions" search for "integer". In the list is "random integer" click it.
Now yout Integer has a Value 0 - 100 (standart). Click on the "100" and go under "variable". In the list is your Variable B, use it.
Now you have a random Integer with the variables "0 - variable B"
While toying in triggers and learning slowly how to use them, I encountered 2 main problems.
I am unable to set trigger that will have X% chance to go «on» and Y%% chance to stay «off», or create a trigger that will stay «on» or «off» depending of a certain type of unit and certain number of it on the map. here are some detailed examples of what I am searching to acheive :
First option :
Condition = Player 15 own less than 1 ultralisk on playable area.
Action : Create one ultralisk for player 15 at XYZ Point facing random angle. Else : General - Wait for (Conditions), checking every 1.0 Real Time seconds
It seem I can't find how to make something like that work
Second option :
The more ultralisk on the map, the less chance (in %) the trigger will spawn periodically more of them for player 15.
The second option in % is, I guess, way more complex to set in place, but way more attractive in term of cameplay. Lets say that «if 0 ultralisk on the map owned by player 15, give 50% chance of periodically spawn one»,«if 1 ultralisk on the map owned by player 15, give 20% chance of periodically spawn one»,«if 2 ultralisk on the map owned by player 15, give 10% chance of periodically spawn one», and ETC
Last problem : it also seem that my condition «(Player 15 Supplies Used) <= 150» is not woking properly. Why is that so?
Here is my actuall trigger:
Ultralisk Spawn Test
Events
Timer - Every (Random real between 25.0 and 35.0) seconds of Real Time
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Player 15 Supplies Used) <= 150
Then
Unit - Create 1 Ultralisk for player 15 at Infested Army Spawn Point 1 facing (Random angle) degrees (No Options)
Player - Modify player 15 Handicap: Add 2
Else
General - Wait for (Conditions), checking every 1.0 Real Time seconds
Conditions
(Player 15 Supplies Used) <= 150
A little help would be greatly appreaciated since I haven't figured out yet what are the solutions.
% chance is easy to create Make a variable (integer) click the number(0) go on function a search for "random integer or something" make value 1-10 and you can easy use a 10% chance etc. when you make a trigger that will work with only a number in the borders.
Wait for (Conditions) sounds like stop the Trigger until, but thats no loop or?
my idea
grab the supplycounter and make it a variable use another variable or modify it to create a changing percent chance
So Spawn by value 1 Random Integer (1 to supply) more supply used = lower chance
@Caipa: Go
Actially the event itself is the loop, it's a periodic timer that repeat the action every 25 - 35 seconds
I have no clue on how to acheive this, my first language is french and all that cooding vocabulary in english puzzle me a little... Could you repeat that with more words to detail the procedure? Sorry for that...
I also took a look at variable and math to set a % but couldn't find any way to set it...
I'm kina clueless since I'm so new with the editor. I continue searching on my side, but please light my path if you carry the candle of solutions XD
haha and im german ;P
First: Create two variables (A and B)
Variable A is a Integer, click on the standart 0 in the window and go under "functions" search for "integer". In the list is "random integer" click it.
Now yout Integer has a Value 0 - 100 (standart). Click on the "100" and go under "variable". In the list is your Variable B, use it.
Now you have a random Integer with the variables "0 - variable B"
Now make a Trigger
action: Variable B = Supply player x
@Caipa: Go
So now the trigger look like that:
Ultralisk Spawn Test
Events
Timer - Every (Random real between 25.0 and 35.0) seconds of Real Time
Local Variables
Ultralish value A = (Random integer between 0 and Ultralisk Value B) <Integer> Ultralisk Value B = Supplies Used <Integer>
Conditions Actions
Variable - Set Ultralisk Value B = (Player 15 Supplies Used)
General - If (Conditions) then do (Actions) else do (Actions)
If (Player 15 Supplies Used) <= 150 Then
Unit - Create 1 Ultralisk for player 15 at Ultralisk Spawn test facing (Random angle) degrees (No Options) Player - Modify player 15 Handicap: Add 2
Else
I can't find the action that would lead to : Give Ultralisk Value A% chance to run action
Your explanation will have been step by step... But I am really glad it help me undeerstanding the ralations between variables