Author Topic: how do you make a brick with preset events that display text on activeate  (Read 3394 times)

I need to know how to make a preset event for a brick where it onactivate> client> centerprint
« Last Edit: August 01, 2013, 01:06:00 PM by SuperFlaminninja »

Code: [Select]
function yourBrickData::onPlant(%data, %object)
{
   %enable = 1; //Enable this event
   %msDelay = 0; //Put a delay of 0 milliseconds on this event
   %input  = "OnActivate"; //Set the input event to onActivate
   %controlling = "Self"; //Set the brick to target or control this brick itself
   %output = "disappear"; //Set the output event to disappear
   %secVar = 5; //Set the amount of seconds to disappear for (parameter one)
   %object.addEvent(%enable, %msDelay, %input, %controlling, %output, %secVar); //add the event with all our data
}

Also, the Brick_Checkpoint server.cs is a good place to look for preset events.

Code: [Select]
function yourBrickData::onPlant(%data, %object)
{
   %enable = 1; //Enable this event
   %msDelay = 0; //Put a delay of 0 milliseconds on this event
   %input  = "OnActivate"; //Set the input event to onActivate
   %controlling = "Self"; //Set the brick to target or control this brick itself
   %output = "disappear"; //Set the output event to disappear
   %secVar = 5; //Set the amount of seconds to disappear for (parameter one)
   %object.addEvent(%enable, %msDelay, %input, %controlling, %output, %secVar); //add the event with all our data
}

Also, the Brick_Checkpoint server.cs is a good place to look for preset events.
pacnet i am in love ur awesome

Code: [Select]
function yourBrickData::onPlant(%data, %object)
{
   %enable = 1; //Enable this event
   %msDelay = 0; //Put a delay of 0 milliseconds on this event
   %input  = "OnActivate"; //Set the input event to onActivate
   %controlling = "Self"; //Set the brick to target or control this brick itself
   %output = "disappear"; //Set the output event to disappear
   %secVar = 5; //Set the amount of seconds to disappear for (parameter one)
   %object.addEvent(%enable, %msDelay, %input, %controlling, %output, %secVar); //add the event with all our data
}

Also, the Brick_Checkpoint server.cs is a good place to look for preset events.
How would you do a preset event where it displays text on activeate?
« Last Edit: August 01, 2013, 01:04:12 PM by SuperFlaminninja »

How would you do a preset event where it displays text on activeate?

Code: [Select]
function yourBrickData::onPlant(%data, %object)
{
   //Event #1
   %enable = 1;
   %msDelay = 0;
   %input = "OnActivate";
   %controlling = "Client";
   %output = "CenterPrint";
   %msg = "<color:FFFFFF><font:impact:30>This is a center print message";
   %time = 5;
   %object.addEvent(%enable, %msDelay, %input, %controlling, %output, %msg, %time);

   //Event #2
   %output = "ChatMessage";
   %msg = "<color:FFFFFF><font:impact:30>This is a chat message";
   %object.addEvent(%enable, %msDelay, %input, %controlling, %output, %msg);

   //Event #3
   %output = "BottomPrint";
   %msg = "<color:FFFFFF>This is a bottom print message";
   %object.addEvent(%enable, %msDelay, %input, %controlling, %output, %msg, %time);
}

The fifth argument you pass to fxDTSBrick::addEvent is the output event. The sixth and further on are extra parameters.

In this case, you want your output event to be either a bottom print, chat message, or center print, so simply put the fifth argument as "CenterPrint", "BottomPrint", or "ChatMessage". You also want to pass the sixth argument as the text to display, so set it to what you want and pass it. For center print and bottom print, you should also specify a time, in seconds, of how long the print should last, so pass a seventh argument with the second amount. In this example, it is five.

I also demonstrated presetting multiple events, so to add more just change the values you need to change and then just call another ::addEvent.
« Last Edit: August 01, 2013, 01:35:42 PM by Pacnet2012³ »

