Do player TIDs not work on deathmatch or what?

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
PaganRaven
Posts: 439
Joined: Fri Oct 14, 2005 2:21 pm

Do player TIDs not work on deathmatch or what?

Post by PaganRaven »

Been going through some testing, and apparently some scripts dont work on deathmatch and something is wrong. This concerns regaining health for each player. Basically, when a player grabs some healing items the health bar "rolls", or increases by a certain rate of time rather than instantaneusly giving all the health it can give. This works fine in single player and co-op, but in deathmatch the scripts dont seem to be running, leaving the player unable to recover health :woh:
Note I havent actually done this with more than one player, I just set the game mode and went in alone.

Here is how I gave the players TIDs to implement this and other things, which I believe is standard ZDOOM protocol:

Code: Select all

SCRIPT 256 ENTER
{
// Assign each player a TID.
   Thing_ChangeTID(0, 1000 + PlayerNumber());
}
Heres an example of one of the scripts that uses the player TIDS (rolling life bar) which doesn't work on deathmatch:

Code: Select all

SCRIPT 331 ENTER 	// Rolling health for each player
{
   if (health_gain[PlayerNumber()] > 0)
       {
	GiveActorInventory(PlayerNumber()+1000, "HealthBonus", 1);
	health_gain[0] --;
       }
   //gives an interval between recovery.  Length depends on difficulty.
   delay(recover_2);
   restart;
}
Why is life so hard? :shock:

Also on cooperative when I die and ressurrect all my custom weapons are taken away and my ammo is stripped to zero. I dont think picking up ammo gives me more, either. Weird. :?

EDIT: On inspection of the console in deathmatch mode the scripts that keep looping for each player are terminated as "runaway scripts." Gah, I hate when that happens. Any suggestions?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Do player TIDs not work on deathmatch or what?

Post by Graf Zahl »

What is 'recover_2'?
User avatar
PaganRaven
Posts: 439
Joined: Fri Oct 14, 2005 2:21 pm

Re: Do player TIDs not work on deathmatch or what?

Post by PaganRaven »

Recover_2 is an int that represents the number of tics that pass each time life goes up 1 point. It changes based on difficulty (The harder the difficulty, the slower your health recovers)
User avatar
DoomRater
Posts: 8270
Joined: Wed Jul 28, 2004 8:21 am
Preferred Pronouns: He/Him
Location: WATR HQ
Contact:

Re: Do player TIDs not work on deathmatch or what?

Post by DoomRater »

You might be forgetting to set the TID's on respawn. Anything that dies loses its TID.
User avatar
PaganRaven
Posts: 439
Joined: Fri Oct 14, 2005 2:21 pm

Re: Do player TIDs not work on deathmatch or what?

Post by PaganRaven »

I might just have to cut some corners and give deathmatch mode a normal health system. :railgun:
DoomRater wrote:You might be forgetting to set the TID's on respawn. Anything that dies loses its TID.
That is something I did not know. Ummm....... now..... how do you go about doing that? :?:
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Re: Do player TIDs not work on deathmatch or what?

Post by HotWax »

PaganRaven wrote:That is something I did not know. Ummm....... now..... how do you go about doing that? :?:

Code: Select all

script 1 ENTER {
     Thing_ChangeTID(0, 1337+PlayerNumber());
}

script 2 RESPAWN {
     Thing_ChangeTID(0, 1337+PlayerNumber());
}
User avatar
PaganRaven
Posts: 439
Joined: Fri Oct 14, 2005 2:21 pm

Re: Do player TIDs not work on deathmatch or what?

Post by PaganRaven »

Heheh, there's something besides VOID, (args), OPEN, and ENTER? I gotta check up on the documentation more often :lol:

I might release a gamma of my mod soon. And by "soon" I really do mean within a couple days or so and in a nicely compact pk3. Stay tuned ;)
User avatar
DoomRater
Posts: 8270
Joined: Wed Jul 28, 2004 8:21 am
Preferred Pronouns: He/Him
Location: WATR HQ
Contact:

Re: Do player TIDs not work on deathmatch or what?

Post by DoomRater »

Yeah, there's also RETURN as well, for players that leave a map and then come back to it.
Locked

Return to “Editing (Archive)”