Jump to content
Sign in to follow this  
proxemo666

sp vs mp scripting

Recommended Posts

Ok. So I decided that I wanted to test my map that I made. Got all the scripts working fine and everything. I've only tested this in the editor though. I decide to host it online on my box and now crap hits the fan. None of my scripts work, I received an error where I needed to add a gamelogic and call it server (which I did) and it is saying that one of my scripts (xxx.sqs is not found) when it is in the folder. I have no idea what the deal is.

A quick search resulted in the differences between local and server. I'm a noob at this so please explain this to me in english and not refer me to another link unless the link is server scripting for dummies. I have searched and found the link that explains it but it didn't help me as far as coding it to get this to work.

My problem is:

Why are my scripts not working? (I know there is a difference between local vs server) but I have no clue.

Why is it saying I'm missing a script file when it is in there?

Here is an example of one of my scripts:

i.e.

--------------------------------------------

test.sqs:

hintC "blah blah blah."

I then create a trigger, set parameters (act. by blufor, etc) and in the activation line put:

this exec [test.sqs];

----------------------------------------

I want the hintC command to be read on everyone's PC even if they do not activate it themselves.

In SP, it works great. In MP, I could walk and do backflips over the trigger and nothing happens. This is a simple script.

I am using Arma Edit for this. I also just noticed that my "wizard created custom crates" in Arma edit do not work. NOTHING WORKS in MP.

Share this post


Link to post
Share on other sites

I struggled with this a bit for a start too. The key for me grasping the concept of locality, was to first consider what I wanted to achieve, then to consider the locality I wanted to achieve it in, and finally find the script combination that would work.

You can use the publicVariable command to distribute a variable to all the connected computers. I use this when distributing the outcome of completing a mission objective, so that when one individual has completed it, the result is broadcast to all. When a player joins, I often have a trigger that is activated only by the server (?IsServer == true etc...) that again publishes the variable.

Also, check that you have packaged the mission file correctly, as if you change the mission name you will need to recopy the scripts. I manually package the file and move it from my SP missions to my MP missions and ensure all the scripts are there.

Share this post


Link to post
Share on other sites
When a player joins, I often have a trigger that is activated only by the server (?IsServer == true etc...) that again publishes the variable.

How do you make the server detect when a new player is joining?

ZNorQ

Share this post


Link to post
Share on other sites
How do you make the server detect when a new player is joining?

I add an any (or BLUFOR/OPFOR) trigger in the editor at the spawn point, that activates a script (with an IsServer check). This way, for example, with a player joins in progress the server knows and can publish any variables.

Share this post


Link to post
Share on other sites

icemotoboy I think the problem stems from the repackaging hint you told me. I named the mission "test" when I first started to make it and when I wanted to test it, I named it something else. When I saved the mission under the original name (test), everything worked! I still got the game logic error which I should be able to fix with no problems.

I know you mentioned repackaging and what you did but I am still a little confused. How do you "repackage" the scripts? I don't quite follow what you said about "manually package the file and move it from my SP missions to my MP missions and ensure all the scripts are there".

Do you first save the file to SP missions and then copy and paste the mission folder into MP and then make a pbo out of it?

Thanks in advance.

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  

×