HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

-Spawn Command Help Needed

01-14-2005, 01:47 AM#1
Scyze
I'm making a creep arena for a little map, and I have several checks: One, to check if the player can use Commands. Two, to check if they are flooding the map with spawns. Three, to check if they are trying to spawn more than 12. And four, to make sure they dont spawn a locust or any other thing that I dont want them to. My problem is with check number 2. Can anyone help?

Code:
Spawn
    Events
        Player - Player 1 (Red) types a chat message containing -spawn as A substring
        Player - Player 2 (Blue) types a chat message containing -spawn as A substring
        Player - Player 3 (Teal) types a chat message containing -spawn as A substring
        Player - Player 4 (Purple) types a chat message containing -spawn as A substring
        Player - Player 5 (Yellow) types a chat message containing -spawn as A substring
        Player - Player 6 (Orange) types a chat message containing -spawn as A substring
        Player - Player 7 (Green) types a chat message containing -spawn as A substring
        Player - Player 8 (Pink) types a chat message containing -spawn as A substring
        Player - Player 9 (Gray) types a chat message containing -spawn as A substring
        Player - Player 10 (Light Blue) types a chat message containing -spawn as A substring
        Player - Player 11 (Dark Green) types a chat message containing -spawn as A substring
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Commandable[(Player number of (Triggering player))] Equal to True
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        CreepSpawnSpamLimit[(Player number of (Triggering player))] Less than or equal to 5
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Creep Arena Area <gen> contains Hero[(Player number of (Triggering player))]) Equal to True
                            Then - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Integer((Substring((Entered chat string), 8, 9)))) Less than or equal to 12
                                    Then - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                (Substring((Entered chat string), 11, 51)) Not equal to locust
                                                (Substring((Entered chat string), 11, 51)) Not equal to archimonde
                                            Then - Actions
                                                Unit - Create (Integer((Substring((Entered chat string), 8, 9)))) (Unit-type((Substring((Entered chat string), 11, 51)))) for Neutral Hostile at (Center of Creep Arena Spawn <gen>) facing Default building facing (270.0) degrees
                                                Unit Group - Order (Last created unit group) to Attack-Move To (Center of Exit Creep Arena <gen>)
                                                Set CreepSpawnSpamLimit[(Player number of (Triggering player))] = (CreepSpawnSpamLimit[(Player number of (Triggering player))] + 1)
                                            Else - Actions
                                                Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: You can't spawn tha...
                                    Else - Actions
                                        Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: Hey! Dont spawn so ...
                            Else - Actions
                                Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: You need to be in t...
                    Else - Actions
                        Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: Hey! No spamming th...
                        Set CreepSpawnSpamLimit[(Player number of (Triggering player))] = (CreepSpawnSpamLimit[(Player number of (Triggering player))] + 1)
            Else - Actions
                Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: You can't use comma...

Code:
Spawner Control Timer
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        CreepSpawnSpamLimit[(Player number of (Triggering player))] Greater than 0
                    Then - Actions
                        Set CreepSpawnSpamLimit[(Player number of (Triggering player))] = (CreepSpawnSpamLimit[(Player number of (Triggering player))] - 1)
                    Else - Actions
                        Do nothing

Thanks,

- Scyze
01-14-2005, 09:51 PM#2
aaero
I'm a little confused about what exactly you want, but I thought I'd point something out to you.

Your second trigger is on a timed event, and it refers to "Triggering Player". There isn't going to be a triggering player for a "Every 1.00 seconds of game time" event, since a player didn't trigger the event.

I'm not exactly sure what you are trying to do in that second trigger, other than lowering the CreepSpawnLimit for a player by 1 every 1 second. It looks like every time they spawn something, you increment a variable for them by 1. Every second, you also take 1 away from this variable. Maybe your whole problem would be solved by changing "Triggering Player" to "Picked Player" in your second trigger?
01-15-2005, 04:04 AM#3
Scyze
O_o;; Thank you so much..
01-17-2005, 02:03 PM#4
Guest
......
01-18-2005, 11:59 AM#5
imwithsstupids
yeah it does say 'triggering player' for the loop u may want to change it to 'Integer A for loop'
01-20-2005, 01:58 PM#6
Guest
.....