OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Tenchu on 20 Jan 2003, 17:33:42

Title: bomb1 = "grenade" camCreate getpos ???
Post by: Tenchu on 20 Jan 2003, 17:33:42
If I had this in a script

bomb1 = "grenade" camCreate getpos target

how would i make it explode 3 metres behind the target

Thanks ;D
Title: Re:bomb1 = "grenade" camCreate getpos ???
Post by: Artak on 20 Jan 2003, 17:43:49
bomb1 = "grenade" camCreate [(getpos target select 0) -3,(getpos target select1),(getpos target select 2)]

try that one
Title: Re:bomb1 = "grenade" camCreate getpos ???
Post by: Skumball on 21 Jan 2003, 14:32:09
To get it to always explode behind the target you would need to work it out by using getDir and all sorts of other mathematical stuff that I don't understand  :-\ You could also do it as mentioned above, although if the unit is facing north, that line will create the bomb 3 metres to the left  ;)
Title: Re:bomb1 = "grenade" camCreate getpos ???
Post by: Tenchu on 22 Jan 2003, 14:22:11
Thanks guys  ;D

Artak's solution is what i was looking for.

It does not need to explode behind the target, just near enough to damage it and make the player duck lol  ;D

"all sorts of other mathematical stuff that I don't understand" me neither lol

Thanks again