Jump to content
Sign in to follow this  
kerosene

Whats wrong with this script?

Recommended Posts

I have this script, that is mostly to time speeches to stuff happening:

[p, ff1, ff2, ff3, r1, r2] allowGetIn true

~2

CutText ["Rebels are attacking the town, please help!", "PLAIN Down", 2]

~3

[Resistance,"HQ"] sideChat  "Base, im getting reports of fighting in Lorengau, please advise."

Fadr SetBehaviour Safe

FAdr SetSpeedMode full

[ff1] join fflg

[ff2] join fflg

[ff3] join fflg

~2

If (faDr distance p >40) then {faDr DoMove GetPos P}

~50

If (faDr distance p >40) then {faDr DoMove GetPos P}

~40

If (faDr distance p >40) then {faDr DoMove GetPos P}

~10

If (faDr distance p >25) then {faDr DoMove GetPos P}

~10

If (faDr distance p >25) then {faDr DoMove GetPos P}

If (faDr distance p <20) then {[r1,r2,r3,r4] join p}

~2

If (faDr distance p <20) then {[Resistance,"HQ"] sideChat "Board the APC and move to the perimeter of town"}

---

This is where it stops working, FaDr, which is an APC just sits there when its supposed to move to ma1 an invisible Helipad , is the line I put in the If statement correct? also p is the player.

If (p in faDr) then {faDr DoMove GetPos ma1}

---

If (faDr distance Ma1 <15) then {faDr sideChat "This is as far as we go, secure the site and we'll move up"}

Exit

Share this post


Link to post
Share on other sites

Keep an eye on uppercase/lowercase writing of the variables. Also it should be

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">... setBehaviour "SAFE"

... setSpeedMode "FULL"

Share this post


Link to post
Share on other sites

I made the changes above, but im still having problems:

If (p in faDr) then {faDr DoMove GetPos ma1}

I tested this line on its own and its defiatley the problem, what do i need to put in the IF statement to make the APC (fadr) move to the object named ma1 once p (the player) has boarded?

I also tried: If (p in faDr true) then {faDr DoMove GetPos ma1}

but htat didnt work either

I would use waypoints, but i dont know where the player will be exactly when the apc is called and i need to do the same thing later in the misson.

This must be do-able.

Share this post


Link to post
Share on other sites

fadr in crew APC

might work better

also

vehicle fadr==apc

Share this post


Link to post
Share on other sites

Fadr is an apc from the misson editor with the crew automatically assigned. The problem im haveing is that once FADr arrives at the players (p) pos it dosent go anywhere else. P is supposed to board the vehicle as cargo and then FaDr travels to the object named ma1.

How do i make the AI detect that P has boarded and that FaDr can now move to object ma1?

Share this post


Link to post
Share on other sites

Sorry, i dont totally get it, where should i insert that?  also 'p' is the one that I need to detect and he gets in the cargo position.  

I think my mistake is that I need to use @condition instead of an If then statement,  I didnt reliese they couldnt be held until a certain condition had been met.

If I use @ p in FaDr how do i stucture the next part telling it what to do at that condition, is it something like this:

@ p in FaDr: FaDr DoMove ma1

I did it! I needed this

fadr doMove getpos P

@p in FaDr

faDr doMove getpos ma1

Share this post


Link to post
Share on other sites
Quote[/b] ]If (p in(crew faDr)) then {faDr DoMove GetPos ma1}

And you can try the other version.

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  

×