Question about scoring

Jougi

New Member
Reaction score
2
Im making a arena map. There is two teams and you need X amount of kills to win.

I have made a variable to both teams' scores. How can i add points to that variable?

add points to force 1
Events
Unit - A unit Dies
Conditions
(Owner of (Killing unit)) Equal to (Random player from Force1)
(Owner of (Dying unit)) Equal to (Random player from Force2)
((Dying unit) is A Hero) Equal to True
Actions

Theres what i have made. If there is something to fix, please tell me what to.

I can only find set variable, not add to variable.
 

Romek

Super Moderator
Reaction score
964
Ok...
1. use
Code:
 Tags.
2.
[CODE](Owner of (Killing unit)) Equal to (Random player from Force1)
(Owner of (Dying unit)) Equal to (Random player from Force2)
Ermm... Random Player? So it'll set a random player, and then check the condition.

3. To add to a variable, use:
Code:
Set Integer1 = Integer1 + 1
 
M

Mr.Banankaka

Guest
Random player wouldn´t work.. You have to make a boolean comparison.
Here´s a trigger I made:

Code:
Scoring System
    Events
        Unit - A unit Dies
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                And - All (Conditions) are true
                    Conditions
                        ((Dying unit) is in Team1UnitGroup) Equal to True
                        ((Killing unit) is in Team2UnitGroup) Equal to True
            Then - Actions
                Set TeamScores[1] = (TeamScores[1] + 1)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                And - All (Conditions) are true
                    Conditions
                        ((Dying unit) is in Team2UnitGroup) Equal to True
                        ((Killing unit) is in Team1UnitGroup) Equal to True
            Then - Actions
                Set TeamScores[2] = (TeamScores[2] + 1)
            Else - Actions

I it´s a random unit comparison a random unit will be picked and if it´s not the same as the killing unit the trigger won´t run...
(Correct me if I´m wrong... Not 100% sure about that.)

Anyway if you like the trigger, use it.
 

Jougi

New Member
Reaction score
2
Random player wouldn´t work.. You have to make a boolean comparison.
Here´s a trigger I made:

Code:
Scoring System
    Events
        Unit - A unit Dies
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                And - All (Conditions) are true
                    Conditions
                        ((Dying unit) is in Team1UnitGroup) Equal to True
                        ((Killing unit) is in Team2UnitGroup) Equal to True
            Then - Actions
                Set TeamScores[1] = (TeamScores[1] + 1)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                And - All (Conditions) are true
                    Conditions
                        ((Dying unit) is in Team2UnitGroup) Equal to True
                        ((Killing unit) is in Team1UnitGroup) Equal to True
            Then - Actions
                Set TeamScores[2] = (TeamScores[2] + 1)
            Else - Actions

If i want to use that trigger. Do i have to make a Unit Group for both teams? is there any way just using player groups?

Edit: And can a unit be in two different groups at a time? Cos if not, its going to mess up my reviving system.
 

vypur85

Hibernate
Reaction score
803
Code:
Untitled Trigger 001
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Player number of (Owner of (Triggering unit))) Equal to (Integer A)
                    Then - Actions
                        Set Integer_Team[1] = (Integer_Team[1] + 1)
                    Else - Actions
        For each (Integer A) from 6 to 10, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Player number of (Owner of (Triggering unit))) Equal to (Integer A)
                    Then - Actions
                        Set Integer_Team[2] = (Integer_Team[2] + 1)
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Integer_Team[1] Equal to 10
            Then - Actions
                For each (Integer A) from 1 to 5, do (Actions)
                    Loop - Actions
                        Game - Defeat (Player((Integer A))) with the message: Defeat!
            Else - Actions
                For each (Integer A) from 6 to 10, do (Actions)
                    Loop - Actions
                        Game - Defeat (Player((Integer A))) with the message: Defeat!
This seems workable for players. It's not tested. The trigger runs when a hero dies. When Integer_Team of either team reaches 10, they lose. This trigger does not detect friendly kills though.

>And can a unit be in two different groups at a time?
Yeah. It can. :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top