Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: Making AI units move in MP  (Read 1836 times)

0 Members and 1 Guest are viewing this topic.

Offline Gadjuka

  • Members
  • *
  • Programmer
    • Operation Flashpoint: Commander
Making AI units move in MP
« on: 12 Jun 2003, 14:15:41 »
In my multiplayer mission I want the players to be able to order AI units (not in the players group) to move to a specific point (defined by map click). To achieve this I use 'onMapSingleClick' and 'Move'.
The problem is that if someone on one of the clients issue this command, the units wont move. From the server everything works perfect - click map, and the units starts to move. I have tried to use 'doMove' and 'commandMove' with the same result, and 'onMapSingleClick' do returns a correct value.

How do I make the AI listen to the clients too?
Currently working on Operation Flashpoint: Commander.
Website: http://www.nordserver.se/commander/

deaddog

  • Guest
Re:Making AI units move in MP
« Reply #1 on: 12 Jun 2003, 23:05:03 »
Map-clicks are local to the computer where the click happened.   You would have to pass the resulting map position back to the server, via the publicvariable command.

Publicvariable does not work with arrays so you would have to separate the mapclick position into x and y components and then pass those back to the server separatly.

x=_mappos select 0;publicvariable "x"
y=_mappos select 1;publicvariable "y"

You need a script running on the server only that checks for these variables and then acts upon them accordingly.

There may be a better way to do this, this is just one way.   :)