OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: jeffs on 26 Feb 2003, 18:03:07
-
I'm running one of my typical training maps for our squad. Instead of the typical targets I use I've decided to camcreate east units. Works like a complete charm... Until multiplayer. The men do not appear to die unless the player looking at them shoots them. I.E. I can kill the camcreated men, and see them die, but the guy next to me still sees them standing there. Any help would be appreciated. Part of the script is below:
hint "Welcome to the VASF Rifle Qualification Range"
~3
hint "You will have One 30 round Magazine to Engage 20 targets in the standing position, and One Thrity Round Magazine to Engage 20 Targets in the prone position"
~5
Hint "Scan Your Sector and Engage at Will"
~3
soltar1 = "SoldierEB" camcreate getmarkerpos "q_1"
~5
soltar2 = "SoldierEB" camcreate getmarkerpos "q_2"
~5
soltar3 = "SoldierEB" camcreate getmarkerpos "q_3"
~5
soltar4 = "SoldierEB" camcreate getmarkerpos "q_4"
~5
soltar5 = "SoldierEB" camcreate getmarkerpos "q_5"
Any help would be greatly appreciated.
JeffS
-
Have the script you run to camcreate the AI, run only on the dedicated server
by typing the following line at the start of the script
?!(local Server): exit
I think you would have to create a gamelogic called "Server" too
Often different clients see different things if tasks are being performed by them.
So for the more important things like scoring and veh respawn use server side scripting
This may be your problem, try it and see
-
Terox,
I added the "?!(local Server): exit" to the begining fo the script. Didn't seem to solve problem. I'm not familiar with game logic, coul you please explain that part?
Thanks,
JeffS
-
The problem with camcreate in MP is that it will tend to only create the object on the machine the command was run on (in this case the server).
I suggest using createvehicle (or createunit in this case) instead, and disabling the AI
-
Sui,
createvehicle worked well on the troops, everyone can see them when they are shot. Now however, they are duplicating when the trigger is tripped. I.E. It makes two soldiers instead of one. Any Ideas?
Thanks,
JeffS
-
Hey JeffS ;)
What is happening there is your script is being run twice. Once on the server, and once on the client. What you need to do is get the client to stop running it.
To do this, you'll want to do what Terox suggested. Add the line to your script (which I gather you've already done), and place a game logic unit.
To do this:
- Hit F1 and double click on the map... just like you were going to place any other unit
- In the Side dropbox (the one where you can select West/East/Resistance etc.) select "Game Logic"
- Now you'll have a game logic unit. Name it Server
It doesn't matter where you place this unit on the map. It is invisible, and the AI (or the players) won't even see it, let alone react to it. It's simply there to make sure the script can tell the server from the clients ;)
If you manage that, you should be getting only one unit created when you run the script.
-
Thanks a TON Sui
-
the better way to do it is to stop the script from being run at all on the client machines.....the way to do that is to change the condition in the trigger running the script to this
condition ::> MY condtions && local SERVER
hope this also helps.....its abit more efficient to not run a script on a client machine only to be booted out, its trivial i know but think about it then your doing this 500 times in a single mission, because then it might increase the overall performance of the mission....