Author Topic: Brick setShapeName script  (Read 3424 times)

This should fix your syntax errors:
Code: [Select]
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);
    }
  }

but then listen to the others about how to accomplish what you really want to do.

This should fix your syntax errors:
Nope. There's still brackets missing for the package


Also, since none of the fxDTSBrick::setShapeName* methods exists, you don't need a package for them.

Push enter after the las line and put } that might fix it

not worry about }

Right now I need know more about StaticShape how it was made ?

something like this, i believe..


new TSStatic(thisname)
{
   shapename =something.shapefile;
};

something like this, i believe..


new TSStatic(thisname)
{
   shapename =something.shapefile;
};

it would make this:

Code: [Select]

new TSStatic(setShapeName)
{
shapename =setShapeName.shapefile;
};
???? you did read whole this topic about setShapeName ?

TSStatics don't have a setShapeName method, that's why I didn't suggest this method earlier on, I tested it out on a TSstatic on accident instead of a StaticShape

Code: [Select]
datablock StaticShapeData(emptyShape) //assuming there isnt one already
{
    shapeFile = "base/data/shapes/empty.dts";
}

function fxDTSBrick::setShapeName(%this,name)
{
    //stuff

    %this.nameShape = new StaticShape()
    {
        datablock = emptyShape; //or name of preexisting one, if there is one
    };

    //stuff
}

TSStatics don't have a setShapeName method, that's why I didn't suggest this method earlier on, I tested it out on a TSstatic on accident instead of a StaticShape

Code: [Select]
datablock StaticShapeData(emptyShape) //assuming there isnt one already
{
    shapeFile = "base/data/shapes/empty.dts";
}

function fxDTSBrick::setShapeName(%this,name)
{
    //stuff

    %this.nameShape = new StaticShape()
    {
        datablock = emptyShape; //or name of preexisting one, if there is one
    };

    //stuff
}
I copy this and it say:

Code: [Select]
datablock StaticShapeData(emptyShape) //assuming there isnt one already still error:
Quote
datablock ##S##taticShapeData(emptyShape) //assuming there isnt one already

That would be a problem with something of yours, before the datablock's definition

That would be a problem with something of yours, before the datablock's definition
how I am going fix it ?

I'd just delete what you have, except the registerOutputEvents and what I gave you, and start over, there's really nothing you need from the packages as you'll have to create the functions yourself.

I'd just delete what you have, except the registerOutputEvents and what I gave you, and start over, there's really nothing you need from the packages as you'll have to create the functions yourself.
well. If you can make one, I give you a credit for that. I really need that script, many thanks.

If anyone can create this script goes to credit and I put this topic lock.
« Last Edit: August 25, 2010, 05:29:12 PM by Furling »

Hello Syntax,
                      can you make script this brick setshapename, please ? I really need it so bad. here event list.
1. setShapeName
2.setShapeNameColor
3.setShapeNameDistance
4.setShapeNameFont
5.SetShapeNameFontsize
6.ShadowSize
7.ShadowColor

When you finish create a script then you will post in rtb, please ? not in forum blockland.
Noted: This is my request, I not want more post add other topic in Suggestions & Requests, Many thank!!!

I actually made it already for my own server, but I don't know if I should release it

To remove the message, you have to change the event to have no message, and activate the event again, or destroy the bricks. I don't think events is the best way to do this.
fxDTSBrick::setShapeName was blocked from being declared, I had to rename it to something, which suggest that Badspot doesn't want something like this

Also I don't think events 4-7 would be possible. You could try using a font tag for 4 and 5, but if that won't work, it wouldn't be possible.