Jump to content
Sign in to follow this  
william1

error message on screen, why?

Recommended Posts

hi , when i execute this script :

~1

a1 action ["eject", h1];

unassignvehicle a1;

~2.5

a2 action ["eject", h1];

unassignvehicle a2;

exit

it shows this message on the screen during the game:

'exit|#|\par ' error unknown operator

it is a scrpit for jumping from a chopper, and i think it is ok so i don't know why this error shows , any idea ?

thanks

Share this post


Link to post
Share on other sites

Scripts usually dont have a ; at the end of a line, i think that causes the problem wink_o.gif

Share this post


Link to post
Share on other sites
Scripts usually dont have a ; at the end of a line, i think that causes the problem wink_o.gif

Only if there is another command on the same line.

Only SQF functions require the semicolon after each command, no matter whether there is anything after on the same line.

William1: What editor are you using? Are you sure there isn't anything after the exit command?

Share this post


Link to post
Share on other sites

mmm no, it's not that , i have tried without the ";" and the message keeps showing , also the script doesn't work properly without the ";" confused_o.gif

Share this post


Link to post
Share on other sites
Scripts usually dont have a ; at the end of a line, i think that causes the problem wink_o.gif

Only if there is another command on the same line.

Only SQF functions require the semicolon after each command, no matter whether there is anything after on the same line.

William1: What editor are you using? Are you sure there isn't anything after the exit command?

i'm using wordpad huh.gif

yes, i have checked it again , there is nothing after "exit" sad_o.gif

Share this post


Link to post
Share on other sites
i'm using wordpad  huh.gif  

Try Notepad , some other text-editors can mess things up wink_o.gif

EDIT: AFAIK there is some tool specially made for writing scripts in OFP (uses colored tags for commands etc), i think you can find it on OFP.info in the utilities section, but i dont know the name.

Share this post


Link to post
Share on other sites

There is nothing wrong with the script, you posted. I would double check your sqs file with notepad, just to make sure you have no unwanted characters in there.

You might have corrupt exit command, caused by something else in another section of your mission. If there is no code after the exit command then remove it, you don't need to call exit at the end of a script.

If that does not work, try re-typing your script with notepad and test it in a new mission, using the standard BIS addons.

Share this post


Link to post
Share on other sites
Quote[/b] ]exit|#|\par

Wordpad adds something to the end of file that ofp parser doesn't understand. Use notepad or try adding a semicolon and a line change after the exit command.

Share this post


Link to post
Share on other sites
i'm using wordpad huh.gif

Try Notepad , some other text-editors can mess things up wink_o.gif

EDIT: AFAIK there is some tool specially made for writing scripts in OFP (uses colored tags for commands etc), i think you can find it on OFP.info in the utilities section, but i dont know the name.

that's it ! thanks ofpforum , and UNN and 5133p39 and metalheart , it is the wordpad that mess all up , i have opened the script whit notepad and this is what it contains , Incredible !!

{\rtf1\ansi\ansicpg1252\deff0\deflang3082{\fonttbl{\f0\fswiss\fcharset0 Arial;}}

{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 ~1\par

a1 action ["eject", h1];\par

unassignvehicle a1;\par

~2.5\par

a2 action ["eject", h1];\par

unassignvehicle a2;\par

exit\par

}

crazy_o.gifcrazy_o.gifcrazy_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]AFAIK there is some tool specially made for writing scripts in OFP (uses colored tags for commands etc), i think you can find it on OFP.info in the utilities section, but i dont know the name.

I believe that you may be speaking of Chris Henderson's OFP Script Editor.

It is available here.

Great tool as it really helps to spot/prevent frustrating typos and contains all commands, weapons, and ammo. Even includes a few simple scripts that you can use and learn by when just getting into OFP scripting.

Wadmann

Share this post


Link to post
Share on other sites
Scripts usually dont have a ; at the end of a line, i think that causes the problem wink_o.gif

Only if there is another command on the same line.

Only SQF functions require the semicolon after each command, no matter whether there is anything after on the same line.

Thats why i said usually wink_o.gif

@Wadmann, that was indeed the tool i was talking about! Thnaksfor finding it cause im using it myself now aswell smile_o.gif

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  

×