Jump to content
Sign in to follow this  
ZenWarrior

Scripts not working on dedicated server

Recommended Posts

Hi,

i just made an Alpha test of my mission on a dedicated server, and i found out that a huge part of my scripts don´t work on dedicated.

For example:

_Heaparray = [[6560.79, 2962.3, 0],[6610.99, 3053.1, 0],[5626.02, 2084.49, 0],[5629.04, 2082.99, 0],[5698.5, 2091.3, 0],[5592.28, 2213.74, 0],[5670.94, 2179.5, 0],[5577.99, 2152.58, 0],[5659.6, 1767.6, 0],[5587.81, 1648.55, 0],[5666.91, 1652.97, 0],[5371.34, 1533.64, 0],[5372.97, 1582.06, 0],[5138.95, 1598.67, 0],[3750.08, 3413.49, 0],[3853.33, 3309.1, 0],[3843.18, 3465.07, 0],[3606.38, 3585.63, 0],[3602.53, 4442.85, 0],[4284.74, 4337.06, 0],[5220.17, 4836.62, 0],[5765.02, 3424.14, 0],[5230.73, 5588.49, 0],[5227.13, 5590.12, 0],[5814.4, 6069.74, 0],[6299.25, 6467.77, 0],[3912.05, 6611.14, 0],[3455.37, 9016.36, 0],[3215.73, 8733.77, 0],[3214.85, 8739.71, 0],[3215.37, 8745.57, 0],[6237.81, 7845.49, 0],[5279.13, 8130.74, 0]];

for "_i" from 0 to ((count _Heaparray) -1) do

{

_vehicle = objnull;

_pos = _Heaparray select _i;

_vehicle = "Land_Misc_Garb_Heap_EP1" createvehicle _pos;

sleep 0.2;

_vehicle setpos _pos;

_vehicle allowDamage false;

_vehicle addaction ["Search Garbage Heap", "loot.sqf"];

sleep 0.1;

};

The server spawns the objects in the correct position. But they can be destroyed, so allowdamage false does not apply, and the addaction command doesn´t work either.

How can i make it work for all clients?

Share this post


Link to post
Share on other sites

its all to do with locality and how the items are created or where.

to make it easy for you...

best to use handledamage EVH for invulnerability - thread on forums

and to save you time use MultiPlayerFramework with add actions to allow them to be seen by everyone

Share this post


Link to post
Share on other sites

A general tip: always have the biki opened somewhere when your editing, there might be things you want to double check about a command, etc.

from the biki, under multiplayer, here is what it says about each command you are using:

allowDamage:

This command only works locally and must be run on all machines to have global affect.

createVehicle:

In multiplayer, only run this command on one machine. It will create a the vehicle on all machines every time it is called on any machine.

setPos:

Since ArmA 1.08 and later the command is global for every object again.

addAction:

At the top of the page, it shows

when the command first came out

Arguments to addaction must be local to each machine

The Effect of addaction are local to each machine, and are not broadcasted over the network.

theres an article on using the multiplayer framework, that helps broadcast these local commands across the network. I have no experience using it, but it might help you none the less.

http://community.bistudio.com/wiki/Multiplayer_framework

Share this post


Link to post
Share on other sites

Ok, i´ll look into that Multiplayer Framework.

But where can i download it?

Share this post


Link to post
Share on other sites

I believe it's part of the game...although I have never messed around with MP stuff.

Here's another good bit of info:

Command info

The thread this is taken from has some good information in it.

Found another thread for you on the MP Framework:

Multiplayer-Framework-Insight-documentation-discussion

Edited by panther42

Share this post


Link to post
Share on other sites

_Heaparray = [[6560.79, 2962.3, 0],[6610.99, 3053.1, 0],[5626.02, 2084.49, 0],[5629.04, 2082.99, 0],[5698.5, 2091.3, 0],[5592.28, 2213.74, 0],[5670.94, 2179.5, 0],[5577.99, 2152.58, 0],[5659.6, 1767.6, 0],[5587.81, 1648.55, 0],[5666.91, 1652.97, 0],[5371.34, 1533.64, 0],[5372.97, 1582.06, 0],[5138.95, 1598.67, 0],[3750.08, 3413.49, 0],[3853.33, 3309.1, 0],[3843.18, 3465.07, 0],[3606.38, 3585.63, 0],[3602.53, 4442.85, 0],[4284.74, 4337.06, 0],[5220.17, 4836.62, 0],[5765.02, 3424.14, 0],[5230.73, 5588.49, 0],[5227.13, 5590.12, 0],[5814.4, 6069.74, 0],[6299.25, 6467.77, 0],[3912.05, 6611.14, 0],[3455.37, 9016.36, 0],[3215.73, 8733.77, 0],[3214.85, 8739.71, 0],[3215.37, 8745.57, 0],[6237.81, 7845.49, 0],[5279.13, 8130.74, 0]];

[color="#FF0000"]_initcode  = "this allowDamage false; this addaction [""Search Garbage Heap"", ""loot.sqf""];";[/color]

for "_i" from 0 to ((count _Heaparray) -1) do
{
_vehicle = objnull;
_pos = _Heaparray select _i;
_vehicle = "Land_Misc_Garb_Heap_EP1" createvehicle _pos;
sleep 0.2;
_vehicle setpos _pos;
[color="#FF0000"] _vehicle setVehicleInit _initcode;
processInitCommands;
clearVehicleInit _vehicle;[/color]
sleep 0.1;
};

this will make it MP compatible

Edited by Zonekiller

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  

×