Home   Help Search Login Register  

Author Topic: One last problem...  (Read 545 times)

0 Members and 1 Guest are viewing this topic.

Ade

  • Guest
One last problem...
« on: 25 Jan 2004, 23:55:22 »
I have a problem with a script in my mission (below).

It is meant to make the enemy (one squad of 9 plus 8 assorted sentries in ones and twos) retreat in the event of taking ten or so casualties.  Then a helo from your side is called in to track them to their base while you search the site of the battle.

It works, almost  >:(.

The sideChats after the line' "3" objStatus "Done" ' display three times and I have no idea why - can anyone help?  Once fixed I can put the mission up for beta testing.

Ade

SCRIPT

;Script to make the special forces leg it if they start taking heavy casualties
;Col Stankovic will send a recon helo to locate the survivors
;Mark objective complete if player has killed most enemies and is within the camp

#checkNumbers


if (West CountSide ade_sf_array <7) then {goto "Retreat"}

goto "checkNumbers"

#Retreat

;should make some of the survivors defend and the others run, a kind of messy fighting retreat

adeambush1 setCombatMode "GREEN"

adeambush1 setSpeedMode "FULL"

"_x doMove getpos rallyPoint" forEach ade_sf_array

~1

"3" objStatus "DONE"

obj3=true

player sideChat "HQ, enemy is falling back. Please advise"

~4

Stankovic sideChat "Alpha Black, I'm dispatching a recon helo.  He'll search near you and will try to locate the enemy hideout. If he finds it, proceed there and mop up any survivors."

~6

defeat = 1

adehelo flyInHeight 75
adehelo setSpeedMode "FULL"

adehelo sideChat "This is Eagle Eye 1. En route now. ETA 2 minutes."

hintCadet "Wait for the helicopter pilot to report back."

exit

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:One last problem...
« Reply #1 on: 26 Jan 2004, 00:05:53 »
The checknumbers loop should have a delay in it

~1

or something.  Does the script work ok apart from that?

Did you every have the code for the green tick elsewhere in the mission - a trigger for example?  Could it still be there?
Plenty of reviewed ArmA missions for you to play

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:One last problem...
« Reply #2 on: 26 Jan 2004, 00:07:02 »
Quick, delete the posts in your other thread before anybody notices it was accidentally posted twice.
Plenty of reviewed ArmA missions for you to play

Ade

  • Guest
Re:One last problem...
« Reply #3 on: 26 Jan 2004, 02:29:30 »
Macguba,

Cheers once again, this is a really fast forum. :)

In answer to your questions, the script works OK apart from the multiple sidechats - the loons retreat as ordered and the helicopter happily follows a series of waypoints synched to a trigger which is tripped by setting defeat =1.

In further tetsing I noticed another problem, this time with the doMove loop.  Normally when testing, I take a truck to the place where they are retreating and cut them off, this being the idea of this part of the mission.

However, when I take a bit of time to get there I found them legging it back up the hill to their patrol waypoints.  Using a waypoint linked to a trigger for each group instead of ordering all surviving enemy to a givn area seems the wrong way to go - is there an easy way of deleting unwanted waypoints when the loons retreat?

Ade

PS how do I delete an unwanted post? :-[

Ade

  • Guest
Re:Green tick command..
« Reply #4 on: 26 Jan 2004, 02:33:52 »
Oh yes, the command to det objective three as "Done" appears only in that script.

My posting's a bit sloppy tonight because it's late and it's work tomorrow and a may just have had a very small glass or two of wine. :P

Ade


Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:One last problem...
« Reply #5 on: 26 Jan 2004, 13:35:10 »
To delete a post use the delete button in the top right hand corner of the post.    If you are the only person who has posted in a thread you can effectively delete the thread.

Even if the script works, you should always have a delay in a loop - otherwise the computer repeats the loop as fast as it possibly can, which eats processing capacity and will make most missions lag.

Put more delays and some debug hints in the script so that you can follow exactly what is going on.

I'm not sure if you can delete waypoints.   Try deletevehicle, you never know.   The loons are heading back to their waypoint because once they reach the doMove position they don't know what else to do.

Triggers, waypoints and groups are the fundamentals of OFP mission design.   Scripts exist to do stuff that can't be done with triggers, waypoints and groups.   If you unpbo official missions you will see that in many of them there is little or no scripting.  

doMove is a command for an individual loon, it's ideal for when you want a loon to temporarily leave his group for some reason.   If you want a whole group(s) to move the obvious way to do it is to setWPPos their next waypoint, using switch triggers to control which waypoint is next.


PS - Follow Sherlock Holmes's advice.   "When you have eliminated the impossible, whatever is left - however improbable - must be the truth."    In other words, if it is impossible for the script to display the text 3 times, then the triple display must be originating outside the script.

Plenty of reviewed ArmA missions for you to play

Ade

  • Guest
Re:One last problem...
« Reply #6 on: 26 Jan 2004, 19:46:13 »
MacGuba,

Right, a bit of a reworking is called for.  Serves me right for trying to take shortcuts.

Now I'll always try triggers and waypoints before even firing up notepad...

Thanx for replying to so many of my posts.  I'm not the brightest spark in the engine when it comes to programming but I'll get there in the end.

Cheers,

Ade  :)