You shouldn't need to use any "If Then Else" statements. I believe it should be possible to just set a variable to the item in question. That way, you'd just need a dialog, create a periodic trigger that gets the items from the inventory and display them on the dialog. Now, exactly how you'd do that... I don't know. :x
...
Yup, a variable with the type "- Game Link, Item". Now you just need to be able to call on the items in someone's inventory.
Tsk, you'd really be better of learning to do it yourself! Give a man a fish, feed him for the day. Teach a man to fish, feed him for a life time. But in this case, I really wanted to learn to do triggers activated by buttons, so it's okay. :3
Absolutely. The triggers will work for any unit - you just have to go to the "Ability - Abilities +" section for the Barrack in the data editor and remove the "Spawn Units" ability. Then go to "Ability - Command Card +" and remove the button. Then you do the same, but the other way around, for adding the ability to your other building. I could re-upload the map with these changes, but it's really easy to do. :3
About an extra delay after a certain wave, you should just use an "If Then Else" before you start your timer that checks the wave number.
ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfWaveNumber!=10WaveNumber!=20Then------- Set timer to what you want the timer to be for waves 1-9, 11-19.ElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfWaveNumber==10Then------- Set timer to what you want the timer to be for wave 10.ElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfWaveNumber==20Then------- Set timer to what you want the timer to be for wave 20.Else
Just add more if you got more waves that need different timers.
It's a bit hard to find a proper solution when it's for just a part of a trigger, as I don't know how your full trigger works. But I hope this will help.
I create an example map, with working triggers to select either Marine, Marauder or Reaper from a Barrack, have them stack over time (just 1 second for testing purposes) and for all to be released when you hit the "Spawn Units" button. Take a look at it, I'm hoping it should clear some things up. Note that all triggers work for any player - so there's just one set of triggers needed.
Doesn't sound too hard to be honest. Now, I can't actually link a button to a trigger - but I know it's doable. I think you create a dummy ability for the button, and then have a trigger check for when that ability is used.
The actual trigger part (except the button thing) could simply be a periodic event that runs every 5 second. The trigger would simply check a variable for what unit you're spawning (this is what you would have to set with the button trigger), and add + 1 to another variable. Meaning, you don't spawn any units until you press that release button, you simply stack variables.
So say you have your SpawningUnit variable, a UnitCurrentlySpawning variable, a StackingSpawn variable and an array for UnitsToSpawn[x]. You have a trigger that checks SpawningUnit and sets UnitCurrentlySpawning to that value. As long as SpawningUnit and UnitCurrentlySpawning was the same value, that would mean the player hasn't switched unit and you could add + 1 to StackingSpawn, and then add the value of StackingSpawn to UnitsToSpawn[for the unit type you're spawning]. If they did change value, the player switched unit, and you'd set StackingSpawn back to 1. Get it? :x
I'll look around for the button to trigger function so I can post an example of the full trigger.
Like this, you'll create units like normal if "Current Wave" isn't 10. If it is, it'll instead spawn Infested Terrans for 30 seconds. This should work with the break and everything.
SpawnEventsTimer-WaveTimerexpiresLocalVariablesSpawnTimer=0<Integer>ConditionsActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfCurrentWave!=10Then------- Play sound, create units and order them to attack etc.ElseGeneral-Repeat(Actions)foreverActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfSpawnTimer==30Then------- Start the Rebuild Timer, that - when it expires - will start the Wave Timer again, thus continuing the loop.General-BreakElseVariable-ModifySpawnTimer:+1------- Play sound, create Infested Terrans and order them to attack etc.General-Wait1.0RealTimeseconds
About the start of the game, just set your wave spawning trigger to be initially off (from the right-click menu) and create another trigger with the event "Time Elapsed" that turns your first trigger on. That'll delay the start of the waves (I think... I've never used it myself). You could also, of course, create another timer that turns your trigger on once it expires.
I'd create a timer for the rebuild phase either way. If you're using the trigger I posted above, just add "Turn Trigger On/Off" in the "Else" - before "General - Break" and create a timer that will fire the trigger controlling the next wave. Just make sure they're bound to different timer variables to not confuse the triggers.
Edit: Oh yeah, I think that you can use timers without creating timer windows. That way the timer will count down, but you won't see it. If that's what you're after.
I have to admit I can't make out exactly what you're after. Once the timer hits 0 you send a wave and restart the timer - right? After the first 9 waves, you want wave 10 to just keep spawning units every second, until the timer hits 0 again - or just for a set time?
Just add this to your wave spawning trigger, to be run when you're on wave 10. It's set to stop after the Timer variable hits 30 (after 30 seconds) - not when a timer expires.
Make a trigger with an event that checks for destroyed buildings. Then run an "If Then Else" statement to check for the amount of remaining HQs. If there's just one left, end the game in victory for whoever has a HQ left - and defeat for those that don't. I'll edit with a trigger example in a minute.
Edit: My bad, you can't have an event checking for just unit type - it would have to check for a specific, placed unit. So make it "Timer - Every 1.0 seconds of Real Time" instead.
When selecting the amount of minerals to add, instead of just setting it to the building count, you use the function "Arithmetic (Integer)" - it's under the "Math" category. It'll display as "(Value 1 + 1)". Change the operator (the + sign) to *, and set the first value as the building count, and the second to whatever you want - in my example 100, for 100 minerals per building.
... What? I just want them to spawn. Or well, that's what zISilenced wants anyway. He seemed to be having issues with his trigger not repeating, and mine works perfectly - so I reposted it as I thought he has missed the first. It also spawns only when the unit is in the region. From when it enters, until it leaves.
Either that, or I'm too tired to make heads or tails of this.
Can't test anything right now as I'm heading off to bed, but I guess you could just create your own queue through an array?
Every time you're supposed to run a sound file, set SoundFileArray = that sound file, in the slot of a queue variable - QueueVariable. That is; SoundFileArray[QueueVariable]. Then modify QueueVariable + 1. Once it hits, say, 5 - set it to 0 again. So as a new sound file is "queued", it's just assigned the next slot in the array. Then have a periodic trigger that has it's own queue variable - PlayQueueVariable - and the trigger would just play SoundFileArray[PlayQueueVariable], modify PlayQueueVariable + 1 and if a sound file was played, turn off the trigger, wait 3 seconds, turn it back on. This queue variable would also be set to 0 once it hits, say, 5.
That way you'd loop through the array and play one sound at a time. The waiting time would stop the sounds from overlapping. I hope I made sense, I'm a bit tired.
0
@HatsuneMikuMegurine: Go
You shouldn't need to use any "If Then Else" statements. I believe it should be possible to just set a variable to the item in question. That way, you'd just need a dialog, create a periodic trigger that gets the items from the inventory and display them on the dialog. Now, exactly how you'd do that... I don't know. :x
...
Yup, a variable with the type "- Game Link, Item". Now you just need to be able to call on the items in someone's inventory.
0
@Selfcreation: Go
Tsk, you'd really be better of learning to do it yourself! Give a man a fish, feed him for the day. Teach a man to fish, feed him for a life time. But in this case, I really wanted to learn to do triggers activated by buttons, so it's okay. :3
0
@davyswin: Go
Em, maybe I wasn't clear. It sounds like you're changing one of the first parts in;
What you need to change is the last part. Like this:
That's the trigger editor bottom window fold-out-function-thingy. :x It shows how the function's structured. Does that help?
That, or check his tutorial.
0
@Selfcreation: Go
You're welcome. But what that a "please re-upload the map" or a "I'll fix it myself"? :p Just so I know before I head to bed.
0
@Selfcreation: Go
Absolutely. The triggers will work for any unit - you just have to go to the "Ability - Abilities +" section for the Barrack in the data editor and remove the "Spawn Units" ability. Then go to "Ability - Command Card +" and remove the button. Then you do the same, but the other way around, for adding the ability to your other building. I could re-upload the map with these changes, but it's really easy to do. :3
0
@Infinity2: Go
Great to hear you got it fixed.
About an extra delay after a certain wave, you should just use an "If Then Else" before you start your timer that checks the wave number.
Just add more if you got more waves that need different timers.
It's a bit hard to find a proper solution when it's for just a part of a trigger, as I don't know how your full trigger works. But I hope this will help.
0
@Selfcreation: Go
I create an example map, with working triggers to select either Marine, Marauder or Reaper from a Barrack, have them stack over time (just 1 second for testing purposes) and for all to be released when you hit the "Spawn Units" button. Take a look at it, I'm hoping it should clear some things up. Note that all triggers work for any player - so there's just one set of triggers needed.
0
@Selfcreation: Go
Doesn't sound too hard to be honest. Now, I can't actually link a button to a trigger - but I know it's doable. I think you create a dummy ability for the button, and then have a trigger check for when that ability is used.
The actual trigger part (except the button thing) could simply be a periodic event that runs every 5 second. The trigger would simply check a variable for what unit you're spawning (this is what you would have to set with the button trigger), and add + 1 to another variable. Meaning, you don't spawn any units until you press that release button, you simply stack variables.
So say you have your SpawningUnit variable, a UnitCurrentlySpawning variable, a StackingSpawn variable and an array for UnitsToSpawn[x]. You have a trigger that checks SpawningUnit and sets UnitCurrentlySpawning to that value. As long as SpawningUnit and UnitCurrentlySpawning was the same value, that would mean the player hasn't switched unit and you could add + 1 to StackingSpawn, and then add the value of StackingSpawn to UnitsToSpawn[for the unit type you're spawning]. If they did change value, the player switched unit, and you'd set StackingSpawn back to 1. Get it? :x
I'll look around for the button to trigger function so I can post an example of the full trigger.
0
@Infinity2: Go
Like this, you'll create units like normal if "Current Wave" isn't 10. If it is, it'll instead spawn Infested Terrans for 30 seconds. This should work with the break and everything.
Edit: Attached the example file.
0
@Infinity2: Go
You're welcome.
About the start of the game, just set your wave spawning trigger to be initially off (from the right-click menu) and create another trigger with the event "Time Elapsed" that turns your first trigger on. That'll delay the start of the waves (I think... I've never used it myself). You could also, of course, create another timer that turns your trigger on once it expires.
I'd create a timer for the rebuild phase either way. If you're using the trigger I posted above, just add "Turn Trigger On/Off" in the "Else" - before "General - Break" and create a timer that will fire the trigger controlling the next wave. Just make sure they're bound to different timer variables to not confuse the triggers.
Edit: Oh yeah, I think that you can use timers without creating timer windows. That way the timer will count down, but you won't see it. If that's what you're after.
0
@Infinity2: Go
I have to admit I can't make out exactly what you're after. Once the timer hits 0 you send a wave and restart the timer - right? After the first 9 waves, you want wave 10 to just keep spawning units every second, until the timer hits 0 again - or just for a set time?
Just add this to your wave spawning trigger, to be run when you're on wave 10. It's set to stop after the Timer variable hits 30 (after 30 seconds) - not when a timer expires.
0
@Mr12toe: Go
Make a trigger with an event that checks for destroyed buildings. Then run an "If Then Else" statement to check for the amount of remaining HQs. If there's just one left, end the game in victory for whoever has a HQ left - and defeat for those that don't. I'll edit with a trigger example in a minute.
Edit:
Edit: My bad, you can't have an event checking for just unit type - it would have to check for a specific, placed unit. So make it "Timer - Every 1.0 seconds of Real Time" instead.
0
@davyswin: Go
When selecting the amount of minerals to add, instead of just setting it to the building count, you use the function "Arithmetic (Integer)" - it's under the "Math" category. It'll display as "(Value 1 + 1)". Change the operator (the + sign) to *, and set the first value as the building count, and the second to whatever you want - in my example 100, for 100 minerals per building.
0
@SouLCarveRR: Go
... What? I just want them to spawn. Or well, that's what zISilenced wants anyway. He seemed to be having issues with his trigger not repeating, and mine works perfectly - so I reposted it as I thought he has missed the first. It also spawns only when the unit is in the region. From when it enters, until it leaves.
Either that, or I'm too tired to make heads or tails of this.
0
Can't test anything right now as I'm heading off to bed, but I guess you could just create your own queue through an array?
Every time you're supposed to run a sound file, set SoundFileArray = that sound file, in the slot of a queue variable - QueueVariable. That is; SoundFileArray[QueueVariable]. Then modify QueueVariable + 1. Once it hits, say, 5 - set it to 0 again. So as a new sound file is "queued", it's just assigned the next slot in the array. Then have a periodic trigger that has it's own queue variable - PlayQueueVariable - and the trigger would just play SoundFileArray[PlayQueueVariable], modify PlayQueueVariable + 1 and if a sound file was played, turn off the trigger, wait 3 seconds, turn it back on. This queue variable would also be set to 0 once it hits, say, 5.
That way you'd loop through the array and play one sound at a time. The waiting time would stop the sounds from overlapping. I hope I made sense, I'm a bit tired.