Home   Help Search Login Register  

Author Topic: scumballs hunted sqs  (Read 590 times)

0 Members and 1 Guest are viewing this topic.

Thanatos

  • Guest
scumballs hunted sqs
« on: 06 Nov 2005, 10:03:34 »
have been trying to incorperate scumballs hunbted sqs from editors dep into a mission im making  the script is just what im looking for however  i have a problem

the script is called at the very start of the mission by listing all units in trig01  what i want is for the mission to start  and the trigger to be called at a later time..  the readme tells me that if there are no units present in the trigger to keep looping until there are  how do i do this  here is the script

; Hunted 1.01
; an OFP script by Skumball (simongoddard4@yahoo.co.uk)
; see huntedReadme.txt for details

_knows = 0.8
_shareDist = 20
_areaMax = 50
_areaMid = 20
_areaMin = 0

_hunted = _this select 0

#reset
~1
_all = list trig01
? (count _all) == 0 : goto {reset}
_aware = []
_unaware = []

_i = 0
#check
~0.01
? (((_all select _i) knowsAbout _hunted) >= _knows) && !((_all select _i) in _aware) : _aware = _aware + [_all select _i]
? (((_all select _i) knowsAbout _hunted) < _knows) && !((_all select _i) in _unaware) : _unaware = _unaware + [_all select _i]
_i = _i + 1
? _i <= (count _all) : goto {check}
? (count _aware) == 0 : goto {reset}
? (count _unaware) == 0 : goto {seek1}

_i = 0
#share1
_k = 0
#share2
~0.01
? ((_aware select _i) distance (_unaware select _k)) <= _shareDist : (_unaware select _k) reveal _hunted
_k = _k + 1
? _k < (count _unaware) : goto {share2}
_i = _i + 1
? _i < (count _aware) : goto {share1}

#seek1
_i = 0
#seek2
~0.1
? ((_aware select _i) knowsAbout _hunted) >= _knows : _area = _areaMax
? ((_aware select _i) knowsAbout _hunted) >= 2.0 : _area = _areaMid
? ((_aware select _i) knowsAbout _hunted) >= 3.5 : _area = _areaMin
? unitReady (_aware select _i) : (_aware select _i) doMove [((getPos _hunted) select 0) + ((random _area) - (_area / 2)), ((getPos _hunted) select 1) + ((random _area) - (_area / 2))]
_i = _i + 1
? _i < (count _aware) : goto {seek2}

goto {reset}


ive tried contacting the author  but to no avail

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:scumballs hunted sqs
« Reply #1 on: 06 Nov 2005, 10:51:07 »
I have quickly skimmed this.  To answer your specific questions:

Looping:
The script is already doing this.  The relevant lines are:
Code: [Select]
#reset
~1
_all = list trig01
? (count _all) == 0 : goto {reset}
The script will loop while there are no units in the trigger list.

To make a trigger active at some later time there are several options.  A few are listed below:
1. Put something like this as the first line of the script:
Code: [Select]
@ OKtoGoand somewhere in your mission when you want the script to start put:
Code: [Select]
OKtoGo = trueI also always tell people not to forget to initialise their variables at the start of the mission so:
Code: [Select]
OKtoGo = falseBut that is not necessary here.

2. If you don't want to mess with the script (but I think you should for the reason I explain below) you could change the condition field of the trigger from
Quote
this
to
Quote
this and OKtoGo
(with all the same comments about OKtoGo as in 1.)

3. Have the trigger way out to sea and when you want to activate it move it to where you want it to be using setPos


The reason I only skimmed the script is I found a serious error in it at the start.  It is this line:
Code: [Select]
_knows = 0.8
This value is used later with a 'knowsabout' instruction.  In v 1.46 of Flashpoint this may have been fine.  For later versions the value should be closer to 0.105.

See:
http://www.ofpec.com/editors/comref.php?letter=K#knowsAbout
and particularly the comments.  

My suggestion is that you use other people's scripts as a way of learning about scripting - then write your own.
« Last Edit: 06 Nov 2005, 11:35:27 by THobson »

Thanatos

  • Guest
Re:scumballs hunted sqs
« Reply #2 on: 06 Nov 2005, 11:00:28 »
thanx for youre fast reponse THobson

ill give it a try

 :)

nice one

Thanatos

  • Guest
Re:scumballs hunted sqs
« Reply #3 on: 06 Nov 2005, 19:00:08 »
THobson  youre advice was spot on
have tweaked  the script  and the condition field of trigger... all is good...

 thanks
              thanatos