file Changing Marbles in Game: Now with Triggers

  • Explode
  • Explode's Avatar Topic Author
  • Offline
  • Advanced Marbler
  • Advanced Marbler
  • Posts: 219
  • Thank you received: 1
25 Aug 2012 17:46 #1
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...display&thread=12704

~Explode

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

Moderators: Doomblah
Time to create page: 1.111 seconds
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.