Awarding Points to the Other Team

I have a game I am working on, where players indirectly eliminate other players … such as, we are driving racecars and I force yours to run into a wall and blow up. Technically, I have caused the elimination, but the game sees it as a self-elimination.

So, how do I award the other team a point in this instance?

In a nutshell:
A player on Team A eliminates themselves (that’s what the game engine sees). How do we score a point for Team B?

I am fine with doing this with devices, verse code, or both, I just can’t seem to find an easy way to add a point to team B when the agent that purportedly caused their own elimination is on Team A.

Any help would be greatly appreciated. :slight_smile:

If you can cause damage via the fort_character in verse, the API lets you provide a damage instigator, so you can pass the other player as the instigator.

if:
            Char := Agent.GetFortCharacter[]
            Instigator := game_action_instigator[Char]
then:
            Args : damage_args = damage_args{Instigator:=option{Instigator},Amount:=200.0}
            Char.Damage(Args)
1 Like

This just might work.

Elaborating on your idea, I could keep track of the last agent to make contact with each player and then credit them with any damage that follows.

This covers the situations where a player instigates the action, but it unfortunately doesn’t cover when a player hits the wall by their own bad luck. Still, the result would be a point for the other team, and I think that could be good enough. :slight_smile:

Thinking this through, I could also start each team with X points (maybe 100) and remove a point every time someone is eliminated (by themselves or others). When a team reaches a score of zero, that would signify a win.

I think I’ll try both ideas. Thanks!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.