Home   Help Search Login Register  

Author Topic: Snypir's Chopperwait Script  (Read 413 times)

0 Members and 1 Guest are viewing this topic.

Mr.BoDean

  • Guest
Snypir's Chopperwait Script
« on: 04 Aug 2003, 22:31:23 »
In the notes part of the script, it says:

Quote
This script will only work if the player is a member of the squad boarding the chopper (you shouldn't need to use it for AI squads anyways).


However, on testing I found that using the script as described, if an AI is the group leader (with me in the group boarding chopper) he no longer orders the group into the chopper. The only way is to kill him, take command and order the troops in.

i.e.:
 All AI squad -script not needed

Player as Leader - You Order squad into chopper - works great

AI as Leader - AI Leader ignores Get In WP (synched to chopper's Load WP)

Any way around this?   :P  :)


Mr.BoDean

  • Guest
Re:Snypir's Chopperwait Script
« Reply #1 on: 05 Aug 2003, 00:52:46 »
ok , the above was only tried in the editor  ...now that I have tried this in an actual game, I'm getting errors.

As the original script :

Code: [Select]
;BEGIN SCRIPT
_chopper = _this select 0

_chopper LockWP true

; loop until all of the players squad have got in
#for1

~0.5

? (GetPos _chopper select 2) > 5 : _chopper land "GET IN"

; make the chopper wait until the whole squad is in
_lead = leader player
_playerArr = units group _lead
_num = count _playerArr

_incount = 0
_tmp = 0

#for2
? vehicle (_playerArr select _tmp) == _chopper : _incount = _incount + 1
? _tmp < (_num - 1) : _tmp = _tmp + 1; goto "for2"

? _incount != _num : goto "for1"

; the chopper will move off on it's waypoints
_chopper LockWP false
; END SCRIPT  


I get this error:
 '_chopper = _this select 0 l#l' : error select: Type Object, Expected Array

After modifying all of the  _chopper lines to MH6 (choppername) ,

Code: [Select]
;BEGIN SCRIPT
MH6 = _this select 0

MH6 LockWP true

; loop until all of the players squad have got in
#for1

~0.5

? (GetPos MH6 select 2) > 5 : MH6 land "GET IN"

; make the chopper wait until the whole squad is in
_lead = leader player
_playerArr = units group _lead
_num = count _playerArr

_incount = 0
_tmp = 0

#for2
? vehicle (_playerArr select _tmp) == MH6 : _incount = _incount + 1
? _tmp < (_num - 1) : _tmp = _tmp + 1; goto "for2"

? _incount != _num : goto "for1"

; the chopper will move off on it's waypoints
MH6 LockWP false


 I got it to work correctly, but this error came up in game:

'MH6 l#l= _this select 0' : Error Reserved Variable In Expression

Hmmm  :-\   :-X  

 I am using

 In the chopper's Land (Move)WP :

MH6 Land "Land"; MH6 exec "chopperwait.sqs"


EDIT: I then removed the first line of the script (MH6 = _this select 0) and it works with no errors. Not sure why the original script had error  ???  and would still like an answer to Q #1.   ;)  ;D

 :PWhat's wrong with this picture?
« Last Edit: 05 Aug 2003, 01:12:11 by Mr.BoDean »

Mr.BoDean

  • Guest
Re:Snypir's Chopperwait Script
« Reply #2 on: 05 Aug 2003, 06:21:10 »
hmm...no answers yet and I have even MORE Q's and frustrations.  :-X   :o


I set up a simple test mission using the script (modified as above) and it worked correctly.

MH6 (Chopper) : Flying
Group Leader's Init. : mygrp = group this
3 Soldier Units grouped to Leader

MH6 WP's:

0:Move
On Activation: MH6 Land "Land"

1:Load (Stacked On top Of 0:Move and Synched to Get In WP of group)

2:Move

3:Transport Unload (Synched to Get Out WP of group)

4: Move

Group's WP's

0:Get In (Synched to Load)

1:Get Out (Synched to Transport Unload)

2:Move

Scenario: Heli comes in, lands, waits for all troops to be in (with player as leader) flies to next WP , then lands , ejects player at transport Unload , waits for AI to disembark, then flies off. It is even ignoring MH6 FlyInHeight 0 commands with 10 second holds!   >:(


I then set up this SAME scenario in my mission duplicating WP's names, etc. and when the chopper gets to the Transport Unload, it boots the player and flies off with the AI.

Now, I am familiar with assignas / unassignvehicle commands but this looked to be working fine without it before. WTH wouldn't it work EXACTLY the same if I've got it set up the same way?

And/Or should I be using another script to make the chopper wait? I tried modifying the _Incount to _Outcount but missed something. C'mon scripting wizards!  :P  ;)
« Last Edit: 05 Aug 2003, 06:26:30 by Mr.BoDean »