OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: jeffs on 26 Feb 2003, 18:03:07

Title: Serious Help Needed With CamCreate Please
Post 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
Title: Re:Serious Help Needed With CamCreate Please
Post by: Terox on 26 Feb 2003, 18:20:04
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
Title: Re:Serious Help Needed With CamCreate Please
Post by: jeffs on 26 Feb 2003, 19:38:45
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
Title: Re:Serious Help Needed With CamCreate Please
Post by: Sui on 27 Feb 2003, 00:43:39
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
Title: Re:Serious Help Needed With CamCreate Please
Post by: jeffs on 16 Mar 2003, 23:15:33
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
Title: Re:Serious Help Needed With CamCreate Please
Post by: Sui on 17 Mar 2003, 00:39:06
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:
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.
Title: Re:Serious Help Needed With CamCreate Please
Post by: jeffs on 17 Mar 2003, 01:21:31
Thanks a TON Sui
Title: Re:Serious Help Needed With CamCreate Please
Post by: Nasty Buttler on 17 Mar 2003, 01:56:25
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....