• 0

    posted a message on [Solved] [Trigger] Creating units one by one, with a short interval.

    Evening. I managed to run into a really silly problem. On my map I have a trigger that spawns one unit of a unit type specified in a variable at each of 20 points (4 points per player), sets their health (from another variable) and adds them to a unit group. Now, I'd like one unit to spawn at each of the 20 points, then the trigger should wait about 1 second before it spawns four more - repeating until the amount of units hit the correct mark (6 units / point).

    But for some reason, my trigger will spawn 1 unit on each point, then 4 units on each point, and then 1 more units on each point. Why!?

    (The trigger's fired by another trigger, hence no Event. The Player Check variable is just to make sure spawns won't happen if the player those spawns are meant for isn't playing: 1-4 = player 1, 5-8 = player 2 etc.)

    Spawn Waves
        Events
        Local Variables
        Conditions
            Wave Spawn Count < Number of Units Per Point Per Wave
        Actions
            General - Wait 1.0 Real Time seconds
            Variable - Modify Wave Spawn Count: + 1
            General - Pick each integer from 1 to 20, and do (Actions)
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            Player Check[(Picked integer)] == 1
                        Then
                            Unit - Create 1 Wave Units[Wave Number] for player 7 at Player Check Points[(Picked integer)] using default facing (No Options)
                            Unit - Set (Last created unit) Maximum Life to (Real(Wave Health[Wave Number]))
                            Unit Group - Add (Last created unit) to Wave Unit Group
                            Trigger - Run Spawn Waves (Check Conditions, Don't Wait until it finishes)
                        Else
    

    What did I do wrong? :<

    Posted in: Triggers
  • 0

    posted a message on [Solved] [Trigger] Check if variables are in sequence?

    @Berrala: Go

    Ah yes, I think I get what you mean. But the thing is, I already got a way to detect pair, two pair, three of a kind, full house and four of a kind. Together with my straight check and flush check, I just have a trigger with 13 If Then Else conditions (also check for ace high and rockets) that check if you got a royal straight flush, a straight flush, four of a kind etc. all the way down. I did what dgh64 said, with a Do Once variable that makes sure no other command will run further down if my trigger finds a match higher up. And it works perfectly.

    I'm still somewhat of a beginner, so I have no idea how to do custom functions and stuff. Still, using logic and some basic knowledge I managed to finish all the poker triggers in two days - and I'm really proud of that. But thanks for your help, and I'll be back once I learn a bit more. :3

    Posted in: Triggers
  • 0

    posted a message on [Solved] [Trigger] Check if variables are in sequence?

    @dgh64: Go

    There's no Return function? You know, to just stop doing whatever the trigger's doing at that point? Used it all the time when modding for Oblivion and Fallout 3. :x Otherwise I'll have to do that. Thanks.

    Posted in: Triggers
  • 0

    posted a message on [Solved] [Trigger] Check if variables are in sequence?

    @DisAs7ro: Go

    No, I have a variable that checks for pair / two pair etc. So straights won't trigger if any two cards are the same rank. But yes, without such a check you'd be right. I should have included that in my original post. :p

    @Berrala: Go

    I had no idea you could sort values... That would have helped a lot, but now I worked it out with the help of dgh64. But for future reference, how do you go about doing that? Looked at your map, but I'm in no shape to understand all that stuff right now. I'll be keeping it for future reference though. Thanks.

    Since I have your attention, is there any way to stop / kill / shut down a trigger in the middle of it? I have 13 If Then Else checks to identify the player's hand, but if I now get royal straight flush, I also get flush and straight. Stop Trigger and Clear Action Queue doesn't stop the current trigger. :/

    Posted in: Triggers
  • 0

    posted a message on [Solved] [Trigger] Check if variables are in sequence?

    @dgh64: Go

    Haha, you wrote that as I updated my post above. Yeah, I got it working I think (thought I did it as I wrote above). Thanks a lot, I should be ready to release this tomorrow or so.

    Posted in: Triggers
  • 0

    posted a message on [Solved] [Trigger] Check if variables are in sequence?

    @dgh64: Go

    Ever played Poker Defense? It was great fun in the BW days. I'm recreating a real version with 52 cards and everything. Not like the version I recently played that was completely broken and only used 2-3 suits and about 9 ranks for cards.

    Anyway, I didn't solve it. Forgot something so simple as the fact that other cards can give the same sum as a sequence. -.- So, back to my question. Is it possible to check if my 5 variables are in sequence somehow?

    Edit: Solved! This time for real, I hope. Add the values, get the sum, check all variables so that none of them are below the lowest value that would start the sequence. That is, 5+6+7+8+9=35, so if you have 35 none of the values can be below 5. If none of them are, then you really have your sequence. Because you can't get 35 without using 1-4, if you're not using 5-9 - the sequence in question. I hope that made sense.

    Posted in: Triggers
  • 0

    posted a message on [Solved] [Trigger] Check if variables are in sequence?

    Hello, first time poster here, though I've been around for a few weeks now. I'm working on a map in which I have five variables, that each hold any one out of 13 different values (1-13), and I need a trigger that checks if they are lined up in a sequence (such as 1-2-3-4-5, or 6-4-7-5-8). [Edit: Not a set sequence, but if one card is X the next needs to be X+1 or X-1 and so on. Maybe that's how you'd go about solving it? I'll try...]

    Is that possible? I can handle all the other checks I'm using, but this one I just can't figure out. Thanks in advance.

    (Bonus points if you can figure out what kind of map I'm making.)

    Edit: Solved! I asked my good friend and together we figured out that we can use the sum of the sequence to identify it. Starting at 15, going up in intervals of 5, we can pin point any one sequence. That is, 1+2+3+4+5=15, 5+6+7+8+9=35, 9+10+11+12+13=55 etc. Only these values would give the correct sum, and the order of the values won't matter, since we're just adding them to each other.

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