Blockland Forums > Modification Help
Pre Events
otto-san:
--- Quote from: jes00 on June 30, 2011, 07:06:47 AM ---Can I have multiple OnPlant functions? or should they be OnPlantTwo and OnPlantThree ect
--- End quote ---
no
why would you need more than one
jes00:
--- Quote from: otto-san on June 30, 2011, 12:15:12 PM ---no
why would you need more than one
--- End quote ---
To have multiple lines of events.
otto-san:
--- Quote from: jes00 on June 30, 2011, 12:39:47 PM ---To have multiple lines of events.
--- End quote ---
then repeat that part in the onPlant, silly.
jes00:
--- Quote from: otto-san on June 30, 2011, 12:40:58 PM ---then repeat that part in the onPlant, silly.
--- End quote ---
How would that work?
Like this?
--- Code: ---function brickCheckpointData::onPlant(%data, %obj)
{
%obj.enableTouch = true;
%enabled = 1;
%delay = 0;
%inputEvent = "OnPlayerTouch";
%target = "Self";
%outputEvent = "PlaySound";
%par1 = Beep_Popup_Sound.getId();
%obj.addEvent(%enabled, %delay, %inputEvent, %target, %outputEvent, %par1);
%obj.enableTouch = true;
%enabled = 1;
%delay = 0;
%inputEvent = "OnPlayerTouch";
%target = "Client";
%outputEvent = "ChatMessage";
%par1 = I love pigs!();
%obj.addEvent(%enabled, %delay, %inputEvent, %target, %outputEvent, %par1);
}
function brickCheckpointData::onLoadPlant(%data, %obj)
{
Parent::onLoadPlant(%data, %obj);
%obj.enableTouch = true;
}
--- End code ---
otto-san:
Basically, even though there are errors in there.