Author Topic: Respawn  (Read 3681 times)

What is the variable for when a player respawns? (Not looking for respawn time)

If you're not looking for respawn time then what are you looking for?

If you're not looking for respawn time then what are you looking for?

http://forum.blockland.us/index.php?topic=268064.0

I told him I would do it

Dont write the code for me please, I wish to do it on my own and learn.

I need to know what to use when detecting the player respawning

http://forum.blockland.us/index.php?topic=268064.0

I told him I would do it

Dont write the code for me please, I wish to do it on my own and learn.

I need to know what to use when detecting the player respawning
You're looking for a function then. Not a variable.

I would have given you the function, but you say you'd like to learn and do it on your own. Use Elm's guide on using trace and figure out which function you need to use.
http://forum.blockland.us/index.php?topic=191941.0

The function might be called when you first spawn though, so I'd suggest checking %client.hasSpawnedOnce.

When I said code I ment the entire script.

I would appriciate it if you told me the function tho.

When I said code I ment the entire script.

I would appriciate it if you told me the function tho.
I used trace to find   

GameConnection::spawnPlayer(%client)

(that might be wrong, but I tried, and tested - it worked)

I think GameConnection::onSpawn(%client) might be better.

When I said code I ment the entire script.

I would appriciate it if you told me the function tho.
Yeah I know. But I'd be best to learn how to figure these things out on your own.

Basically package GameConnection::SpawnPlayer to do what you want and then parent it. If you are unsure how, just ask us for more details.

ONLY if you have been trying for a significant amount of time with little to no progress**

ive used this before, you can ignore "DebugSpawn(%this,%obj);"
Code: [Select]
function armor::onadd(%this,%obj)
{
Parent::onadd(%this,%obj);
DebugSpawn(%this,%obj);
}


ive used this before, you can ignore "DebugSpawn(%this,%obj);"
Code: [Select]
function armor::onadd(%this,%obj)
{
Parent::onadd(%this,%obj);
DebugSpawn(%this,%obj);
}


What exactly happens on armor::onadd?

What exactly happens on armor::onadd?

Armor (a playertype) is added to the world.

Armor (a playertype) is added to the world.
How is it different from GameConnection::SpawnPlayer ?

How is it different from GameConnection::SpawnPlayer ?

GameConnections are clients, armors are players. Therefore bots will trigger Armor::onAdd, but not GameConnection::SpawnPlayer. There are also other ways than GameConnection::SpawnPlayer to create a player, some of which won't use GameConnection::SpawnPlayer, but they all will trigger Armor::onAdd.