• 0

    posted a message on How to get inventory items displayed in a dialog?

    @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.

    Posted in: Triggers
  • 0

    posted a message on Spawning Units , stackable. possible?

    @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

    Posted in: Triggers
  • 0

    posted a message on Diplomacy Trigger

    @davyswin: Go

    Em, maybe I wasn't clear. It sounds like you're changing one of the first parts in;

    Player - Modify player 1 Minerals: Add ((Number of Living units in (Any units in (Entire map) owned by player Any Player matching Required: Structure; Excluded: Missile, Dead, Hidden, with at most Any Amount)) * 100)
    

    What you need to change is the last part. Like this:

    Modify Player Property
        Player: 1
        Property: Minerals
        Operation: Add
        Value: Arithmetic (Integer)
            Value 1: Number Of Units In Unit Group
                Type: Living
                Unit Group: Units In Region Matching Condition
                    Unit Type: Any
                    Region: Entire Map
                    Player: Any Player
                    Unit Filter: Excluded: Missile, Dead, Hidden
                    Count: Any Amount
            Operator: *
            Value 2: 100
    

    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.

    Posted in: Triggers
  • 0

    posted a message on Spawning Units , stackable. possible?

    @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.

    Posted in: Triggers
  • 0

    posted a message on Spawning Units , stackable. possible?

    @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

    Posted in: Triggers
  • 0

    posted a message on Waving problems ...

    @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.

        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    Wave Number != 10
                    Wave Number != 20
                Then
                    ------- Set timer to what you want the timer to be for waves 1-9, 11-19.
                Else
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    Wave Number == 10
                Then
                    ------- Set timer to what you want the timer to be for wave 10.
                Else
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    Wave Number == 20
                Then
                    ------- 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.

    Posted in: Triggers
  • 0

    posted a message on Spawning Units , stackable. possible?

    @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.

    Posted in: Triggers
  • 0

    posted a message on Spawning Units , stackable. possible?

    @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.

    Posted in: Triggers
  • 0

    posted a message on Special wave

    @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.

    Spawn
        Events
            Timer - Wave Timer expires
        Local Variables
            Spawn Timer = 0 <Integer>
        Conditions
        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    Current Wave != 10
                Then
                    ------- Play sound, create units and order them to attack etc.
                Else
                    General - Repeat (Actions) forever
                        Actions
                            General - If (Conditions) then do (Actions) else do (Actions)
                                If
                                    Spawn Timer == 30
                                Then
                                    ------- Start the Rebuild Timer, that - when it expires - will start the Wave Timer again, thus continuing the loop.
                                    General - Break
                                Else
                                    Variable - Modify Spawn Timer: + 1
                                    ------- Play sound, create Infested Terrans and order them to attack etc.
                                    General - Wait 1.0 Real Time seconds
    

    Edit: Attached the example file.

    Posted in: Triggers
  • 0

    posted a message on Special wave

    @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.

    Posted in: Triggers
  • 0

    posted a message on Special wave

    @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.

        Local Variables
            Timer = 0 <Integer>
        Conditions
        Actions
            General - Repeat (Actions) forever
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            Timer == 30
                        Then
                            General - Break
                        Else
                            Variable - Modify Timer: + 1
                            Unit - Create 1 Infested Terran (From Terran Infestation Rupture) for player 1 at (Center of Region 001) using default facing (No Options)
    
    Posted in: Triggers
  • 0

    posted a message on Victory Condition Help

    @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:

    Victory
        Events
            Timer - Every 1.0 seconds of Real Time
        Local Variables
        Conditions
        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (Number of Living units in ("YourHQBuilding" units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 1
                Then
                    General - Pick each integer from 1 to "TotalAmountOfPlayers", and do (Actions)
                        Actions
                            General - If (Conditions) then do (Actions) else do (Actions)
                                If
                                    (Number of Living units in ("YourHQBuilding" units in (Entire map) owned by player (Picked integer) matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 1
                                Then
                                    Game - End game in Victory for player (Picked integer) (Show dialogs, Show score screen)
                                Else
                                    Game - End game in Defeat for player (Picked integer) (Show dialogs, Show score screen)
                Else
    

    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.

    Posted in: Triggers
  • 0

    posted a message on Diplomacy Trigger

    @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.

    Posted in: Triggers
  • 0

    posted a message on [HELP] Unit in Region = unit spawns at X region

    @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.

    Posted in: Triggers
  • 0

    posted a message on How to prevent sound overlapping?

    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.

    Posted in: Triggers
  • To post a comment, please or register a new account.