RespawnTime/bInstantRespawn

Discussions about Coding and Scripting
Post Reply
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

RespawnTime/bInstantRespawn

Post by Barbie »

Because the DoubleJump inventory does not work anymore after picking up certain inventory items (eg. a ScubaGear) in map MH-RistvakBaen+fix2, I had a closer look at it and found that all ScubaGears in the maps differs with

Code: Select all

RespawnTime=0
bInstantRespawn=True
from the default values

Code: Select all

RespawnTime=20
bInstantRespawn=False
As soon as I have picked up such an item, doublejump does not work anymore and also the HUD weapon status bar hides all weapons except the current selected. Leaving this issue apart I'm interested in what RespawnTime and bInstantRespawn really does:
The comments in the code of Inventory.uc say that RespawnTime==0 means "instant respawn":

Code: Select all

var() bool		bInstantRespawn;	  // Can be tagged so this item respawns instantly.
var() float     RespawnTime;          // Respawn after this time, 0 for instant.
bInstantRespawn is not used in any stock UC script; is it evaluated by the engine?

Another code snippets from Inventory.uc (global function) says that RespawnTime==0 means "no respawn":

Code: Select all

function DropFrom(vector StartLocation) {
	if ( !SetLocation(StartLocation) )
		return; 
	RespawnTime = 0.0; //don't respawn
...
}
...
State Sleeping {
...
Begin:
	Sleep( ReSpawnTime );
	PlaySound( RespawnSound );	
	Sleep( Level.Game.PlaySpawnEffect(self) );
	GoToState( 'Pickup' );
}
So the meaning of RespawnTime depends on the state of that object?
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: RespawnTime/bInstantRespawn

Post by sektor2111 »

I'm not sure About STATE but I'm saying that is a variable which is used even by Skaarj as long as if we have a Factory spawning Skaarj is not a good thing to see X++ Weapons respawned levitating there for no reason...
Btw, you have to fix Weapons dropped by these freaks... because they only hangs...
As for DoubleJump I don't even have that installed in server and I won't have it so I cannot help in testing these... As usual, New stuff = New bugs = New headaches.
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: RespawnTime/bInstantRespawn

Post by Barbie »

Thanks for reply. As I'm not in the mood digging deeper into that yet, I run a map specific patch on loading where I change RespawnTime from 0 to 1.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Post Reply