Alright well Ive been messing around with the editor and trying to learn the new engine to make old SC maps into new maps, best I can.
One problem Ive faced is how to figure out how much of a resource a player has and if enough like say 10 (or more) then give that player a unit as a reward to buy other units (like in SC Original/BW). Tried searching the forums to no avail over the last few weeks to see if anyone else did something like this but couldn't find anything with a lot of key word searches.
What Im trying to do to put it simply is:
If: Player # Has minerals >= 10 Then: Give/spawn/create UnitReward at Region #; subtract 10 minerals Else: Do nothing
and continuously loop it.
I dont know if I have to make variables and if so what to make. Got basically all the basic terrain, terrain painting, unit modifications, custom units, etc down, but just not the scripting language.
Any help would be appreciated, thanks. (If this is in the wrong forum, please move it to the correct forum. Just saw "Galaxy Scripting and Trigger Libraries" as forum name and figured this would be the best place to post it.)
You can do this very easily using triggers. Just run a periodic trigger every 0.2 or so seconds, pick each player in all players and check if the picked players player property minerals is greater than 10, and if so run the needed actions.
If someone tells me how to copy paste triggers from the editor into this forum i can show you the exact trigger...
You could keep it in a single trigger by just making 15 (or however many players) events that are copied from that one event. Then you change the player number.
Damn, you are right :p
And I used to do that for one of my first projects, and I then forgot about it, and now it would actually clear some coding in one of my new map (Where I have a bunch of Timer expires Triggers).
I knew something was not so right about writing all those triggers, but hey, I must be sleep deprived ;D
Worked perfectly ErrorAsh, thanks for the help. Now only if I could get the motivation to actually keep playing for more than 2 waves I might get somewhere with this map xD.
For Ion Cannon Wars (Map WIP) I created a new If (Condiions) Then (Actions Else Do Nothing action defintion because I don't use else all to often. It works perfectly and 100% open to use. If you want to see it/grab it just download my early alpha map here on sc2mapster and feel free to use it or learn how I made it. I personaly like having it cause it saves me time for if-then-else's that I know will never have an else to them. And I wont have to keep putting 'do nothing' comments like I was lol. Just thought i'd share that for you :)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Alright well Ive been messing around with the editor and trying to learn the new engine to make old SC maps into new maps, best I can.
One problem Ive faced is how to figure out how much of a resource a player has and if enough like say 10 (or more) then give that player a unit as a reward to buy other units (like in SC Original/BW). Tried searching the forums to no avail over the last few weeks to see if anyone else did something like this but couldn't find anything with a lot of key word searches.
What Im trying to do to put it simply is:
If: Player # Has minerals >= 10
Then: Give/spawn/create UnitReward at Region #; subtract 10 minerals
Else: Do nothing
and continuously loop it.
I dont know if I have to make variables and if so what to make. Got basically all the basic terrain, terrain painting, unit modifications, custom units, etc down, but just not the scripting language.
Any help would be appreciated, thanks. (If this is in the wrong forum, please move it to the correct forum. Just saw "Galaxy Scripting and Trigger Libraries" as forum name and figured this would be the best place to post it.)
@RogueSniper: Go
You should watch some video tutorials about basic triggers. I recommend http://www.youtube.com/user/GalaxyEditorTutorial#g/u and http://www.youtube.com/user/OneTwoSC#g/p
You can do this very easily using triggers. Just run a periodic trigger every 0.2 or so seconds, pick each player in all players and check if the picked players player property minerals is greater than 10, and if so run the needed actions.
If someone tells me how to copy paste triggers from the editor into this forum i can show you the exact trigger...
Edit: Got it!
@RogueSniper: Go
It might be better to use triggers based on the 'Player Property changes' Event.
Example for Player 1:
And then you would have to create some more triggers for additional players, but I guess it will be less laggy on bnet than a 0.2sec timer :p
Oh and don't forget to add a spawning point in the editor (Layer -> Point).
And as ErrorAsh said, the OneTwoSC tutorials are great !
@Moooyaah: Go
You could keep it in a single trigger by just making 15 (or however many players) events that are copied from that one event. Then you change the player number.
@SquarelyCircle: Go
Damn, you are right :p And I used to do that for one of my first projects, and I then forgot about it, and now it would actually clear some coding in one of my new map (Where I have a bunch of Timer expires Triggers). I knew something was not so right about writing all those triggers, but hey, I must be sleep deprived ;D
Thanks for pointing that out !
Worked perfectly ErrorAsh, thanks for the help. Now only if I could get the motivation to actually keep playing for more than 2 waves I might get somewhere with this map xD.
For Ion Cannon Wars (Map WIP) I created a new If (Condiions) Then (Actions Else Do Nothing action defintion because I don't use else all to often. It works perfectly and 100% open to use. If you want to see it/grab it just download my early alpha map here on sc2mapster and feel free to use it or learn how I made it. I personaly like having it cause it saves me time for if-then-else's that I know will never have an else to them. And I wont have to keep putting 'do nothing' comments like I was lol. Just thought i'd share that for you :)