Blockland Forums > Modification Help

Brick setShapeName script

Pages: << < (2/9) > >>

Furling:


--- Quote from: lilboarder32 on August 19, 2010, 08:10:14 PM ---Your packaging the function Brick::setShapeName(%this)

It should be fxDtsBrick::setShapeName(%this)


Edit2: The syntax error you're getting is right at the opening brackets just after you call the Parent function. Probably just remove the inner set of brackets in your first function and make sure to change Brick to fxDtsBrick. Also, you're not ending the package or activating it.

--- End quote ---

how I could missed (%this)
 and as for your edit2, part I not understand your english... I should make activating and end packing like this package Event_BrickMessage same both ?

Edit: which I put in fxDtsBrick::setShapeName(%this) where ?

Edit2: I found line 10 is }


--- Code: --- registerInputEvent(fxDtsBrick,"onBrick","tBrick Brick");
registerOutputEvent(Brick,"setShapeName","string 25 50",0);
registerOutputEvent(Brick,"setShapeNameColor","paintColor 1",0);
registerOutputEvent(Brick,"setShapeNameDistance","int 0 3000 300",0);
package Event_BrickMessage
{
function fxDtsBrick::setShapeName(%this)
{
Parent::setShapeName(%Brick);
{
$inputTarget_Brick = (%Brick);
} <~~Here.
}

function Brick::setShapeNameColor(%Brick,%color,%client)
{
if(getWordCount(%color) == 1)
{
Parent::setShapeNameColor(%Brick,getColorIDTable(%color));
}
else
{
Parent::setShapeNameColor(%Brick,%color);
}
}

--- End code ---
Some error context, with ## on sides of error halt:


--- Code: ---package Event_BrickMessage

{

^function fxDtsBrick::setShapeName(%this)

^{

^^Parent::setShapeName(%Brick);

^^{##
##
^^^$inputTarget_Brick = (%Brick);

^^}

^}


--- End code ---

I fix this edit script:

--- Code: ---registerInputEvent(fxDtsBrick,"OnBrick","tBrickMessage BrickMessage");
registerOutputEvent(Brick,"setShapeName","string 25 50",0);
registerOutputEvent(Brick,"setShapeNameColor","paintColor 1",0);
registerOutputEvent(Brick,"setShapeNameDistance","int 0 3000 300",0);
package Event_BrickMessage

function fxDtsBrick::setShapeName(%this)
{
Parent::setShapeName(%this);
{
$inputTarget_Brick = (%this);
%this.processInputEvent("OnBrick",%this);
}
}

function Brick::setShapeNameColor(%Brick,%color,%client)
{
if(getWordCount(%color) == 1)
{
Parent::setShapeNameColor(%Brick,getColorIDTable(%color));
}
else
{
Parent::setShapeNameColor(%Brick,%color);
}
}

--- End code ---


Crysist:

You need one last curly brace at the end

Headcrab Zombie:

Yeah, I just checked, there is no fxDTSBrick::setShapeName method.
Meaning this won't work. Something like this would have to be implemented to the engine, which I doubt Badspot would do, since we have print bricks.

Furling:


--- Quote from: Crysist on August 19, 2010, 09:22:52 PM ---You need one last curly brace at the end

--- End quote ---
still failed, I did add it.
Edit: I removed 2 of curly brace start and end, now there new error:


--- Code: ---Add-Ons/Event_BrickMessage/server.cs Line: 7 - Syntax error.
>>> Some error context, with ## on sides of error halt:
egisterInputEvent(fxDtsBrick,"OnBrick","tBrickMessage BrickMessage");

registerOutputEvent(Brick,"setShapeName","string 25 50",0);

registerOutputEvent(Brick,"setShapeNameColor","paintColor 1",0);

registerOutputEvent(Brick,"setShapeNameDistance","int 0 3000 300",0);

package Event_BrickMessage



^function ##f##xDtsBrick::setShapeName(%this) <~~Here, same Brick or fxDtsBrick both are not work, i have tested both.

^{

^^Parent::setShapeName(%this);

^^{

^^^$inputTarget_Brick = (%this);

^^^%this.processInputEvent("OnBrick",%this);

^^}

^}



^function Brick::setShapeNameColor(%Brick,%color,%client)

^{

^^if(getWordCount(%color) == 1)
>>> Error report complete.
--- End code ---


Destiny/Zack0Wack0:

Hint: create a static shape with a name at the brick's position.

Pages: << < (2/9) > >>

Go to full version