Home   Help Search Login Register  

Author Topic: MP, addaction and dialogues  (Read 1459 times)

0 Members and 1 Guest are viewing this topic.

Coyote @ rage

  • Guest
MP, addaction and dialogues
« on: 17 Jan 2003, 15:52:59 »
I am doing a command & conuer stile MP map and have a nut to crack:

I have a truck named "ccwest" and the following trigger:

condition: (player distance ccwest)<20 AND side player == west AND alive(ccwest)

on activation: I = player addaction ["Gebäudemenü","createDialog.sqs"]
on deactivation: player removeaction I

"createdialog.sqs" opens a dialogue that lets the player create buildings, for example a factory, like this:
factwest = "houseammostore2" CreateVehicle [_posx,_posy,0]

I understand that this "factwest" is being created by the client and is available for all clients as created units are being synchronized by the host.

There is another Trigger similar to the one above that lets the player open a dialogue through an addaction he gets when he approaches the factory.

It works fine at the beginning, I can create the factory and can create vehicles at the factory.

HereÂ's the problems:
-When we test the map on a dedicated server on and my buddy creates a factory, I cannot create vehicles at that factory, I donÂ't get an addaction.
-After respawning, the addaction does not reappear, even if it worked before.

Could it be, that the created buildings do exist on other clients but do not have the name e.g. "factwest"?


As always, IÂ'm looking forward to reading the answers of you Masterminds. They solved all my problems so far.

Coyote @ rage.

P.S.: Preview of the map on our clanserver (IP:213.146.191.34:27025, PW: rage) Look for Nogova/ consup 2 public preview

Coyote @ rage

  • Guest
Re:MP, addaction and dialogues
« Reply #1 on: 18 Jan 2003, 03:43:13 »
Found a workaround:

instead of evaluating the distance player --> factory in a trigger which is set for the whole map, I made a trigger with the radius I wanted the addaction to appear, when player is in. Upon the client crating the factory, I broadcast the position of the factory to all clients and have each client move the trigger to that position. Thank God for being able to move a trigger.

Offline CrashDome

  • Members
  • *
Re:MP, addaction and dialogues
« Reply #2 on: 10 Feb 2003, 03:45:58 »
Here's another way but it might require some additional recoding of your scripts...

I place a gamelogic unit and addaction the command to that... when a player (anyplayer) gets close to the grouplogic unit they will be able to use the action. This also allows the server to run the script and keeps vehicles sychronized better with the clients. It solves these problems:

1. if multiple players get the addaction - when you get close to another player you get multiple menu commands

2. having to re-add or remove the action to respawned players.

the radius of the action on the gamelogic unit is quite large and should suit the factory quite well... Also, you only have to move the gamelogic unit and not the trigger on everyone's machine

Coyote @ rage

  • Guest
Re:MP, addaction and dialogues
« Reply #3 on: 11 Feb 2003, 12:27:29 »
N I C E !!!

As I never saw this written anywhere, only kinda draw it out of somewhere, I just ask:

? (local name_gamelogic)    can only be "true" on the server, right?

and:

? (local player)    can only be "true" on a client, whereas player means the specific fella sitting in front of his machine, right?

Coyote
« Last Edit: 11 Feb 2003, 12:28:16 by Coyote @ rage »