Author Topic: That default minigame of gamemodes  (Read 1114 times)

How do I add lives or block respawning until it's reset?

Someone plz tell me?
« Last Edit: August 12, 2012, 06:03:49 AM by Mold »

Modify gameConnection::onDeath to remove the respawning in/click to respawn message ('MsgYourSpawn') and set a flag on the client to signal that they're dead. Modify observer::onTrigger and prevent left-clicking if that flag exists. When your mini-game resets, remove all "dead" flags.

I don't get it can you explain it in a way that I understand

Btw, WTF is this
Attempting to create an angus ghost!
BackTrace: ->Player::lavaDamage->ShapeBase::Damage->armor::Damage->[VCE_Main]GameConnection::onDeath->[escapeTheLava]GameConnection::onDeath->GameConnection::InstantRespawn->GameConnection::spawnPlayer->GameConnection::createPlayer


base/server/scripts/allGameScripts.cs (11335): Unable to find object: '21292' attempting to call function 'schedule'
BackTrace: ->Player::lavaDamage


Happens every time someone dies
Sometimes the game crashes on this error

A slightly related question to the OP: Is there a correct way to modify the settings of the default minigame after it has been created?

A slightly related question to the OP: Is there a correct way to modify the settings of the default minigame after it has been created?
$defaultminigame.enablebuilding = 1;

I did this to put the player in free camera mode once he dies, it works, but causes that useless error message

Code: [Select]
function GameConnection::onDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc)
{
%playerpos = %client.player.getTransform();
//parent::onDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc);
%client.instantRespawn();
%camera = %client.camera;
%client.setControlObject(%camera);
%client.player.delete();
%camera.setTransform(%playerpos);
%client.hasEscapedThisLevel = 0;
}
function player::kill(%player)
{
%playerpos = %player.getTransform();
%client = %player.client;
//parent::kill(%player);
%client.instantRespawn();
%camera = %client.camera;
%client.setControlObject(%camera);
%client.player.delete();
%camera.setTransform(%playerpos);
%client.hasEscapedThisLevel = 0;
}
It's in a package
Someone plz tell me how to do it right

Modify gameConnection::onDeath to remove the respawning in/click to respawn message ('MsgYourSpawn') and set a flag on the client to signal that they're dead. Modify observer::onTrigger and prevent left-clicking if that flag exists. When your mini-game resets, remove all "dead" flags.
How D:

Take a look in the Slayer script, I am sure it should be lurking somewhere.

Take a look in the Slayer script, I am sure it should be lurking somewhere.
That thing is so huge D:

That thing is so huge D:
look in gamemode teamdeath match by space guy
I frequently use that as a reference, open Support_gamemodes and use the find tool to find onDeath

Code: [Select]
package package_name
{
function miniGameSO::removeMember( %this, %cl )
{
%cl.isDead = "";
parent::removeMember( %this, %cl );
}

function miniGameSO::reset( %this, %cl )
{
for ( %i = 0 ; %i < %this.numMembers ; %i++ )
{
%this.member[ %i ].isDead = "";
}

parent::reset( %this, %cl );
}

function gameConnection::createPlayer( %this, %transform )
{
%this.isDead = "";
return parent::createPlayer( %this, %transform );
}

function gameConnection::onDeath( %this, %pl, %cl, %type, %loc )
{
parent::onDeath( %this, %pl, %cl, %type, %loc );
messageClient( %this, 'MsgYourSpawn' );

%this.isDead = true;
%this.centerPrint( "\c5You are dead.", 2 );
}

function observer::onTrigger( %this, %obj, %slot, %val )
{
if ( !%obj.client.isDead )
{
return parent::onTrigger( %this, %obj, %slot, %val );
}
}
};

activatePackage( "package_name" );
« Last Edit: August 12, 2012, 12:28:52 PM by Port »


Wtf port it doesn't work.

Clix and respawn.