Jump to content
Sign in to follow this  
Bren the ruler

Whats wrong with this script?

Recommended Posts

Can anyone help me please , Thanks.

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

;detect.sqs

_player = _this select 0

_group = _this select 1

_state = _this select 2

_time = _this select 3

? _group knowsabout _player : goto "loop"

_i = 1

#loop

_i = _i + 1

_group setbehaviour _state

_group domove(getpos _player)

? _i == _time : goto "end"

~1

goto "loop"

#end

EXIT

<span id='postcolor'>

Share this post


Link to post
Share on other sites

You should add some backround about this script so people can know what it shoud do. But I read about your problem in another threat so I can try to help you.

execute script by : [unit,group,"behaviour",timeInSeconds] exec "detect.sqs"

(example : [player,Eastgroup1,"combat",360] exec "detect.sqs")

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

;detect.sqs

_player = _this select 0

_group = _this select 1

_state = _this select 2

_time1 = _this select 3

@(leader _group) knowsabout _player >=2

_i = _time

_group setbehaviour _state

#loop

_group move (getpos _player)

~1

? (_i + _time1) < _time:goto "loop"

EXIT

<span id='postcolor'>

When leader of group(Eastgroup1) detect unit(player) he, with his group, will follow unit for timeInSecond(360s=6minutes) lenght of rime in "behaviour"("combat") behaviour.

After time group will go back to their original waypoints path.

time and _time are reserved variables.

time returns time in second from start of mission

and _time returns time from start of script inside script

Share this post


Link to post
Share on other sites

hey thanks,

im only new to scripting just started in fact.

its so much easier to do everything outside of ofp

it saves hours,

brendan

Share this post


Link to post
Share on other sites

I also made a flak script :

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

; flak.sqs

; by brendan

_explosion = _this select 0

_unit = _this select 1

_time1 = _this select 2

_time2 = _this select 3

_rounds = _this select 5

_ammo = _this select 6

_a = 1

#loop1

goto "timer"

#timer

_i = 0

~_time1

goto "loop"

#loop

_i = _i + 1

_a = a + 1

_bang = _explosion camcreate getpos _unit

~_time2

Fuze = "FxExploGround1" camcreate getpos _bang

? _a == _ammo : goto "end1"

? not alive( _unit) : goto "end1"

? _i == _rounds : goto "timer"

goto "loop"

#end1

EXIT

<span id='postcolor'>

it works fine but when the boms are created i want them to be destroyed at watever time i set it to,that works fine until you put it to like, 5 seconds and the bobms come out every 5 seconds . i know why but is there a way to run 2 parts of the script at the same time instead of one loop delaying the time to camcreate the bombs because the first one needs to blow up,

thnka in advance

brendan

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  

×