Hi all, I am new member, and i need insight on how to create a click spawn system. As of, you click on unit somewhere on map, then that unit is spawned somewhere else on map. Either of time period, or instantly, there is this game called "Black and White HOTS", like Desert Strike; that has got me interested on using this unique spawn system, to create a map somewhat like it. Although my map will have units created from scratch, and as well i know a good amount of the data editor (i.e, creating a unit from scratch). Hope i can receive some help! Thank you.
Thanks it worked very well! Also, would you know how to connect an income system to this type of trigger? (unless anyone knows, feel free to answer) As of, like starting with 200 or 300 mins, and spending 50 for a zergling, awhile having an income flow of 50, (and gaining persay, that 50 every minute (how to do as well?) and receiving 5 min from creating that zergling. Then having 55 income flow per say every minute. Much help is greatly appreciated! Hope i wasn't to confusing.
(Also i noticed this map i made can hold a lot of units (with no lag) (Minus the fact of not many triggers or doodads) Atm)
For income, you could make a trigger and use a variable to define a value for the player's income, then you can modify the player's minerals to add that variable. Then you'd have to make another trigger with the event of unit is created, and use if statements to find which unit it was. Then you can modify your variable from before to add 5 to that, and you can also give the player 5 minerals there if you want too.
(sorry for late response, was busy for awhile.)(although i got it!)
Wow! Amazing, it worked! Flawlessly!
Now then, i need to know how to create a timer. The timer would be used for the income. A player starts with 50 income during the start of game. (and 300 minerals) Then after every per se, 30 (real or game? which is better for wave based TOW) seconds. (edit) The Player receives the equaling amount of income they have. (which in this map, the income is labeled as gas).
(Edit) I'll rephrase for clarity.) I know that the timer is in the trigger system, but, i don't know how to use the correct trigger's to have it operate without errors and as well of the simplest way.)(also, i'm wanting it how i said above)
(Unsolved)!
Also, i copied the spawn system, although.. How can i make it where the AI controls the spawned units and also allied to a team of players.(Kinda like desert strike? 2 teams.) (Edit) And as well, those units being controlled to a point by the AI.
Sorry, u should make a new thread for a new issue but heres ur answer:
Real shouldn't be used, not many reasons to use it, stick to game time to keep one time scale and make ur life easy.
Trigger A:
on map initialization, create a timer window, and timer and start that timer for 30 seconds. make sure to set the last created timer to a global timer variable (i prefer one shot timers.)
Trigger B:
On timer expiration, modify player resources like before and start the timer for 30 seconds(restarting 30 seconds is not needed on repeating timer)
Timer B causes a self loop for restarting the timer
Awesome! IT worked, i'm learning triggers, fast. (Not that i haven't attempted before) (Although, this is in depth!)
Oh, well i hadn't wanted to create a new thread, because i thought this one would get good posts, and i thought that creating another thread would be flooding. (of things i'd need help with)
K, another thing is that when i gain income, its always set to 50 (yes, that is my variable for income, at start). I tried modding a few times, to get it where the income would be gained from the exact amount of the gas (or income). I think i may need to create another variable or something to set it where the player would gain the amount of gas that there is.
This is more advance since its most effectively done with arrays and loops,
use, player property change to fire the trigger when the player gains loses or sets minerals.Since the event doesnt tell us the change you will need to Set a Placeholder Global array to record the current player's resources on each change. before you set the new value, it will have the last value currently stored, so you want to see if the current player's resources is more than before {and if so record the difference} if less {do nothing}, then set the placeholder to the current resources for the next fireing
WARNING:
when u increase the player's resources in the previous code, it will fire off this trigger, so each time the player's resources will increase exponentially each iteration. 3 things must happen to prevent this in Timer B (mentioned above): first, you must reset the global variable "ResourceIncrease" to 0. Second, you must set GlobalPlaceholderResourcesVar[ALL PLAYERS] to the new value after the change in resources happen and this must be set to the starting resources when the game starts. Third and final is that "Gained Resources" must be disabled during this process using "Turn Gained Resources off" action.
Set a Placeholder Global array to record the current player's resources on each change.
^
Ok, I can grasp what the rest is, and i have attempted to figure this out. The example is excellent and is helping, although, the quoted part is what i'm not grasping. I know there are arrays in variables.
Must i use a variable and its array for what you're saying, or, must i use a record? (or well, a variable prob, at most) If a variable, what must i choose (integer? as i.e.) to get to what you're saying.
@GeneralAring: Go
GlobalPlaceholderResourcesVar[Triggering Player] is what im talking about
Arrays:
and array is a variable that can hold more than 1 variable. An integer array can hold more than 1 integer. you can technically always not use an array but the amount of coding will be significantly greater because your being forced to make all the integers individually and sort them individually.
PlaceHolders:
Its a fancy complicated way of saying its specific to the trigger and records were the trigger left off on last iteration.
The event does not record if there is a increase decrease or set in the change of players resources, therefor we must determine this ourselves. What the event does do is fires off when there is a change. so you set what the players current resources are in the variable then run the trigger. player has a change in resources, now u can compare the old recorded resources to the new recorded resources, if its greater than the old, he had an increase in money, if its less a decrease. at the end of comparing and analyzing this you need to now set the new resource value
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi all, I am new member, and i need insight on how to create a click spawn system. As of, you click on unit somewhere on map, then that unit is spawned somewhere else on map. Either of time period, or instantly, there is this game called "Black and White HOTS", like Desert Strike; that has got me interested on using this unique spawn system, to create a map somewhat like it. Although my map will have units created from scratch, and as well i know a good amount of the data editor (i.e, creating a unit from scratch). Hope i can receive some help! Thank you.
Welcome and don't let trolls scare u off, not too many of them lately anyways.
u do it very easily via triggers
Event - Unit Selected Action - Spawn (unit type(triggering unit) at location blah for player (triggering player)
somthing like that
(solved)
Thanks it worked very well! Also, would you know how to connect an income system to this type of trigger? (unless anyone knows, feel free to answer) As of, like starting with 200 or 300 mins, and spending 50 for a zergling, awhile having an income flow of 50, (and gaining persay, that 50 every minute (how to do as well?) and receiving 5 min from creating that zergling. Then having 55 income flow per say every minute. Much help is greatly appreciated! Hope i wasn't to confusing.
(Also i noticed this map i made can hold a lot of units (with no lag) (Minus the fact of not many triggers or doodads) Atm)
@GeneralAring: Go
For income, you could make a trigger and use a variable to define a value for the player's income, then you can modify the player's minerals to add that variable. Then you'd have to make another trigger with the event of unit is created, and use if statements to find which unit it was. Then you can modify your variable from before to add 5 to that, and you can also give the player 5 minerals there if you want too.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
fishy is right
heres an example:
Action: - modify player property minerals : - 1000
just add it on
(solved)
(sorry for late response, was busy for awhile.)(although i got it!)
Wow! Amazing, it worked! Flawlessly!
Now then, i need to know how to create a timer. The timer would be used for the income. A player starts with 50 income during the start of game. (and 300 minerals) Then after every per se, 30 (real or game? which is better for wave based TOW) seconds. (edit) The Player receives the equaling amount of income they have. (which in this map, the income is labeled as gas).
(Edit) I'll rephrase for clarity.) I know that the timer is in the trigger system, but, i don't know how to use the correct trigger's to have it operate without errors and as well of the simplest way.)(also, i'm wanting it how i said above)
(Unsolved)!
Also, i copied the spawn system, although.. How can i make it where the AI controls the spawned units and also allied to a team of players.(Kinda like desert strike? 2 teams.) (Edit) And as well, those units being controlled to a point by the AI.
Help is greatly appreciated!
(thanking you guys for help!)
Is anyone able to help? Your assistance is greatly appreciated! And you'll help me create an amazing map!
Sorry, u should make a new thread for a new issue but heres ur answer:
Real shouldn't be used, not many reasons to use it, stick to game time to keep one time scale and make ur life easy.
Trigger A:
on map initialization, create a timer window, and timer and start that timer for 30 seconds. make sure to set the last created timer to a global timer variable (i prefer one shot timers.)
Trigger B:
On timer expiration, modify player resources like before and start the timer for 30 seconds(restarting 30 seconds is not needed on repeating timer)
Timer B causes a self loop for restarting the timer
And like always, heres the example:
Awesome! IT worked, i'm learning triggers, fast. (Not that i haven't attempted before) (Although, this is in depth!)
Oh, well i hadn't wanted to create a new thread, because i thought this one would get good posts, and i thought that creating another thread would be flooding. (of things i'd need help with)
K, another thing is that when i gain income, its always set to 50 (yes, that is my variable for income, at start). I tried modding a few times, to get it where the income would be gained from the exact amount of the gas (or income). I think i may need to create another variable or something to set it where the player would gain the amount of gas that there is.
(not sure how to do it, help is appreciated!)
This is more advance since its most effectively done with arrays and loops,
use, player property change to fire the trigger when the player gains loses or sets minerals.Since the event doesnt tell us the change you will need to Set a Placeholder Global array to record the current player's resources on each change. before you set the new value, it will have the last value currently stored, so you want to see if the current player's resources is more than before {and if so record the difference} if less {do nothing}, then set the placeholder to the current resources for the next fireing
WARNING:
when u increase the player's resources in the previous code, it will fire off this trigger, so each time the player's resources will increase exponentially each iteration. 3 things must happen to prevent this in Timer B (mentioned above): first, you must reset the global variable "ResourceIncrease" to 0. Second, you must set GlobalPlaceholderResourcesVar[ALL PLAYERS] to the new value after the change in resources happen and this must be set to the starting resources when the game starts. Third and final is that "Gained Resources" must be disabled during this process using "Turn Gained Resources off" action.
Heres the example:
Set a Placeholder Global array to record the current player's resources on each change.
^
Ok, I can grasp what the rest is, and i have attempted to figure this out. The example is excellent and is helping, although, the quoted part is what i'm not grasping. I know there are arrays in variables.
Must i use a variable and its array for what you're saying, or, must i use a record? (or well, a variable prob, at most) If a variable, what must i choose (integer? as i.e.) to get to what you're saying.
@GeneralAring: Go GlobalPlaceholderResourcesVar[Triggering Player] is what im talking about
Arrays:
and array is a variable that can hold more than 1 variable. An integer array can hold more than 1 integer. you can technically always not use an array but the amount of coding will be significantly greater because your being forced to make all the integers individually and sort them individually.
PlaceHolders:
Its a fancy complicated way of saying its specific to the trigger and records were the trigger left off on last iteration.
The event does not record if there is a increase decrease or set in the change of players resources, therefor we must determine this ourselves. What the event does do is fires off when there is a change. so you set what the players current resources are in the variable then run the trigger. player has a change in resources, now u can compare the old recorded resources to the new recorded resources, if its greater than the old, he had an increase in money, if its less a decrease. at the end of comparing and analyzing this you need to now set the new resource value