Jump to content
Sign in to follow this  
Nicolas Eymerich

Onmapsingleclick and a spawn question

Recommended Posts

Okay...

This is a part of a script code which worked well in flashpoint:

Hint format ["CHOOSE AN INSERTION POINT FOR %1\nCHOPPER STILL AVAIBLE = %2", ((Array_Type_Man select 2) select _Script), (2 - P_Var_DropInfantry)]

ArrMovePosInA = [0,0,0]

P_G_onmap = false

_end = time + 30

onMapSingleClick { (ArrMovePosInA = _pos); (P_G_onmap=true); (onMapSingleClick{})}

#wait

~.1

? time > _end : HINTC Format ["WARNING! OPF IS AWAITING A DESTINATION FOR %1. PLEASE, OPEN THE MAP AND CHOOSE A DESTINATION", ((Array_Type_Man select 2) select _Script)]; _end = time + 30; Goto "wait"

? ! P_G_onmap : goto "wait"

This code does'nt works in Arma huh.gif

Can someone explain me why?

Share this post


Link to post
Share on other sites

can't use ~ anymore, use sleep

can't use ? : anymore, use if then

see the WIKI

Share this post


Link to post
Share on other sites

as far as I can tell, sqs files still function if they have ? and ~ at least my scripts still do :P

must be something else

Share this post


Link to post
Share on other sites
as far as I can tell, sqs files still function if they have ? and ~ at least my scripts still do :P

must be something else

Infact. (thank you for answering however)

The error I get sounds like this:

Errore type sequence; expected code

(I've traslated due to the fact I've the Italian version)

smile_o.gif

Share this post


Link to post
Share on other sites

hmm, that's good to know, i guess i'm thinking of sqf format? sorry about that : (

Share this post


Link to post
Share on other sites

I think those curly braces with OnMapSingleClick are a thing of the past. I think you now have to use quotes. Check the wiki to be sure. I don't mean the ones used when clearing the array, (if that's the right terminology) as in OnMapSingleClick{}, but the other ones.

Share this post


Link to post
Share on other sites
I think those curly braces with OnMapSingleClick are a thing of the past. I think you now have to use quotes. Check the wiki to be sure. I don't mean the ones used when clearing the array, (if that's the right terminology) as in OnMapSingleClick{}, but the other ones.

People keep getting this confused. No, curled braces are still needed in ArmA, quotes too. The change is that they are no longer interchangable as they were in OFP, quotes must be used soley for string and curled braces soley for code.

Now, the biki says that the commands in OnMapSingleClick are string (requiring quotes), but the biki's been wrong about that stuff before, and it sure looks like code to me. If I were you I'd try quotes just to be sure, if it doesn't work (and gives you another error) then put the curled braces back and never try quotes again.

Share this post


Link to post
Share on other sites

I've a look to Murlay - artillery script yesterday evening and i've solved the problem.

This is the wrong code:

onMapSingleClick { (ArrMovePosInA = _pos); (P_G_onmap=true); (onMapSingleClick{})}

This is the correct now:

onMapSingleClick " ArrMovePosInA = _pos; P_G_onmap=true; "

Thank you for your feedback guys.

Even if, still now, I don't understand the reasons of those sintax changes

Share this post


Link to post
Share on other sites

Jepp that´s the new way:

onMapSingleClick " ArrMovePosInA = _pos; P_G_onmap=true; "

Use the ""

@Nicolas Eymerich

Murray is the name... not Murlay wink_o.gif

Regards,

Mr-Murray

Share this post


Link to post
Share on other sites

It seems that in Arma, curled braces can no longer be used to define strings. You can use double double-quotes to define a string within a string :

eg, _string = "my string ""with"" quotes"

onMapSingleClick uses a string as a command.

From what I understand, you may be able to use the following to release the onMapSingleClick command (do we still need to do this?) :

onMapSingleClick "command; onMapSingleClick"""" "

Share this post


Link to post
Share on other sites
From what I understand, you may be able to use the following to release the onMapSingleClick command (do we still need to do this?) :

onMapSingleClick "command; onMapSingleClick"""" "

Three replies in less than 15 minutes wink_o.gif

I assume it's quite useless repeat the command inside the " ".

I've been using it to choose multiple locations on the map.

And i've used the right statement reported 3 post up.

Share this post


Link to post
Share on other sites
Quote[/b] ]I assume it's quite useless repeat the command inside the " ".

In OFP, you needed to "release" onMapSingleClick so that it stopped peforming the command for each map click. This was often done by adding onMapSingleClick{} to the end of the command string, allowing the onMapSingleClick to happen once, then revert to default behaviour. You used this method in your initial script!

Share this post


Link to post
Share on other sites
Quote[/b] ]I assume it's quite useless repeat the command inside the " ".

In OFP, you needed to "release" onMapSingleClick so that it stopped peforming the command for each map click. This was often done by adding onMapSingleClick{} to the end of the command string, allowing the onMapSingleClick to happen once, then revert to default behaviour. You used this method in your initial script!

I was refering to arma sintax.

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  

×