Home   Help Search Login Register  

Author Topic: locality and FX scripts  (Read 1238 times)

0 Members and 1 Guest are viewing this topic.

Offline Gnat

  • Addons Depot
  • Former Staff
  • ****
  • I Bite!
    • Gnats
locality and FX scripts
« on: 26 Jul 2008, 04:53:54 »
Hi guys,
I'll start by saying the whole MP / locality thing I have never managed to understand ......

I have a plane, that is using lethals FX scripts, that have been modified to be more useful.

The FX are called from INIT event like this;
Code: [Select]
_script1 set [0, _veh execVM "\myplane\scr\plane_Afterburner.sqf"];not that thats likely to matter much.

The FX script themselves loop like this;
Code: [Select]
...........
...........
while {(alive _plane) and (_this animationPhase "KillFx" == 0)} do {
...........
...........
sleep 0.05;
};

Theres an animation available (KillFx) to terminate the FX script, just in case a user doesn't want it.

NOW .... my wants;
1) I want to NOT start the scripts if the unit was created on the server (unit is local to the server, right?)
2) Is it possible to start the FX scripts on a client machine (so client can see them) if the unit was created on the server?

BTW, if the FX are these types of objects;
Code: [Select]
_leftengine = "#particlesource" createVehicle position _this;and was local to the server, is it likely the clients can see it also?
I've not MP tested obviously, but there are reports these script (maybe different revision) causes MP lag.

(Maybe, maybe all it needs is modification so the scripts only run on the server OR the client, not potentially all machines)

THx!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: locality and FX scripts
« Reply #1 on: 26 Jul 2008, 17:49:22 »
Is not that you dont want to start the script on the server, as the server might have a player too if not dedicated, is that you dont want to start the script if a player is not present. In fact, the player, even if present, might quite far away from the plane, and in that case you dont need to execute anything (except if you have a camera watching at the plane). But to make things simpler, just consider the exitance of a player. Something like:
Code: [Select]
// Init EH of your plane
while {!alive player} do
{
   Sleep 2;
};

// Here proceed with the effects

Offline Gnat

  • Addons Depot
  • Former Staff
  • ****
  • I Bite!
    • Gnats
Re: locality and FX scripts
« Reply #2 on: 01 Aug 2008, 13:24:14 »
Thx Mandoble, sounds like a plan  :good: