Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Problem with an MVP calc
Problem with an MVP calc
May 14 2012, 6:27 pm
By: Oo.DaMeiN.oO  

May 14 2012, 6:27 pm Oo.DaMeiN.oO Post #1



I cannot seem to figure out why this isn't working..

Each time someone kills a unit, a unit is created for P8 (AI). And then after 3 minutes (Reduced to ~30 seconds for testing) the triggers should:

A: Give ownership to the player at the desired location.
B: Count +1 to a DC.
C: Give ownership back to P8 after all units have been accounted for all players
D: Display a leaderboard with the info
E: Restart the counter to start over.

But for some reason, I cannot see WHY the triggers aren't working.

Trigger
Players
  • Player 1
  • Conditions
  • Score("Current Player", Kills, Exactly, 350)
  • Actions
  • Set Score("Current Player", Set To, 0, Kills)
  • Create Unit with Properties("Player 8", "Hunter Killer (Hydralisk)", 1, "P1MVPUnits", 2)
  • Preserve Trigger()
  • (The properties are: Invincible and Burrowed.


    Trigger
    Players
  • Player 8
  • Conditions
  • Always()
  • Actions
  • Set Deaths("Player 8", "Terran Medic", Set To, 200)
  • (I created this when I couldn't figure out why it wasn't working, if I missed something I will remove this and the Exactly 3 deaths for the other counter)

    Trigger
    Players
  • Player 8
  • Conditions
  • Deaths("Player 8", "Terran Medic", Exactly, 1)
  • Deaths("Player 8", "Terran Valkyrie", Exactly, 0)
  • Actions
  • Set Deaths("Player 8", "Terran Valkyrie", Set To, 1)
  • Preserve Trigger()


  • Trigger
    Players
  • Player 8
  • Conditions
  • Deaths("Player 8", "Terran Valkyrie", Exactly, 1)
  • Bring("Player 8", "Hunter Killer (Hydralisk)", "P1MVPUnits", At least, 1)
  • Actions
  • Set Deaths("Player 1", "Terran SCV", Add, 1)
  • Give Units to Player("Player 8", "Player 1", "Hunter Killer (Hydralisk)", 1, "P1MVPUnits")
  • Preserve Trigger()


  • Trigger
    Players
  • Player 8
  • Conditions
  • Deaths("Player 8", "Terran Valkyrie", Exactly, 1)
  • Bring("Player 8", "Any unit", "MVPUnits", Exactly, 0)
  • Bring("Team HOT", "Any unit", "MVPUnits", At least, 1)
  • Bring("Team COLD", "Any unit", "MVPUnits", At least, 1)
  • Actions
  • Give Units to Player("Player 1", "Player 8", "Any unit", All, "P1MVPUnits")
  • Set Deaths("Player 8", "Terran Valkyrie", Set To, 2)
  • Preserve Trigger()
  • (The Give Units is repeated for P1-P8 with necessary location/player numbers)

    Trigger
    Players
  • All Players
  • Conditions
  • Deaths("Player 8", "Terran Valkyrie", Exactly, 2)
  • Actions
  • Set Deaths("Current Player", "Cave", Set To, 50)
  • Set Deaths("Current Player", "Cave-in", Set To, 0)
  • Leaderboard Computer Players(disabled)
  • Leader Board Control("\x01eMVP", "Terran SCV")
  • Preserve Trigger()


  • Trigger
    Players
  • All Players
  • Conditions
  • Deaths("Current Player", "Cave", Exactly, 0)
  • Deaths("Current Player", "Cave-in", Exactly, 0)
  • Actions
  • Set Deaths("Current Player", "Cave", Set To, 40)
  • Set Deaths("Current Player", "Cave-in", Set To, 1)
  • Set Deaths("Player 8", "Terran Valkyrie", Set To, 3)
  • Leaderboard Computer Players(disabled)
  • Leader Board Kills("\x01eKills", "Terran Ghost")
  • Preserve Trigger()


  • Trigger
    Players
  • Player 8
  • Conditions
  • Deaths("Player 8", "Terran Medic", Exactly, 0)
  • Deaths("Player 8", "Terran Valkyrie", Exactly, 3)
  • Actions
  • Set Deaths("Player 8", "Terran Medic", Set To, 200)
  • Set Deaths("Player 8", "Terran Valkyrie", Set To, 0)
  • Preserve Trigger()


  • And a subtractor for medic.

    Trigger
    Players
  • Player 8
  • Conditions
  • Deaths("Current Player", "Terran Medic", At least, 1)
  • Actions
  • Set Deaths("Current Player", "Terran Medic", Subtract, 1)
  • Preserve Trigger()



  • I know the leaderboard won't show the DC of the SCV, its just a placement holder for now.

    Post has been edited 1 time(s), last time on May 14 2012, 6:32 pm by Oo.DaMeiN.oO.



    None.

    May 15 2012, 12:49 am Roy Post #2

    An artist's depiction of an Extended Unit Death

    You know there's already a leaderboard for Most Kills, yes? Perhaps you could just use that. Also, I'm sure you recognize that this setup will take place over several trigger cycles (at least one cycle for each kill of the player with the most kills).

    Anyway, you were very vague on how exactly the triggers aren't working. A great way to debug the system yourself is to add a Display Text Message to each trigger, so you can see when each trigger executes, and which ones aren't behaving as expected.

    Here's a few possible places you could have stumbled:
    Quote from Oo.DaMeiN.oO
    Trigger
    Players
  • Player 1
  • Conditions
  • Score("Current Player", Kills, Exactly, 350)
  • Actions
  • Set Score("Current Player", Set To, 0, Kills)
  • Create Unit with Properties("Player 8", "Hunter Killer (Hydralisk)", 1, "P1MVPUnits", 2)
  • Preserve Trigger()
  • (The properties are: Invincible and Burrowed.
    If the player kills something not worth exactly 350 in kill score, this trigger breaks. You could change it to use "At Least" and "Subtract" to make it a little safer, unless you know for sure the player won't be killing anything other than 350-point units.

    Quote from Oo.DaMeiN.oO
    Trigger
    Players
  • Player 8
  • Conditions
  • Deaths("Player 8", "Terran Valkyrie", Exactly, 1)
  • Bring("Player 8", "Any unit", "MVPUnits", Exactly, 0)
  • Bring("Team HOT", "Any unit", "MVPUnits", At least, 1)
  • Bring("Team COLD", "Any unit", "MVPUnits", At least, 1)
  • Actions
  • Give Units to Player("Player 1", "Player 8", "Any unit", All, "P1MVPUnits")
  • Set Deaths("Player 8", "Terran Valkyrie", Set To, 2)
  • Preserve Trigger()
  • (The Give Units is repeated for P1-P8 with necessary location/player numbers)
    This trigger has serious problems. It will only run if both Team HOT and Team COLD have at least 1 kill each. If, for example, only Player 1 has killed anything, this trigger will not run. I'm guessing this isn't the way you want the trigger to work.

    Furthermore, after this trigger runs once for Player 1's area, the first and second conditions become false, so the triggers for the other players' areas will not run.

    Quote from Oo.DaMeiN.oO
    Trigger
    Players
  • All Players
  • Conditions
  • Deaths("Player 8", "Terran Valkyrie", Exactly, 2)
  • Actions
  • Set Deaths("Current Player", "Cave", Set To, 50)
  • Set Deaths("Current Player", "Cave-in", Set To, 0)
  • Leaderboard Computer Players(disabled)
  • Leader Board Control("\x01eMVP", "Terran SCV")
  • Preserve Trigger()


  • Trigger
    Players
  • All Players
  • Conditions
  • Deaths("Current Player", "Cave", Exactly, 0)
  • Deaths("Current Player", "Cave-in", Exactly, 0)
  • Actions
  • Set Deaths("Current Player", "Cave", Set To, 40)
  • Set Deaths("Current Player", "Cave-in", Set To, 1)
  • Set Deaths("Player 8", "Terran Valkyrie", Set To, 3)
  • Leaderboard Computer Players(disabled)
  • Leader Board Kills("\x01eKills", "Terran Ghost")
  • Preserve Trigger()
  • Unless you're omitting a trigger that decreases the deaths of Cave, one of these triggers will run once and then both triggers will never run again because Cave has more than 0 deaths.



    In summary, there's likely something wrong with your EndMVPCalc trigger, and your leaderboard triggers look slightly borked as well. If you need more help, you should provide much more details as to what the problem actually is (where it stops working, for example), what all your death counters represent (I assume Cave is supposed to be a timer for the leaderboard?), the results of debugging via Display Text Message, and/or posting the map itself.




    May 15 2012, 12:58 am Oo.DaMeiN.oO Post #3



    Alright, sorry about not explaining everything 100%.

    A: The kill score will only ever reach 350, nothing else is in the game that can be killed save that one unit (A terran ghost)

    B: Will check into that trigger.

    Although, I did use display text message, but only ever saw the first trigger, never even got close to the EndMVPCalc one.

    As for the Cave, yes, the cave was set back to 0, just forgot to add that in.

    For quicker debugging I'll post the map.

    So I might of edited something from the OP, since I've still been working on this a bit. I added the creation of overlords instead of text incase it was messing up somehow? Anyways, thanks so far.. I am really, really bad at explaining things.. as my wife tells me all the time :(

    Attachments:
    Snipers Bald Locks.scx
    Hits: 2 Size: 54.29kb



    None.

    May 15 2012, 1:07 am Oo.DaMeiN.oO Post #4



    Hmph.. it looks like I fixed it, haha. Not sure what the initial problem was, but in the map I posted (Different trgis from OP) I added a action in the LeaderBoard(ForKIlls) that stopped it. I think I got it working. I'l lget back to you.



    None.

    May 15 2012, 1:30 am Roy Post #5

    An artist's depiction of an Extended Unit Death

    Found your problem:

    Trigger
    Players
  • All Players
  • Conditions
  • Deaths("Current Player", "Cave", Exactly, 0)
  • Deaths("Current Player", "Cave-in", Exactly, 0)
  • Actions
  • Set Deaths("Current Player", "Cave", Set To, 40)
  • Set Deaths("Current Player", "Cave-in", Set To, 1)
  • Set Deaths("Player 8", "Terran Valkyrie", Set To, 3)
  • Leaderboard Computer Players(disabled)
  • Leader Board Kills("\x01eKills", "Terran Ghost")
  • Preserve Trigger()


  • This trigger runs immediately (and alternates with the other leaderboard before your medic DC completes), because all the conditions are true. It sets the deaths of Valkyrie to 3, so your trigger checking for 0 deaths of Valkyrie never runs (maybe you should get rid of that line? Or add a condition requiring Valkyrie deaths of exactly 1 or 2?). Your reset in the map (StartCounterForMVPCalc) is also checking for 2 deaths of Valkyrie instead of the 3 you specified in the OP.

    Basically, your leaderboard trigger is preventing your calculation system from running.




    May 16 2012, 12:57 am Oo.DaMeiN.oO Post #6



    Apparently I just fail at this... omg I thought I had it and then when I tried adding in the actual count it wen't AWOL again...

    Like I said before, I suck at explaining and vice versa, I am a visual learner. If someone could download this map, and re-upload with it fixed I would greatly appreciate it, and I won't be just taking it and leaving I'll go over ever detail to understand where I wen't wrong.

    What I want it to do:

    Everytime a player gets a kill, they get +1 to their Hunter Killer unit
    Everytime a player gets a flag, they get +1 to their Unclean One unit
    Everytime a player gets a bonus (+5) they get +1 to their Devouring One unit
    Everytime a player dies they get +1 to their Defiler unit

    And then after x time (It will be three minutes later) and every three minutes after that, I want it to A:

    Give 1 unit at a time to the appropriate player and give +x to their DC of Terran SCV.

    (Kill = +1, Flag = +3, Bonus (+5) = +4, Death = -1)

    And then once all of that has been distributed it gives all the player +1 Drone unit for each point. Then, displays a leaderboard who has the most Drones.

    Sorry and thank you... I really cannot figure why its not working.. I've literally put over 10+ hours into this function, which is less than it took me to do all the other triggers.. so frustrating :/

    Attachments:
    Snipers Bald Locks.scx
    Hits: 1 Size: 55.08kb



    None.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [09:18 pm]
    Ultraviolet -- 🔪🐈
    [12:34 pm]
    NudeRaider -- curiosity kills the cat!
    [06:18 am]
    Sylph-Of-Space -- No complaints here, i'm just curious!
    [2024-5-18. : 11:05 pm]
    Ultraviolet -- :wob:
    [2024-5-18. : 3:55 pm]
    Zoan -- :wob:
    [2024-5-18. : 10:34 am]
    NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
    [2024-5-18. : 3:45 am]
    Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
    [2024-5-17. : 6:47 am]
    NudeRaider -- lil-Inferno
    lil-Inferno shouted: nah
    strong
    [2024-5-17. : 5:41 am]
    Ultraviolet -- 🤔 so inf is in you?
    [2024-5-17. : 4:57 am]
    O)FaRTy1billion[MM] -- my name is mud
    Please log in to shout.


    Members Online: Roy