Jump to content
Sign in to follow this  
combat-agent

Feldish Mod Redux

Recommended Posts

I have a couple weapons that creat object on their impact zone, but when these objects hit a building or object, it crashes the game. I was wondering if anyone could help me with a work around to detect if the projectile strikes an object. The script is as follows:

;this addeventhandler ["fired",{[_this select 0,_this select 4] exec "arrow.sqs"}]

_1 = _this select 0

_2 = _this select 4

? _2 == "Arrow": _t = "Arrowg"; goto "next"

? _2 == "Speer_Ammo": _t = "Spearg"; goto "next"

exit

#next

_bullet = nearestobject [_1, _2]

#loop

~.00001

? alive _bullet: _pos = getpos _bullet; goto "loop"

_bullethole = nearestobject [_pos, "crater"]

_g = _t createvehicle _pos

_g setdir getdir _1

_bullethole setpos [0,0,0]

exit

Share this post


Link to post
Share on other sites

From what i can see, the nearestobject command is looking for a crater called "_bullethole" and then setpos it far at [0,0,0] coordinates. But in OFP there is no crater on objects or building, only on ground. So the "_bullethole setpos [0,0,0]" line crashes the comp IMO.

Share this post


Link to post
Share on other sites

Makes perfect sense, to bad the engine deals with it by crashing. Any ideas on how to detect if the projectile stikes an object?

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  

×