Home   Help Search Login Register  

Author Topic: Is this script correct?  (Read 578 times)

0 Members and 1 Guest are viewing this topic.

edeniaz

  • Guest
Is this script correct?
« 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

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Is this script correct?
« Reply #1 on: 23 Aug 2004, 13:48:55 »
How do you know it doesn't work?   What happens/doesn't happen?     Give us an example of how you call the script.
Plenty of reviewed ArmA missions for you to play

edeniaz

  • Guest
Re:Is this script correct?
« Reply #2 on: 23 Aug 2004, 14:15:32 »
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.


edeniaz

  • Guest
Re:Is this script correct?
« Reply #3 on: 23 Aug 2004, 14:17:18 »
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

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Is this script correct?
« Reply #4 on: 23 Aug 2004, 15:59:11 »
Quote
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...
« Last Edit: 23 Aug 2004, 16:04:42 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Is this script correct?
« Reply #5 on: 23 Aug 2004, 17:32:12 »
and then theres the problem that you cant target/fire at logics. Use the invisible target addon that is somewhere in the addons.

Tyger
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08