Jump to content
Taylor1984

Onmapsingleclick problem

Recommended Posts

Hi

 

I'm having problems getting units to move when you click the map in multiplayer when clients use onmapsingleclick. It seems you can't remoteexec the _pos that onmapsingleclick uses?

 

Thankful for help

Share this post


Link to post
Share on other sites

This is most likely not the best solution but you could try just doing 

pos = _pos

I don't see that failing. 

 

remoteExec don't work with local variables is what I'm trying to say. Unless they're also local on target PC. 

Share this post


Link to post
Share on other sites
1 hour ago, Taylor1984 said:

Hi

 

I'm having problems getting units to move when you click the map in multiplayer when clients use onmapsingleclick. It seems you can't remoteexec the _pos that onmapsingleclick uses?

 

Thankful for help

 

_pos is a special variable for this "EH". That works fine with a script. For example adding waypoint on a group (the group must be defined locally, of course)

So, the best way to help you will be possible if you send your whole code, not the fact you need to publicVariable a position. Spatsiba comment (make it a global variable) is not an MP solution,btw.

 

  • Like 1

Share this post


Link to post
Share on other sites
On 24.10.2018 at 1:07 AM, Spatsiba said:

remoteExec don't work with local variables is what I'm trying to say.

It does.

 

On 24.10.2018 at 1:07 AM, Spatsiba said:

Unless they're also local on target PC.

No that's not how local variables work. Neither is that how remoteExec works. This is not how any of this works.

 

On 24.10.2018 at 1:07 AM, Spatsiba said:

pos = _pos

Very bad idea. Global variables should always have a tag or a very unique name.

 

@Taylor1984 Show us the code you are trying to use. You can do what you are trying to do just fine. There is some error in your code.

  • Like 2

Share this post


Link to post
Share on other sites

Why are you trying to remoteExec _pos anyway? :eh:

You don't need to do that for storing the position. Save to some variable. As @Dedmen said. Share your code. You can also explain what you are trying to do.

  • Like 2

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

×