OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: trinec on 09 Oct 2005, 06:54:26
-
I am trying to figure out how to create a vehicle explosion script that uses the drop array and were the explosion will kill anything within a certain radius of the explosion. Will I have too use camcreate to create the explosion ? Trying to make it look realistic as possible its suppose to be a bus with bomb on it when the bus reaches a certain location it explodes and kills anything within a certain radius of the explosion. I figure calling a script from the waypoint that its suppose to explode from would work.
Any help would be appricated
Trinec
-
is this good?
if you want i can quikly add some drop particles to make a better looking explosion.
-
nevermind, here is one with a special explosion,
thanks to the xcam system.
-
lol, and incase you decide you want to use a suicide bomber with a backpack, insted of a bus here is this too.
you will have to switch the guy for a guy carying a backpack though. if you have trouble just let me know.
-
wow thats one large explosion throws some civilians over the roofs of buildings hmm ill have to figure out which of the zillion options in this to make it not so strong or guess i could dl the xcam stuff and find out hehe.
[b1,1,200,50,100,10,30,2,1.8,10,1.8,200,1.3,5,10,15,4,[5,5],0] exec "explosion2.sqs"
have you tried messing with this at all penguinman and it seems like the bus goes away after the explosion and then comes back again kinda wierd. Wonder if there is a way to make the bus lift up a little during the explosion only a few feet Ive seen a bus launched to the moon before in ofp wouldnt want it to go that far up..
thanks though for the link
-
hi guys i havent seen the script as my internet computer isnt the same one as my ofp anymore :( no mp for me until i sort out me wireless connex.
I don't know if this is going to help in any way but have you tried just using a trigger at the bus location (put over maybe a waypoint)
With 'on activation' of the trigger:
grenade = "(pick the shell type from comref)" camcreate [getpos busname, select 0, getpos busname select 1, 0]
you can use things like laserguidedbomb for a massive explosion (prob too big) heat125, shell 105 etc.
The last number in that chain is the height that the shell will appear/explode so you can vary that number (i think its in metres) for different effects.
Or even use the activation:
busname setdammage 4 then it will explode itself and use the game physics to determine who dies in the radius.
Sorry if its a bit newbie-ish but i've never really had much chance to get on with learning scripting and prefer using triggers as I can understand some of it. the only prob is that it doesnt open many possibilities for my own mission making at the moment.
good luck with it all most of the guys here are ridiculously clever at this sort of thing, so you're in the right hands.
-
ya I did the trigger thing, thanks though.
have you tried messing with this at all penguinman and it seems like the bus goes away after the explosion and then comes back again kinda wierd. Wonder if there is a way to make the bus lift up a little during the explosion only a few feet Ive seen a bus launched to the moon before in ofp wouldnt want it to go that far up..
thats y I did that, I had to create a new bus at the old ones position other wise it would fly hundreds of feet. I also tried a hold in position script but that still made the bus go a few feet up in the air so I made a new bus. you can see it in the mission editor screen near the bottom of lipany. I hope it solves your problem, You can just merge that, to your mission, and delete the people if you want or somthing. if you have trouble with that you can just email your mission and I'l put an exploding bus in it for you.
have you checked out the suicide bomber, if you want I can make his bomb smaller then the bus one.
good luck with it :)
-
It's working fine the exploding bus I was trying to figure out if their is a way to make the radius of the explosion kill farther out then it does I think i know how to change how far out away from the bus the explosion effect shows but it doesnt do any dammage other then if your in the bus or really close too it. I have it set to do the grenade explosion which doesnt launch the people over other buildings hehe.
-
if you want a good explosion that doesn't launch people away, try a heat (less powerful) and if not that then put a shell120 10 meters underground and have your grenade eplosion on top still for looks
as for killing radius, just make a trigger thats is the size you want for the killing radius, set to anyone present, and put it out over the ocean
then setpos it to the bus when you make it blow, and kill everyone in the trigger
-
Thanks triggerhappy that did it for me the part of setpos the trigger anyone know if their is a way to simulate the explosion knocking things over like from the blast example would be a table falling over chairs falling over or even a person getting knocked backwards but not killed.
-
give the trigger a name, lets say trig1
in the trigger, put:
{[_x,trig1] exec "blownaway.sqs"} foreach thislist
in the on activation field
_unit =_this select 0
_trig = _this select 1
_d = _unit distance _trig
_a = (getpos _trig select 0) - (getpos _unit select 0)
;some trig to find the angle to blow em off at(reassign _a as angle to save variables)
_a = acos(_a/_d)
#defines
;decide these values through some testing, or perhaps figure out an equation to plug into that will give you good results. also, maybe do a type check and minimize speed for vehicles...
? _d >= (some number):_speed = (some speed (in m/s)
;if done like this - rinse, repeat. an equation you'd only need once, anywho...
;tadaa! no more friction
_unit setpos [getpos _unit select 0,getpos _unit select 1,.2]
;shove off!
_unit setvelocity [_speed * sin(_a),_speed * cos(_a), .7]
;again test for the right value for the last value in setvelocity (.7) - I'm guessing :P