Page 1 of 1
Scripted explosions?
Posted: Sat Aug 27, 2016 5:04 am
by SkinnyODST
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?
Re: Scripted explosions?
Posted: Sun Aug 28, 2016 12:59 pm
by Oceans14
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.
Re: Scripted explosions?
Posted: Sun Aug 28, 2016 1:42 pm
by AQT
Alternatively, create a destructible invisible prop that explodes when destroyed. Use either:
Code: Select all
SetProperty("name_of_object_in_ze", CurHealth, 0)
SetProperty("name_of_object_in_ze", MaxHealth, 1+e37)
or
Code: Select all
KillObject("name_of_object_in_ze")
as the conclusion of your timer elapsing or whatever you want to use as your scripted event.
Re: Scripted explosions?
Posted: Sun Sep 04, 2016 3:20 am
by SkinnyODST
AQT wrote:Alternatively, create a destructible invisible prop that explodes when destroyed. Use either:
Code: Select all
SetProperty("name_of_object_in_ze", CurHealth, 0)
SetProperty("name_of_object_in_ze", MaxHealth, 1+e37)
or
Code: Select all
KillObject("name_of_object_in_ze")
as the conclusion of your timer elapsing or whatever you want to use as your scripted event.
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.
- my code:
Re: Scripted explosions?
Posted: Sun Sep 04, 2016 6:06 pm
by Marth8880
KillObject("kas2_bldg_oilrefinery") needs to go after function(timer).