Jump to content
Sign in to follow this  
stoppelhopser

Explosions that actually cause dammage?

Recommended Posts

hi,

gettin nuts over this... might be 2 stupid, but as far as i´ve learned if u want an explosion anywhere you do it with camcreate. but that appearently only shows an explosion but does not cause the corresponding dammage...

now how can i create an explosion anywhere, mainly in the air(!), that causes dammage?

tried everything, nothing worked... i´d like to have something like "mine" create [pos] -> mine setdammage 1 -> buuuuuum

..................

lost mad_o.gif

help? smile_o.gif

Share this post


Link to post
Share on other sites

remarks:

- i think this thread actually goes here because it is supposed to help an eventhandled script for a gun smile_o.gif

- a way to grab any "air" class target in range would do it also, but as far as i know you have to use a specific class like "Cobra"... but how the hell can u know what addons are going to come?

Share this post


Link to post
Share on other sites

My guess would be to use a base class such as plane or helicopter.. then the approaching A10, hind, cobra etc should be detected after the weapon is fired.

Share this post


Link to post
Share on other sites

Interesting there ...I've been using "createvehicle" and i get the explosion and damage... i want to say camcreate even worked for me...

I know in multiplayer only createvehicle makes the object on all computers, but camcreate is limited to the computer it was created on...so I've been told.

Share this post


Link to post
Share on other sites

thanks for the help everyone smile_o.gif

Bullz_eye_on_my_back´s comment finally gave me the idea testing my shell on "myself", ... camcreate getPos mysoldier ...

and boum, i fly through the air, dammage 1...

damn, i thought i was smart tounge_o.gif , but obviuosly i´m not tounge_o.gif  tounge_o.gif

so camcreate actually causes dammage *hehehe*. sometimes one needs a slap in the face tounge_o.gif

now here it comes: gotta find a good algorythm to make ai adjust the time for shell to explode so it comes in range of the target...

Share this post


Link to post
Share on other sites

Yeah, timing is an interesting question. I've made a proximity fuse script for AA-missiles but it hardly works. I think the should be translated to a faster assembly-like one because the sampling method is too slow (altough I can't optimize it more than this):

#ranging

_dist= _missile distance _target

?(_dist>20): goto "ranging"

goto #boom

etc.

It's the range-calculating part but it works only 1 time from 10 tries. I know that the guys who made the F/A-18 made a proximity fuse, think we have to check it.

Share this post


Link to post
Share on other sites

hmmm...i wonder if the "getpos" commands work faster than the distance script....

check and see if you can get it work better with

#range

_xd=((getpos _missle select 0)- (getpos _target select 0))^2

_yd=((getpos _missle select 1)- (getpos _target select 1))^2

_zd=((getpos _missle select 2)- (getpos _target select 2))^2

_dist= ((_xd)+(_yd)+(_zd))^0.5

~0.02

?(_dist>20): goto "range"

_missle setdamage 1

I know it takes a lot more cpu power maybe....but it could possibly be faster than the distance function? not sure....

also I think the problem is that ...the distance function only takes in the account for x, y ...not the z (could be wrong about that) So if thats the case it will blow up before it is truly 20 m away....

wink_o.gif

Share this post


Link to post
Share on other sites

hmmm, not so sure bout that. maybe works faster if you do not script that code but make it a function, just as <distance> probably is. as scripts can be interrupted in execution you have three major points of possible delay here, so it might not be faster...

also i think distance takes into account all three parameters.

to calculate a distance in a 3d-space you actually need them, or what distance would that be? z is the depth parameter. if not taken into account you´d only get a planar distance value.

my question here would be how to get the current target object of the gunner. couldn´t find any appropriate function for that... is there anything like "_target= currentTarget _gunner" ?

Share this post


Link to post
Share on other sites

I don't know if there's no way to find out which target is locked on. I check the type of the "nearestObject", leaving a couple types behind (like bullets, missiles, logic objects, etc.). Look in the scripts of the CoC Torpedoes.

Share this post


Link to post
Share on other sites

thanks for the hint!

problem here is that i have to calculate the detonation time for the shell right when it is fired. doin it by nearestObject i only get the shell itself. it might work with the torpedos, but in my testmission 22 aa-guns fire and all execute the script, so it´s gotta be fast and accurate. if i have to check all types not to take into account, it is too slow. i would have to know the target, then calculate the explo-time right away before the shell gets there...

Share this post


Link to post
Share on other sites

Like the Swiss-made AHEAD ammo, huh? I could use that wonder-script too.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×