Author Topic: What function is called when somebody is the last man standing?  (Read 3896 times)

Then it was an add-on, but by default trace(1); doesn't crash you.
Actually I just found out a situation the other day where trace crashes.

If you set up an infinite recursive function call, you will lock up BL. But if you have trace on, it will instead crash very quickly because of a stack overflow. Presumably there is a limited stack trace allowed on trace() which doesn't apply to the engine in general.

You have to have a pretty preposterously large depth on your function calls, but you can indeed create a situation where BL wouldn't crash/lock-up permanently without trace, but would crash with trace.

You might want to look at MinigameSO::checkLastManStanding(%this).

You have to have a pretty preposterously large depth on your function calls, but you can indeed create a situation where BL wouldn't crash/lock-up permanently without trace, but would crash with trace.
It happens with RTB all the time. I always disconnect from RTBC before using trace.

LOL I only just now realized that no one had actually answered the question, and was about to mention checkLastManStanding.

Setting the height to 0 simply makes it at the level of the ground plane and doesn't actually make it disappear.

If not, at least you can modify the lava kill package to set the height to 0 instead of deleting the lava stuff...

It doesn't seem to, maybe the GUI itself actually sets it to 0.0001 or something like that.

there is no call back when for last man standing, you'll have to make your own code

there is no call back when for last man standing, you'll have to make your own code

No, you use this:

MinigameSO::checkLastManStanding(%this).

Then you look at what it returns. If it returns a client, that guy is the last man standing. If not, let the games continue.

No, you use this:

Then you look at what it returns. If it returns a client, that guy is the last man standing. If not, let the games continue.
I discovered that a while ago. It seems to be called every time somebody dies, you can't really make something happen when there is actually a last man standing.

I discovered that a while ago. It seems to be called every time somebody dies, you can't really make something happen when there is actually a last man standing.

Yes you can:

Then you look at what it returns. If it returns a client, that guy is the last man standing. If not, let the games continue.

So you would do something like this:
Code: [Select]
%lastMan = parent::checkLastManStanding(%this);
if(isObject(%lastMan))
     //yay

bbs

For example, which function is called when it says "Zapk is the last man standing!".
I need to know so I can make the lava disappear for my rising lava Game Mode, it would make it a lot better.
There's a variable you make when you start a minigame
Code: [Select]

new scriptObject(YourMiniMini)
{
class = miniGameSO;

brickDamage = true;
brickRespawnTime = 10000;
colorIdx = -1;

enableBuilding = true;
enablePainting = true;
enableWand = true;
fallingDamage = true;
inviteOnly = false;

points_plantBrick = 0;
points_breakBrick = 0;
points_die = 0;
points_killPlayer = 0;
points_killSelf = 0;

playerDatablock = playerNoJet;
respawnTime = 5; // <=====
So, if you have respawntime set to -1 or 0, you will have last man standing mode, if you set it to 1 or higher you will prettymuch respawn instantly with no respawntime, i use 5 and still respawn instantly.