file Changing Marbles in Game: Now with Triggers

  • Explode
  • Explode's Avatar Topic Author
  • Offline
  • Advanced Marbler
  • Advanced Marbler
More
25 Aug 2012 17:46 #1 by Explode
So, this piece of code requires you to have Jeff's code changing marble in game code. Also, to use this code you must reference Lamp AND Jeff, you can use this in any mod though. And now, the code. Code://
//Marble Change Triggers by Lamp47


datablock TriggerData(MarbleSwapBigTrigger)
{
tickPeriodMS = 100;
};

function MarbleSwapBigTrigger::onEnterTrigger(%this,%trigger,%obj)
{

changeMarbleSize(BigMarbleSize);

}

function MarbleSwapBigTrigger::onLeaveTrigger(%this,%trigger,%obj)
{

changeMarbleSize(DefaultMarble);

}

//

datablock TriggerData(MarbleSwapSmallTrigger)
{
tickPeriodMS = 100;
};

function MarbleSwapSmallTrigger::onEnterTrigger(%this,%trigger,%obj)
{

changeMarbleSize(SmallMarbleSize);

}

function MarbleSwapSmallTrigger::onLeaveTrigger(%this,%trigger,%obj)
{

changeMarbleSize(DefaultMarble);

}

That code can go in any marble/server/scripts .cs file, or top of an .mis, but if you put in Trigger.cs everything seems so organized Lamp tested this code with two differently skinned marble. It works fine. You can find the portion of code from Jeff here: marbleblast.com/index.cgi?board=mbdkcode&action=display&thread=12704

~Explode

Please Log in or Create an account to join the conversation.

Moderators: AayrlKalle29Regislian