Sign in to follow this  
Followers 0

Player-Specific Script Executions?

Hey guys,

This is my first post in forever here at DoomWorld and I just had a quick question to ask for those of you who have been using Doom Builder (2) for a lengthy amount of time and have become comfortable with the ACS scripting you can use in conjunction with it:

How would I go about creating a team-based multiplayer map in which players on two separate teams trigger scripts that act separately for each player and have different consequences depending on the team to which they've been assigned? For example, let's say I want to have two teams - red and blue - and members of these two teams must stand in a specific area for a certain amount of time to 'capture' a point for their side.

I've coded the capture mechanic for one player and it works fine, but how would I go about determining which team the player is on and only triggering the script if:
- A Blue player steps into a Red zone
- A Red player steps into a Blue zone

Whereas any other scenario (A blue player stepping into a blue zone or vice versa) is totally ignored. Think of it as a Battlefield 1942-like clone, but rather than standing under flags you're standing in specific circular zones.

I guess what I'm asking in a much shorter form is how do you write a script that can determine which exact player is triggering that script and which team that player is on? I've tried giving my players Thing ID numbers but those don't seem to have the correct effects. It's as if the identification numbers sort of "roll off" and are totally ignored when given to Player Start things. Perhaps I'm missing something or just on the wrong track all-together?

Thank you for any suggestions and advice and I apologize if this question(s) is not clear or specific enough for you to offer assistance. I did my best to explain!

I would like to add that even understanding how to create a simple two-player co-op map in which each player triggers a script with different consequences would be a triumph for me and would move me forward in the right direction. Even this is something I'm not totally sure how to do because of the identification number problem I mentioned in the paragraph before the last. Both problems tend to fall into the same category, however, so I figured I would throw that one in there just in case it would be easier to explain rather than getting into the whole red/blue team capture-point thing.

Share this post


Link to post

I imagine the GetPlayerInfo and ActivatorTID functions will cover what you need. Query ActivatorTID to ensure the script activator is a valid player and then use GetPlayerInfo to find out what team the player is on.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0