HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger headaches

06-15-2004, 08:03 PM#1
Mink
For the new map I am working on, things are going well but I am having a few problems. First problem is this trigger:

Code:
Update Leaderboard
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Killing unit)) Not equal to (Owner of (Dying unit))
        ((Owner of (Killing unit)) is an ally of (Owner of (Dying unit))) Not equal to True
    Actions
        Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + (Point-value of (Dying unit)))
        Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Kills[(Player number of (Owner of (Killing unit)))]


What is happening is when a player kills a unit, it is multiplying the Kills variable by 2 and adding 1 (which is the unit's point value). So if I have 36 kills and I kill another unit, I now have 73 kills. Checking though it there is nothing that I see causing the problem. Second part causing me stress is this trigger:

Code:
Upgrades Renegades
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                And - All (Conditions) are true
                    Conditions
                        I_Attack Equal to 40
                        I_Defense Equal to 40
                        I_Hitpoints Equal to 40
                        I_Regen Equal to 40
            Then - Actions
                Player - Set the current research level of Improved Building Regeneration (defender Building Regen) to 1 for Player 11 (Dark Green)
            Else - Actions
        For each (Integer A) from 1 to 1000, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Kills[11] Equal to ((Integer A) x 30)
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                B_Attack Equal to True
                            Then - Actions
                                Set I_Attack = (I_Attack + 1)
                                Player - Set the current research level of Imporved Weapons (Defenders Attack) to I_Attack for Player 11 (Dark Green)
                                Set B_Attack = False
                                Set B_Defense = True
                                Skip remaining actions
                            Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                B_Defense Equal to True
                            Then - Actions
                                Set I_Defense = (I_Defense + 1)
                                Player - Set the current research level of Improved Defense (Defenders Defense) to I_Defense for Player 11 (Dark Green)
                                Set B_Defense = False
                                Set B_Hitpoints = True
                                Skip remaining actions
                            Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                B_Hitpoints Equal to True
                            Then - Actions
                                Set I_Hitpoints = (I_Hitpoints + 1)
                                Player - Set the current research level of Improved Vitality (defenders HP) to I_Hitpoints for Player 11 (Dark Green)
                                Set B_Hitpoints = False
                                Set B_Regen = True
                                Skip remaining actions
                            Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                B_Regen Equal to True
                            Then - Actions
                                Set I_Regen = (I_Regen + 1)
                                Player - Set the current research level of Improved Building Regeneration (defender Building Regen) to I_Regen for Player 11 (Dark Green)
                                Set B_Regen = False
                                Set B_Attack = True
                                Skip remaining actions
                            Else - Actions
                    Else - Actions

This trigger will update just fine initially, but when it hits 150 kills for Player 11, there is no attack upgrade. Any clue what I did wrong?

Thanks
Mink
06-15-2004, 11:33 PM#2
ChaosWolfs
Code:
Update Leaderboard
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Killing unit)) Not equal to (Owner of (Dying unit))
        ((Owner of (Killing unit)) is an ally of (Owner of (Dying unit))) Not equal to True
    Actions
        Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + [b](Point-value of (Dying unit)))[/b]
        Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Kills[(Player number of (Owner of (Killing unit)))]


Point-Value of Unit?

Should be

Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1

So, fix that and try testing the game again and see if upgrades work.
06-15-2004, 11:40 PM#3
Mink
Quote:
Originally Posted by ChaosWolfs
Point-Value of Unit?

Should be

Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1

So, fix that and try testing the game again and see if upgrades work.

I changed it to point value because with it saying +1 it was not working either. I never pinpointed exactly what was wrong, but the count was way too high for player 1 always, but not as bad as using point value. I am also using point value to seperate which units will count for the leaderboard, and which will not.
06-18-2004, 06:48 AM#4
Mink
Anyone can help me with this? I fixed the problem with the kill count, but I am still having trouble with the second trigger.