Jump to content
Sign in to follow this  
Ersk

Basic scripting help.

Recommended Posts

Basicly, I have made a script that moves an AI unit (OFpilot1) to an Su-34 (OFplane1), mounts and takes off. The script then checks the to see if fuel is under 90% and if so, orders the unit to land at pita airstrip.

I have tried lots of things but the main error I am getting is on the lines of "type boolean, expected number, string, int... etc" but all my data types appear to be correct.

[color="Gray"]//ai unit moves to and gets in plane[/color]
OFpilot1 doMove position OFplane1;
OFpilot1 assignAsDriver OFplane1;
[OFpilot1] orderGetIn true;

_landed = false;

while{_landed == false}do
{
if(fuel OFpilot1 < 8)then
{
	OFpilot1 landAt 2;

	[color="gray"]//checks to see if unit has landed[/color]
	_playerStatus = unitReady OFpilot1;
	if(_playerStatus == true)then
	{
		[color="gray"]//exit loop[/color]
		_landed = true;
	}
}
}

note.

The first 3 lines of code work fine, the unit moves to the plane and takes off.

Thanks in advance.

Share this post


Link to post
Share on other sites

Did you use sqs or sqf as the extension for the script file? Using sqs will make ArmA interpret the script in the older notation and cause some really wierd error messages.

I'd add some parens to the fuel check line too, just for luck.

Share this post


Link to post
Share on other sites

The extension i am usng is .sqf.

I also tried "if( (fuel OFpilot1) < 8)then" if thats what you meant but that didn't help.

Share this post


Link to post
Share on other sites

Replace

while{_landed == false}do

with

while{!_landed}do

and

if(_playerStatus == true)then

with

if(_playerStatus)then

and

if(fuel OFpilot1 < 8)then

with

if(fuel OFpilot1 < 0.8)then

or whatever the value should be.

Xeno

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  

×