Jump to content
  • 0

Particles spawned on some objects.


Sandbird

Question

I am trying to do something similar to the snow effect like this script : http://opendayz.net/threads/adding-snow-to-your-server.12523/   (I am pretty sure a lot are familiar with it.)

I developed the script in the editor and even tested it on the MPmission (not dayz...simple arma MPmission) and it was working fine.....but then i tried to add it to my epoch test server....and realized that spawning particles from the dayz_server.pbo will not show them on the clients :/

 

I want the server to spawn the particles to whatever object has "setVariable ["particle"] on it. It can be anything....a tent, a car, a box..

Right now I am trying on a vehicle like this...(it works fine in SP)

_veh  = createVehicle[_cClassName,_coords,[],0,"NONE"];
_veh setVariable ["DZAI",1,true];
_veh setVariable ["particle",1,true];
[_veh] execVM "\z\addons\dayz_server\custom\particle.sqf";
And in my particle.sqf i grab the _veh and spawn particles on top of it with the drop command
similar to this
drop ["\ca\data\cl_water", "", "Billboard", 1, 7, _dpos, [0,0,-1], 1, 0.0000001, 0.000, 0.7, [0.07], [[1,1,1,0], [1,1,1,1], [1,1,1,1], [1,1,1,1]], [0,0], 0.2, 1.2, "", "", ""];

Now my guess is that the particles spawn just fine....but they spawn on the server :P. How can i send it to the clients to see ?

The biggest problem is that the objects are created by the server....not the clients....so i cant add this to the missions.pbo since there is nothing there to execute the script.

 

Any ideas?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Particles are client side, so you need to add it to the mission.pbo and have the client checking and adding the particles, not the server.

 

Hi Vamp, yeah i realize that now, but how would the clients see particles over objects the server spawned ?

All this server->client publicVariableServer handles are a bit confusing.

Whats the approximate path to take here....i'll figure the code out.

Link to comment
Share on other sites

  • 0

Just include the script in the mision pbo, use if (isClient) and then make the code check for tents, and then add the particles above them.

 

You would use a foreach checking for the variable, and execute the script on the ones it finds.

 

Thanks,

Would i spawn this script or execVM to run it...and what about resourcing....is this way a bit of a system hog ?

I mean...usually foreach is for nearestobjects or stuff in players inventory...

Having the client to run foreach on all items on the map with kindof Tent....wouldnt it be a bit too much ?

Link to comment
Share on other sites

  • 0

Thanks,

Would i spawn this script or execVM to run it...and what about resourcing....is this way a bit of a system hog ?

I mean...usually foreach is for nearestobjects or stuff in players inventory...

Having the client to run foreach on all items on the map with kindof Tent....wouldnt it be a bit too much ?

 

I would use nearestObjects with a sleep timer before deleteing the particles and re-adding them, maybe within 1200 meters? Anything outside of that they wont see fast enough. It won't be a system hog that way.

 

Something like this.

while {Alive player} do {
    {
        [_x] ExecVM "particles.sqf";
    } forEach NearestObjects ["tents", 1200];

    sleep 300;
};

I know thats not exactly right, but you get the idea.

 

Make sure you get the tent to spawn the particles on in particles.sqf as _tent = _this select 0;

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...