Jump to content
Sign in to follow this  
Chris Death

Did you know?

Recommended Posts

To all who already created a multiplayer map,

or to them who want to do:

There are differents between singleplayer

editing and multiplayer editing, which you

couldn't see, until you play one of your own

made missions as a client (or testing them

on a LAN).

Therefore i want to start a thread, where

you can post hints or suggestions to this

topic.

btw - also strange things, or observations, experienced in

MP editing are welcome

in this thread.

(Edited by DV Chris Death at 7:35 am on Dec. 12, 2001)

Share this post


Link to post
Share on other sites

Here is my first one:

While creating a coop map, where the

user controlled squad (8 specops/day)

were equipped with bizon's, law (1 round)

1 hand grenade and 1 satchel charge, i thought

all works well. I could see these weapons in

briefing, but when i asked another one, who

tested the map with me, he said he has HK

as weapon. So i tried various things to change

the weapons for the soldiers

1) add them by script or manually in the init field

of each soldier - didn't work well for clients

2) add them by trigger when the mission starts

- didn't work well for clients, and we couldn't

see them at briefing (ok we all know why)

Then i had the idea to try it in the init.sqs (this

script will be executed automatically, if present,

by the mission) - this worked for all clients, and

everyone could see the weapons in briefing.

Share this post


Link to post
Share on other sites

Another one:

One of my end trigger conditions had to be

that all of an 8 men player team are dead.

Normally you can use a trigger with the size

you want to check out if these men are present.

But in my mission there were also other soldiers

of same side like the player team.

To all of these 8 men i gave names; for example:

S1,S2,S3----S8

Then i made triggers to check if they are alive.

This worked fine until i started to disable some

men at the player selection menu (what is usually

in MP games). If one of the 8 men was disabled,

the end trigger didn't activate anymore.

I tried to ask at the beginning of the mission

for each of the 8 if he's alive (if not the variable

for his death was set to true) - this also didn't

work. So i tried the same thing by use of a script -

no success. For testing i let a trigger tell me that

a soldier was not here (disabled him at selection menu)

but the end trigger still didn't activate even when

the test trigger detected the soldier as not present.

So i again took the use of the init.sqs and included

a script where i asked for each of the 8 soldiers

if they are alive or not, and moved the information

about this to the end trigger by setting a variable to

true.

For example: s2 was the disabled unit / s2d=true

and in game there was also a trigger with a

notalive s2 condition, which would also have set

the s2d to true.

Finally this worked well and one more time the

init.sqs was the key of success.

Share this post


Link to post
Share on other sites

a short one:

The join command in mp-missions doesn't work

like it should, for human controlled units.

Share this post


Link to post
Share on other sites

Not exactly a tip, more an observation/question.

I coded a co-op MP mission, with a cutscene script that runs when an AI unit reaches a certain point, code to run the scene is in the on activation field of the units waypoint. (I play it on my LAN, 3 players, no dedicated server)

I have experienced unpredictable behaviour with this script, sometimes it runs fine on all PC's, other times it starts on one PC, and then starts after a few seconds on the others, once it even ran on the host but never ran on the other PC's.

Now, obviously when the unit reaches its waypoint, it does so at the same time on all PC's, so whats goin' on?

Is this just the dodgey net code, or is there a way I can control this?

(oh, and its works fine in single player and the editor)

Share this post


Link to post
Share on other sites

one more:

I used the addaction command for 2 human controlled

units so that both could activate a script - for both

it was the same script, which should be activated

(a kind of advertisement by using titletext)

OK all worked fine, my mate and me were both seeing

the added action at the bottom right menu.

But when he came close to me, i got the same action

command twice at my bottom right menu.

When he went away it disappeared again.

Share this post


Link to post
Share on other sites

to Space Cadet:

As we know, triggers are also variables, used

by the mission itself (more complex than a usual a or b

variable, but still variables).

So what i think is, most of the things we are using in

MP editing has to be managed like public variables,

to tell also the clients that this happens exactly now.

I also used a trigger, where you came to close to a

house, then you could hear dogs and the russians

have been alerted by this. This trigger would have been

deactivated, if the russians were already alerted. When

i played this map as client, and they were alerted, i

experienced, that the trigger still went on later, when

i aproached to the house.

Share this post


Link to post
Share on other sites

the next one:

Using random weather makes also different

