Scripted explosions?
Moderator: Moderators
-
SkinnyODST
- Lieutenant Colonel

- Posts: 545
- Joined: Mon Jul 04, 2016 10:56 pm
- Location: My other account
- Contact:
Scripted explosions?
Am I able to script a small explosion to happen in a certain spot on the map that only explodes once then stops? Kind of like a timer but with a grenade explosion or something. If so how?
- Oceans14
- Command Sergeant Major

- Posts: 296
- Joined: Mon Apr 27, 2015 7:09 pm
- Projects :: Athenova Campaign
- Location: Planet 4546b
Re: Scripted explosions?
Sure you can. Set the odf up like the kashyyyk beach explosion, place it where you want it in ZE, and then in your script add the line ActivateObject("NAME"). You could put that line in several different places depending on the desired behavior (on enter region, on timer elapse, on objective complete, etc). As for getting it to go once and then stop, play around with the values in the explosion odf. I don't recall but I think one of them dictates how often the effect is played.
-
AQT
- Gametoast Staff

- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: Scripted explosions?
Alternatively, create a destructible invisible prop that explodes when destroyed. Use either:
or
as the conclusion of your timer elapsing or whatever you want to use as your scripted event.
Code: Select all
SetProperty("name_of_object_in_ze", CurHealth, 0)
SetProperty("name_of_object_in_ze", MaxHealth, 1+e37)Code: Select all
KillObject("name_of_object_in_ze")-
SkinnyODST
- Lieutenant Colonel

- Posts: 545
- Joined: Mon Jul 04, 2016 10:56 pm
- Location: My other account
- Contact:
Re: Scripted explosions?
Where do I put the timer in the lua? Can you give an example of how it looks in the lua, as well as telling me how to make an object invisible? I just put it after "function ScriptPostLoad()" and it can`t read the lua right.AQT wrote:Alternatively, create a destructible invisible prop that explodes when destroyed. Use either:orCode: Select all
SetProperty("name_of_object_in_ze", CurHealth, 0) SetProperty("name_of_object_in_ze", MaxHealth, 1+e37)as the conclusion of your timer elapsing or whatever you want to use as your scripted event.Code: Select all
KillObject("name_of_object_in_ze")
- my code:
Hidden/Spoiler:
-
Marth8880
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: Scripted explosions?
KillObject("kas2_bldg_oilrefinery") needs to go after function(timer).
