I would like to know the difference between the 'Set Variable' action and 'Modify Variable (Integer)' action.
For example, what is the difference between 'Set Kills = (Kills + 1)' and 'Modify Kills: +1'? Because when I use the 'Modify Variable (Integer)' action on my map, random error messages pops out and the triggers just screw up, while using 'Set Variable' works well.
I'm not too keen on this, but I have had a bit of experience on variables before.
All I know is that Set Variable is meant for refering to a non-existant (created) unit, objective, ping, actor etc
Modify Variable is something you would use if you need to modify a set of numbers over time. For example if you have a leaderboard that shows kills done by the player, you would need an action that makes sure that everytime a unit is killed, the killing player will Modify Variable +1.
I for example, also used it for some of my maps for making updating objectives. If I make an objective that says (1/2) I need to make sure to Modify Vatiable +1 when the contidions are met.
These are just 2 uses of it. There's probably hundreds and thousands of different actions you can do.
As to the errors you're getting with the modify Variables - I can't explain that unfortunately.
StarCraft II: Annihilation Campaign - A 24 mission single-player campaign featuring unique heroes, custom tracks, boss battles, a varied set of mission scenarios and three intersecting storylines.
The difference between "Set Kills = (Kills + 1)" and "Modify Kills: +1" is the difference between i = (i + 1) and i += 1 (which probably translates to i = i + 1) in script.
The only difference for you is that modify variable is easier to use. The trigger errors are not caused by switching to modify variable if done correctly.
Hi all,
I would like to know the difference between the 'Set Variable' action and 'Modify Variable (Integer)' action.
For example, what is the difference between 'Set Kills = (Kills + 1)' and 'Modify Kills: +1'? Because when I use the 'Modify Variable (Integer)' action on my map, random error messages pops out and the triggers just screw up, while using 'Set Variable' works well.
Thanks
@Chris97Ong: Go
I'm not too keen on this, but I have had a bit of experience on variables before. All I know is that Set Variable is meant for refering to a non-existant (created) unit, objective, ping, actor etc
Modify Variable is something you would use if you need to modify a set of numbers over time. For example if you have a leaderboard that shows kills done by the player, you would need an action that makes sure that everytime a unit is killed, the killing player will Modify Variable +1. I for example, also used it for some of my maps for making updating objectives. If I make an objective that says (1/2) I need to make sure to Modify Vatiable +1 when the contidions are met.
These are just 2 uses of it. There's probably hundreds and thousands of different actions you can do.
As to the errors you're getting with the modify Variables - I can't explain that unfortunately.
StarCraft II: Annihilation Campaign - A 24 mission single-player campaign featuring unique heroes, custom tracks, boss battles, a varied set of mission scenarios and three intersecting storylines.
Starcraft II: A War Story Campaign - A multi-act campaign with custom factions. Follow my discord for updates: https://discord.gg/Ztu44gZ
If you want to see a list of other awesome campaigns, go to: Custom Campaign Initiative
The difference between "Set Kills = (Kills + 1)" and "Modify Kills: +1" is the difference between i = (i + 1) and i += 1 (which probably translates to i = i + 1) in script.
The only difference for you is that modify variable is easier to use. The trigger errors are not caused by switching to modify variable if done correctly.
There's more than one way to do a lot of stuff. Personally, I've never had any problems with modify variable.