Jump to content
Sign in to follow this  
GotheriK

Problem with Marker Script

Recommended Posts

I'm trying to get a spawnpoint to follow a vehiclein ArmA. So far I've made a script to get the spawnpoint marker to follow the vehicle:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#loop

"Respawn_west" setMarkerPos getPos ambu

~1

goto "loop"

And in the vehicle's init field I've put this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[] exec "rspn.SQS"

But every time I try to run the game, I get the error:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">|#|# Error invalid number in expression

Help please? banghead.gif

Share this post


Link to post
Share on other sites

"Respawn_west" setMarkerPos getPos "ambu"

ambu is a variable name, doesn't need "quotation marks"

edit: also, since you script is hard-coded to use ambu, the ambu in the [ambu] exec.... line is redundant.

Share this post


Link to post
Share on other sites

I've tried it with and without quotations.

What should I put in the Activation field in place of [ambu]? If I remove it, I get an error.

Share this post


Link to post
Share on other sites

Do you have a unit named ambu, and a marker named Respawn_west?

If you don't need to send any arguments ito the script, use an empty array.

eg:

[] exec "myScript.sqs"

Share this post


Link to post
Share on other sites
Quote[/b] ]Do you have a unit named ambu, and a marker named Respawn_west?

icon_rolleyes.gif You're kidding, right?

Share this post


Link to post
Share on other sites

No, he's not kidding. In case you have a unit named ambu, and a marker named Respawn_west:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#loop

"Respawn_west" setMarkerPos getPos ambu

~1

goto "loop"

To call it:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[] exec "rspn.sqs"

Now this should be understandable to ya. wink_o.gif

Share this post


Link to post
Share on other sites

I've created a mission with the marker, ambu, using the fixed script and I get no error. There are very few possibilities for error, so we've got to eliminate the obvious mistakes first.

Share this post


Link to post
Share on other sites

Karantan, no need to be snotty.

fasad, I understand we need to eliminate the obvious mistakes, but I can assure you that I haven't forgotten to name the vehicles and markers.

Share this post


Link to post
Share on other sites

GotheriK, no need to have such an attitude towards the people which trying to help you, and which actually have solved your problem.

Share this post


Link to post
Share on other sites
GotheriK, no need to have such an attitude towards the people which trying to help you, and which actually have solved your problem.

I don't have an attitude with anyone, I'm just asking for productive help, not people like yourself coming in to cause trouble.

Anyway fasad, I'm not sure what the problem is then, it still doesn't work for me.

Anybody else have an idea?

Share this post


Link to post
Share on other sites

Try reducing all unknown factors. Test the absolute minimum number of possible causes, by either copying your mission to another name, then removing everything unrelated to the script, or by making a new test mission with only the require unit, marker and script.

I cannot think of any possible explanation other than the error being caused by a mistake in another script or code block.

Share this post


Link to post
Share on other sites

Would the fact that this is ArmA make a difference?

Share this post


Link to post
Share on other sites
... I'm just asking for productive help, not people like yourself coming in to cause trouble.

And you got it, and if you'd had any clue what you want or need the first fasad's post should quite sufice. And if you just copy & paste my codes, all would be ended by now. But you're rather a smart ass instead, first with fasad, and now with me.

But anyway, don't worry, you won't have anymore troubles with me in the future; you're the last person I would help here.

EDIT: and go to the right board for help.

Share this post


Link to post
Share on other sites
... I'm just asking for productive help, not people like yourself coming in to cause trouble.

And you got it, and if you'd had any clue what you want or need the first fasad's post should quite sufice. And if you just copy & paste my codes, all would be ended by now. But you're rather a smart ass instead, first with fasad, and now with me.

But anyway, don't worry, you won't have anymore troubles with me in the future; you're the last person I would help here.

EDIT: and go to the right board for help.

The codes that you posted are the exact same ones I have now! Every single letter, space, and punctuation mark is identical to what you posted. All you did was post exactly what I already had.

Now, according to the "experts" OFP editing is supposedly "identical" to ArmA, and every time I have a question over there, I get referred to this board.

Share this post


Link to post
Share on other sites

The codes that you posted are the exact same ones I have now! Every single letter, space, and punctuation mark is identical to what you posted. All you did was post exactly what I already had.

Not quite, but no matter ...

Quote[/b] ]Now, according to the "experts" OFP editing is supposedly "identical" to ArmA...

Apparently not, but no matter ...

Quote[/b] ]...and every time I have a question over there, I get referred to this board.

The only thing I'll all add to finish it is that those codes working as they should in OFP.

Share this post


Link to post
Share on other sites
Quote[/b] ]The codes that you posted are the exact same ones I have now! Every single letter, space, and punctuation mark is identical to what you posted. All you did was post exactly what I already had.

Nah. Pay attention to the syntax of the commands:

string setMarkerPos position

getPos object

String is a variable that stores a series of characters and is defined by quotation marks as:

str = "this is a bunch of letters in a variable named str";

Name of an object is a variable name, not a string.

What you have:

"markername" setMarkerPos getPos "objectname"

What you should have:

"markername" setMarkerPos getPos objectname

And we don't know you. For all we know, you might have absolutely no idea what you are doing so there's no need to get all defensive if somebody asks or suggests something that you think is obvious.

Share this post


Link to post
Share on other sites

edit - Found the problem, it was the encoding on the script file, I was using Unicode as opposed to ANSI

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  

×