Home   Help Search Login Register  

Author Topic: hold grp position  (Read 641 times)

0 Members and 1 Guest are viewing this topic.

mystic80

  • Guest
hold grp position
« on: 23 Oct 2003, 09:31:45 »
hi there is there any way to hold GROUP position using sqs script???

Komuna

  • Guest
Re:hold grp position
« Reply #1 on: 23 Oct 2003, 14:20:52 »
Hmm... That's pretty basic:

"dostop _x" forEach units Mygroup

OR

Leader Mygroup LockWP true

mystic80

  • Guest
Re:hold grp position
« Reply #2 on: 24 Oct 2003, 04:54:48 »
well thanks komuma. but I having some problem executing a loop statement.

for example. if I wanna hold my grp using foreach, how do i check if the foreach loop is finish?

basically i want my loop to finish then exec a statement. but the foreach process in the way I it keep looping the whole filename.sqs file.

ok in C language I want it to be like this.

enableRadio false;
for (loop !=0)
{
   _x hold position
}
enableRadio true; //this will switch to true when the loop is finish.

Komuna

  • Guest
Re:hold grp position
« Reply #3 on: 24 Oct 2003, 15:30:40 »
enableRadio false;
for (loop !=0)
{
   _x hold position
}
enableRadio true;

EhEh! I'm not used to work with C language, but I believe your 'for' structure is the cause of your prob:

< for (loop !=0) >

It means, according to logics, that the loop will continue until the variable "loop" becomes 0. So, if you don't make it 0 while looping, it will continue forever... Therefore, what about this structure, instead:

Code: [Select]
Enableradio false;

_loop = 0;

while "_loop > (count units Mygroup)" Do {doStop (units MyGroup select _loop); _loop=_loop+1;};

Enableradio true;

However, I don't know why you want this...  ??? The repeating structure is almost instantaneous! Besides, why are you using C lang? OFP does only support its own language - see the Online Command Reference for more info - and for that reason you can't do your little tricks.

Note: I don't know C lang syntax, but it looks like your 'for' structure is missing lots of arguments...
« Last Edit: 24 Oct 2003, 15:33:47 by Komuna »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:hold grp position
« Reply #4 on: 24 Oct 2003, 19:07:44 »
I don' tknow anything about C.    Come to that, I don't know much about OFP scripting.     Why doesn't this work for you?

enableradio false
"dostop _x" forEach units Mygroup
enableradio true


(Syntax not guaranteed of course, this is me who's writing here.)   Alternatively, what's wrong with the lock WP suggestion?     May not solve your problem of course .... but the more you can tell us about the underlying problem the more likely it is that we will be able to help you.   :)

Plenty of reviewed ArmA missions for you to play

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:hold grp position
« Reply #5 on: 25 Oct 2003, 03:49:22 »
Dostop is all well and good, but the problem is the leader of the group (if it's AI) will still be assigning targets to it's troups and giving 'engage' orders.

To prevent this, you may want to use the line:

"_x disableAI {TARGET}" foreach units group

However, just bear in mind that this target assigning AI can't be turned back on again ;)

Up to you whether you want to have the AI slightly less effective on the move, or extremely effective when holding their position I guess...

Komuna

  • Guest
Re:hold grp position
« Reply #6 on: 27 Oct 2003, 14:56:47 »
Dostop is all well and good, but the problem is the leader of the group (if it's AI) will still be assigning targets to it's troups and giving 'engage' orders.

To prevent this, just < leader MyGroup setCombatMode "GREEN" > (Open Fire, do Not Engage)
« Last Edit: 27 Oct 2003, 14:59:00 by Komuna »

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:hold grp position
« Reply #7 on: 28 Oct 2003, 10:24:06 »
hmm..... not so much.

Green will mean the AI will only fire to defend themselves. This means that they won't engage an enemy that they feel isn't a threat.

Try sticking a bad guy infront of AI set to Green... they won't shoot him unless he shoots at them first. ;)

Komuna

  • Guest
Re:hold grp position
« Reply #8 on: 28 Oct 2003, 15:04:54 »
Then it is "Yellow" - Open Fire, stay close - right?

I'm not sure - don't have the Comref here - but one of the colors do work.