A few ACS Questions

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Zeg-Vok
Posts: 60
Joined: Tue Nov 23, 2004 2:57 pm

A few ACS Questions

Post by Zeg-Vok »

I've been scouring the Wiki for awhile now, and I just cant find the answer to my questions.

A) How would one go about automatically assigning a player a specific TID without having them activate a script by running over a line or clicking a button. I.E. When a player joins the game can I give Player 1 a TID of 3 and Player 2 a TID of 7?

B) If there is a way of doing part A, is there a way for me to retrieve what player 1's TID is?
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

Using an ENTER script with "Thing_ChangeTID(1337+PlayerNumber());" will give players 1, 2, 3, and 4 the TIDs 1337, 1338, 1339, and 1340, respectively. From there you can use an If statement in your script to check which player activated it (ActivatorTID and the like). Should work with a bit of tweaking.

And 1337 is just an arbitrary number. Remember to put *something* there though, as PlayerNumber() starts at 0 and there's no such thing as a TID of 0.
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

You've got it wrong. Thing_ChangeTID uses two parameters.

Thing_ChangeTID(0, 1337 + PlayerNumber()); would be correct.

(The first 0 would mean whoever activated the script)

To make keep track of things easier, I suggest using more simple numbers like 1001 instead of 1337.

In that case, player 1's TID will be 1001, player 2's will be 1002, etc. Easier to read.
User avatar
Zeg-Vok
Posts: 60
Joined: Tue Nov 23, 2004 2:57 pm

Post by Zeg-Vok »

Thanks for the help, but now I have another question.

Would I be able to store a player's TID as a variable for me to reference throughout the game?

For example, say I defined the variables player1tid and player2tid, and then I wanted to check what player1's TID and player2's TID was, then match them up with a repeating ThingHate script. Similar to making teams via ACS, but with a little more freedom and "Zazz"

Or could I simply define TID's via playerclasses?
User avatar
farhaven
Posts: 82
Joined: Sun Feb 25, 2007 2:01 pm
Location: NRW, Germany

Post by farhaven »

if you used nash's script,you just have to add the playernumber to 1000 and got the tid.
User avatar
Zeg-Vok
Posts: 60
Joined: Tue Nov 23, 2004 2:57 pm

Post by Zeg-Vok »

Ah, I got it now, thanks a lot
Locked

Return to “Editing (Archive)”