Code: [Select]
function yourBrickData::onPlant(%data, %object)
{
   //Event #1
   %enable = 1;
   %msDelay = 0;
   %input = "OnActivate";
   %controlling = "Client";
   %output = "CenterPrint";
   %msg = "<color:FFFFFF><font:impact:30>This is a center print message";
   %time = 5;
   %object.addEvent(%enable, %msDelay, %input, %controlling, %output, %msg, %time);

   //Event #2
   %output = "ChatMessage";
   %msg = "<color:FFFFFF><font:impact:30>This is a chat message";
   %object.addEvent(%enable, %msDelay, %input, %controlling, %output, %msg);

   //Event #3
   %output = "BottomPrint";
   %msg = "<color:FFFFFF>This is a bottom print message";
   %object.addEvent(%enable, %msDelay, %input, %controlling, %output, %msg, %time);
}

The fifth argument you pass to fxDTSBrick::addEvent is the output event. The sixth and further on are extra parameters.

In this case, you want your output event to be either a bottom print, chat message, or center print, so simply put the fifth argument as "CenterPrint", "BottomPrint", or "ChatMessage". You also want to pass the sixth argument as the text to display, so set it to what you want and pass it. For center print and bottom print, you should also specify a time, in seconds, of how long the print should last, so pass a seventh argument with the second amount. In this example, it is five.

I also demonstrated presetting multiple events, so to add more just change the values you need to change and then just call another ::addEvent.
is there any thing i have to do to have 2 rows or more of events?

Code: [Select]
function yourBrickData::onPlant(%data, %object)
{
   //Event #1
   %enable = 1;
   %msDelay = 0;
   %input = "OnActivate";
   %controlling = "Client";
   %output = "CenterPrint";
   %msg = "<color:FFFFFF><font:impact:30>This is a center print message";
   %time = 5;
   %object.addEvent(%enable, %msDelay, %input, %controlling, %output, %msg, %time);

   //Event #2
   %output = "ChatMessage";
   %msg = "<color:FFFFFF><font:impact:30>This is a chat message";
   %object.addEvent(%enable, %msDelay, %input, %controlling, %output, %msg);

   //Event #3
   %output = "BottomPrint";
   %msg = "<color:FFFFFF>This is a bottom print message";
   %object.addEvent(%enable, %msDelay, %input, %controlling, %output, %msg, %time);
}

The fifth argument you pass to fxDTSBrick::addEvent is the output event. The sixth and further on are extra parameters.

In this case, you want your output event to be either a bottom print, chat message, or center print, so simply put the fifth argument as "CenterPrint", "BottomPrint", or "ChatMessage". You also want to pass the sixth argument as the text to display, so set it to what you want and pass it. For center print and bottom print, you should also specify a time, in seconds, of how long the print should last, so pass a seventh argument with the second amount. In this example, it is five.

I also demonstrated presetting multiple events, so to add more just change the values you need to change and then just call another ::addEvent.
how would i make it where there 2 rows of events?

how would i make it where there 2 rows of events?
My example shows three rows of events, just keep doing .addEvent every time you want a new one.

My example shows three rows of events, just keep doing .addEvent every time you want a new one.
im trying to make one a self event and the other a client i realy dont mean to be an idiot. So please dont rage

%object.addEvent(true, 0, "onActivate", "Self", "doSomething");

%object.addEvent(true, 0, "onActivate", "Self", "doSomething");
im trying to make a pickaxe that you hit a emerald blockland the block disapears and says emerald added

So far ive done theon pickaxe hit event and the disapear or pickaxe hit event i need to know how to make a client preset event with a self preset event i

%object.addEvent(true, 0, "onPickaxeHit", "Self", "doSomething");
%object.addEvent(true, 0, "onPickaxeHit", "Client", "doSomething");

im trying to make a pickaxe that you hit a emerald blockland the block disapears and says emerald added

So far ive done theon pickaxe hit event and the disapear or pickaxe hit event i need to know how to make a client preset event with a self preset event i

%object.addEvent(true, 0, "onPickaxeHit", "Self", "Disappear", -1);
%object.addEvent(true, 0, "onPickaxeHit", "Client", "CenterPrint", "<color:00ff00><font:impact:30>+1 Emerald");

You can make the brick appear later with

%brickObject.disappear(1);

default font is palatino linotype btw

%object.addEvent(true, 0, "onPickaxeHit", "Self", "Disappear", -1);
%object.addEvent(true, 0, "onPickaxeHit", "Client", "CenterPrint", "<color:00ff00><font:impact:30>+1 Emerald");

You can make the brick appear later with

%brickObject.disappear(1);
do i delete the script you gave me earlyer?