OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: edeniaz on 23 Aug 2004, 13:22:02
-
Sorry ;D I'm beginner of making missions. It's not my script. I found some kind of flak script that bomb explosive around flying target randomly. (It's really looks like Flak!)
And I wish to modify this a real flak88 named 'flak1' shot around flying target randomly. but It's not work. I don't know where is wrong.
Help me plz~
;example
;[150,blackhawk,log1,10] exec "flak.sqs"
_area = _this select 0
_target = _this select 1
_logic = _this select 2
_timeleft = _this select 3
#loop
_timeleft = _timeleft - 1
_where = getpos _target
_logic setpos [(_where select 0) - random _area + random _area, (_where select 1) - random _area + random _area]
flak1 doFire getpos _logic
~random 2.5
;you can change the condition below the end
? (alive _target) && (_timeleft > 0) : goto "loop"
exit
-
How do you know it doesn't work? What happens/doesn't happen? Give us an example of how you call the script.
-
oops. sorry. yes. I tried this script and got error message...
'flak1 doFire getPos _logic|#|': Error doFire: Type Array, expected object'
I tried [500,c47,log1,60] exec "flak.sqs" on c47 (this is target) init field.
-
And here is original script that made by Pica.
;
;Created by Pica
;
;Modified by Loc-Dog, it now works on a timer!
;
;area of flak around target
;random height of flak
;target aircraft
;game logic name
;ammo to use
;timer
;
;example
;[150,10,blackhawk,log1,"shell73",10] exec "flak.sqs"
_area = _this select 0
_height = _this select 1
_target = _this select 2
_logic = _this select 3
_ord = _this select 4
_timeleft = _this select 5
#loop
_timeleft = _timeleft - 1
_where = getpos _target
_logic setpos [(_where select 0) - random _area + random _area, (_where select 1) - random _area + random _area, (_where select 2) + random _height +10]
_bomb = _ord camcreate getpos _logic
_bomb = _ord camcreate getpos _logic
~random 2.5
;you can change the condition below the end
? (alive _target) && (_timeleft > 0) : goto "loop"
exit
-
flak1 doFire getpos _logic
This is what's crapping there...
doFire needs an object, not a position...
flak1 doFire _logic should work...
EDIT:
Oh, and you probably need flak1 doTarget _logic before that doFire thingy...
-
and then theres the problem that you cant target/fire at logics. Use the invisible target addon that is somewhere in the addons.
Tyger