Author Topic: Brick questions  (Read 1210 times)

I have various questions about how to use bricks from a script.

  • How do you make it so that a vehicle doesn't respawn after the vehicle's death?
  • How do you add an event to a brick?
  • How do you clear the events from a brick?
  • How do you add an event to a brick?
  • How do you set if an event is enabled for a brick?

I did a console dump on the FxDTSbrick class, but it didn't help, as none of the listed functions came with any arguments.

I have various questions about how to use bricks from a script.

  • How do you make it so that a vehicle doesn't respawn after the vehicle's death?
  • How do you add an event to a brick?
  • How do you clear the events from a brick?
  • How do you add an event to a brick?
  • How do you set if an event is enabled for a brick?

I did a console dump on the FxDTSbrick class, but it didn't help, as none of the listed functions came with any arguments.
wat

wat
Do not make posts like this in Coding Help.

Add event to brick: (source: Brick_CheckPoint)
Code: [Select]
   %enabled     = 1;
   %delay       = 0;
   %inputEvent  = "OnPlayerTouch";
   %target      = "Self";
   %outputEvent = "PlaySound";
   %par1        = Beep_Popup_Sound.getId();
   %brick.addEvent(%enabled, %delay, %inputEvent, %target, %outputEvent, %par1, %par2, %par3, %par4);

The other stuff:
You can easily find this out by using the dump() method.
Code: [Select]
brickgroup_999999.getObject(0).dump(); //plant a brick, add events to it, and then run this codeThere are fields for all of the event properties (enabled, etc). There is also a %brick.clearEvents() method.

But homake a vehicle not respawn after it dies?

But homake a vehicle not respawn after it dies?
look at rotondo's l4b
it has zombie respawn catching stuff
you can also look at onVehicleRespawn event code and parent that function

Code: [Select]
brickgroup_999999.getObject(0).dump(); //plant a brick, add events to it, and then run this code
I feel like mentioning that this code will only work in Single Player.

A more universal version would be thus:
Code: [Select]
mainBrickGroup.getObject(0).getObject(0).dump();

But how do you make a vehicle not respawn after it dies?
Edit: Phone typing issue

Package vehicleRespawn or whatever the function is, and just return before the parent::stuff. Look into packages and parenting, im pretty sure theres a sticky for it.

Package vehicleRespawn or whatever the function is, and just return before the parent::stuff. Look into packages and parenting, im pretty sure theres a sticky for it.
I know how to use packages and parenting, but I don't want to overwrite the function.
EDIT: I don't need to know how to respawn vehicles anymore. I was planning to create a zombie defense gamemode with waves. Zombies should not respawn after they die; instead, they will spawn with the next wave.
But now I've decided to use hole bots instead of the not-very-intellgient bots of Event_Bots. So I don't need help anymore.