results for hosts or clients.

When you use random weather in MP, i think

each one will have his own generated weather

on his local machine.

Share this post


Link to post
Share on other sites

and another one:

I tried to display a message by using

the addaction command. I created 2

soldiers (both playable) and added to

both by using the addaction command

an option to start a script. In this script

i entered: unit sidechat "blabla".

When i tested it on LAN, i saw that

the sidechat message is only displayed

on the screen, from where i started it.

Then i tried to make a variable to true

and a trigger with condition (variable from

script) should display the text at bottom of

screen. The text was again only displayed

at the screen, which executed the action

command. I made all variables, i used to

publicVariables (soldiers, triggers, and

condition variable), but still no success.

Share this post


Link to post
Share on other sites

* For random weather (or random anything):

Have the server calculate the random variables and publicVariable them to everyone else.  The weather/time-changing commands must be executed locally on EVERY computer.

If you want to simply change weather to a preset value in a script for MP, you STILL must run the commands (setFog, setOvercast, skipTime, etc.) on EVERY machine.  Weather & time are local.  It is possible to have one computer in thick fog, raining, at night, and the other one sunny with 100% visibility, at the same time in the same mission ^_^

Could be an interesting way to penalize a grief player...

* publicVariable

Currently, publicVariable only works with numeric variables.  It does not work with boolean, string, array, group, etc. variables.  If you want to make public a boolean value, you can set arbitrary numeric true/false values in the init.sqs:

isTRUE = 0

isFALSE = -1

Or whatever.  You can then fake booleans and make them public.  Or you can wait for the Christmas patch and hope they fix this.  ^_^

* addAction

Is basically useless.  Using addAction on a player makes it available to EVERYONE within range, as if the player were a car or something.  You cannot set the range or availability of the action.

If you want to add a custom command, you are better off using the radio command (Alpha - Hotel) feature.  If you need to you can even script sub-menus.

addAction would only be useful in adding an action to a static object that everyone can access.  For instance, adding a lightswitch feature to all the lampposts in the game (which I've done--it's fun!).  If you wanted to, you could put in the script a way to block certain groups/sides/units from using it, but the action will still appear to them.  It just won't work when they try to use it.

* Checking the alive status of AI players that can be disabled

I have not tested this, it's just an idea.  Instead of using !alive, use !canMove.  Even a severely damaged player can still move.  I don't know if disabled AI units will come up as not being able to move though, so it might not work.  At any rate, !alive is VERY unreliable in multiplayer (even the game code can screw up checking this condition currently), so this might be a better choice anyways.

More to come as I think of it.

- PlaneShifter -

(Edited by PlaneShifter at 4:23 pm on Dec. 12, 2001)

Share this post


Link to post
Share on other sites

Just a suggestion.

Could u include in your posts the actual code u used to get your results. This will help everyone out, enabling them to learn new features of mission editing, and also to fix problems you have.

Share this post


Link to post
Share on other sites

to amos m:

I don't think, it's necessary to post codes, which

are already working in sp editing and not in mp

editing. I mean for example, how to add weapons

or ammo to a soldier, or how to activate a trigger

by a variable, you set true in an earlier activated

trigger (you can see them already in other threads).

What i want in this thread is to post, discuss or

even solve differences between MP and SP editing.

to PlaneShifter:

Checking the alive status of AI players that can be

disabled works, when you check their alive status

by the init.sqs, while not in the mission itself (when

they are disabled from unit selection menu). I really want just to check if they are alive or not (the mission

ends, when none of these 8 players is ALIVE anymore)

If they still can move, then (in my case) it wasn't necessary to end the mission.

The weather stuff (if i understood you right /i'm from

Austria and need still to translate english to german)

