Blockland Forums > Modification Help
Iban Explains it All
Ichverbot:
Scope and ScriptObjects should handle that.
Take a look at this for more information:
http://docs.garagegames.com/tge/official/content/documentation/Engine/Reference/classConsoleObject.html
dUMBELLS:
I may as well dump a bit of info here now that Iban is gone:
Conditionals:
A little-known technique for doing quick if-checks
--- Code: ---(<condition> ? <if true> : <if false>)
examples:
%client.chatMessage("You have" SPC %client.clamCount SPC (%client.clamCount>1 ? "clams" : "clam"));
%blah=(%use==false ? true : %use); //if %use was "bananas" then %blah would be "bananas", but if %use was false then %blah would be true
--- End code ---
"Attaching" particle emitters to objects
This is for attaching emitters to objects when it cannot be accomplished by adding it onto a datablock, which, if you can, you should do instead. Lets start by adding the actual emitter object, we'll make it the fire A emitter:
--- Code: ---%emitter=new ParticleEmitterNode()
{
dataBlock="GenericEmitterNode";
position="0 0 0";
emitter="burnEmitterA";
};
MissionCleanup.add(%emitter);
--- End code ---
This isn't going to be possible without entering the emitter into some kind of loop..
--- Code: ---%emitter.enterAttachLoop(%obj)
--- End code ---
now lets actually set up the loop method
--- Code: ---function ParticleEmitterNode::enterAttachLoop(%this,%obj)
{
//this is working off the assumption that you wont enter the emitter in more than once
//we make sure the object exists when we point to the object from the emitter
//while also making sure that the currently attached object exists
if(%this.attached!=%obj)
%this.attached=%obj;
if(!isObject(%this.attached))
return;
//setTransform moves the emitter to the position of the object
%this.setTransform(%obj.position SPC "0 0 0 0");
//this updates the emitters position, this is the part I'd imagine would be hard to find
%this.inspectPostApply();
//we repeat the function in 150 milliseconds, creating the loop
%this.schedule(150,0,"enterAttachLoop",%obj);
}
--- End code ---
jes00:
I am confused. You are not Iban.
Derroith:
--- Quote from: jes00 on November 15, 2011, 09:08:25 PM ---I am confused. You are not Iban.
--- End quote ---
Where have you been lately?
Also, Iban got banned again... Ooooo
jes00:
--- Quote from: Derroith on November 15, 2011, 09:13:57 PM ---Where have you been lately?
Also, Iban got banned again... Ooooo
--- End quote ---
But then why did Ichverbot post this if he's not Iban?