Forum Jump :

Author Message


Posts: 3
Rank:


Level: Member

Country: nz
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2013-08-14 05:55        
     
Heyas gang, I am new to arma scripting but not new to scripting in general. I have hit a snag. I am trying to get a simple little script set up that detects when a person gets in a helicopter. At that point, the ground crew will move away from the chopper and salute the chopper. Here is the little snippet I have so far...

_saluteMe = {
	hint "Player Entered LilBird1\n";
	_unit = _this select 0;
	_mech1 = lil1Rep1;
	
	_mech1 enableAi "MOVE";
	sleep 1;
	_mech1 setUnitPos "Up";
	sleep 2;
	_mech1 doMove getMarkerPos "mech1WaitMarker";
	sleep 8;
	_mech1 setdir 330;
	_mech1 switchMove "AmovPercMstpSlowWrflDnon_Salute";
	sleep 3;
	//_mech1 disableAi "MOVE";
	

	

};

call _saluteMe;

The crewman (_mech1) starts with disableAI "MOVE" and setUnitPos "Middle". It sometimes kinda works. It seems like some of the commands fail to fire. I tried using sleep commands to get it to work but that only slightly helped.

The questions are...
1) Is there a better mechanic then sleep to make a script wait for the previous command to finish (or more importantly, the previous scripted order to be carried out by the AI).
2) Is this the right way to do this? Is there a better option for the doMove?

thanks

DasClark

ps - there is a marker in the game that is called mech1WaitMarker


Author Message


Posts: 334
Rank:


Level: Member

Country: de
Location:
Occupation: Student
Age: 31
In-game name:

 
#2 Posted at 2013-08-14 06:31        
     
deleted answer
maybe your crosspost helps you
http://forums.bistudio.com/showthread.php?161156-Pilot-Crew-Script






Tags: Ai, Arma3, Crew, Scripts