can be solved by creating a random weather (maybe by use of a script, and give to clients the final result by setting the weather (or fog/time) on their machines directly (correct me if i understood wrong).

Share this post


Link to post
Share on other sites

DV, you were close. The server cannot set the client's weather *directly*, however the server can broadcast the variables, as well as a variable flag (like clientSetWeather = 1) to tell the clients that they should now set the weather.

So you'd have the server run a script like this:

***

fog = (random 1)

; this is to stop the fog from getting too extreme

? fog > 0.8 : fog = 0.8

overcast = random 1

clientSetWeather = 1

publicVariable "fog"

publicVariable "overcast"

publicVariable "clientSetWeather"

***

Then you'd have a trigger with the condition "clientSetWeather == 1", and the activation "fog setFog 0; overcast setOvercast 0".

You could also add a randomness to starting time, using the skipTime command.

- PlaneShifter -

Share this post


Link to post
Share on other sites

If you don't like using tons of variables, I bet the condition "(fog != nil) && (overcast != nil)" would work, or whatever it is you would use to check if those variables were actually given a value.

- PlaneShifter -

(Edited by PlaneShifter at 1:43 am on Dec. 13, 2001)

Share this post


Link to post
Share on other sites

great suggestion PlaneShifter:

Perhaps we can use the information of this thread

in the near future to collect all problems and solutions

here to let anyone make a MP editing tutorial (i would,

but i think there are still a lot of specific english words,

which i don't really know)

Share this post


Link to post
Share on other sites

here is the next one:

Yesterday i created a script, which is executed

by 2 human controlled player (again by addaction).

The script adds everytime it runs "1" to a variable,

which starts with value "0". I displayed the value

of the variable by the "hint" command onto screen.

I started it the first time on my host pc, i got the

value "1" on my host screen (not on client).

Then i executed it on client screen, i got the value

"2" on my client screen (not on host screen).

So i think we can add the hint display problem to

the side/global (and so on) -chat diplay problem.

btw - the variable, which increases by adding "1"

from script i made always public, therefore i got

always the right value displayed (but everytime

only on the executing screen).

Share this post


Link to post
Share on other sites

titletext from trigger's effect menu:

I made 2 triggers, one activated by west present,

the second one by a variable from a script.

Both triggers should display the same titletext

message (by using the effect menu from the trigger).

When any soldier (host or client) entered the first

trigger's area, the titletext was displayed on both

sides (host and client).

When the second trigger was activated by the script

variable, it was only showing up on the screen, which

executed the trigger.

I think PlaneShifter solved this problem above by telling

us how to use the publicVariable (i just want you

let to know).

thx PlaneShifter

Share this post


Link to post
Share on other sites

I tested following on my 2 PC LAN :

I created a map with 2 west soldiers:

JK1 JK2 (name of the 2 soldiers)

I created an init.sqs file where i typed:

ok=0

publicVariable "ok"

I tested the difference of how to activate a trigger.

I mean, these 2 ways:

trigger 1 activated by west

present (in condition field: this)

In on activation: JK1 sidechat "blabla"

when i entered the area with one of the 2 soldiers

the sidechat message was displayed on both

screens (client and host)

trigger 2 activated by variable

in condition field: start == 1

in on activation field: ok=0; publicVariable "ok"; JK1 sidechat "blabla"

i used the addaction command to allow both soldiers

to execute a script, in which i wrote this:

ok=1

publicVariable "ok"

the sidechat message was only displayed on

the screen, from where i executed the action command

my next step was to use only one trigger with both

ways to activate

i created a trigger with activation: west present

and in condition field i typed: this or ok == 1

on activation: ok=0; publicVariable "ok"; JK1 sidechat "blabla"

while testing i activated this trigger only by using

the action command (not by entering trigger area)

and my result was, the sidechat message was displayed

sometimes on both screens and sometimes only on the

executing screen

I also executed the action command twice of triple,

the result was: the sidechat message was displayed

at least once on the not-executing screen

btw - all triggers i used, were set to activate repeatedly

Share this post


Link to post
Share on other sites

A clarification, DV:

The chat commands are supposed to show their messages on all corresponding computers (ie. global SHOULD show up on ALL computers), and this doesn't happen.  This is a bug.

However, hint & titleText are *supposed* to only show text on the computer executing the command.  So that isn't a bug.

BTW, to everyone else posting on this forum: http://www.ofpeditingcenter.com has an awesome editing forum (actually, it has 5 editing forums, one specifically for MP editing).  You can get tons more information there.

- PlaneShifter -

(Edited by PlaneShifter at 5:08 pm on Dec. 14, 2001)

Share this post


Link to post
Share on other sites

Come on editor's!

Am i the only one (except Space Cadet & Plane Shifter),

who experienced differences between SP & MP

editing?

Don't let this thread die.

btw - let's hope some of the problems will be fixed

by upgrading to 1.4 (hope hope hope)

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
Sign in to follow this  

×