Announcement

Collapse
No announcement yet.

Fog script MP question...

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fog script MP question...

    I recently downloaded a fog script from armaholic. Can someone check it out and tell me if it will start up on all clients, depending on how many players we got, or will just start once. I don't want the script to be executed as many times as many players we got, because it will cause huge lag.

    Code:
    ;Yac 2009 - ArmA ][ - fog script
    ;===============================
    _Center = _this select 0
    _dist1=_this select 1
    _dist2= _this select 2
    
    _height=-0.3
    _Rradius=250
    #bigloop
    @(Player distance _Center)<_dist2
    _i=0
    #loop
    _Cloudalpha=1
    ?((Player distance _Center)>_dist1):_Cloudalpha= 1-(((Player distance _Center) - _dist1)/(_dist2- _dist1))
    _radius=(random 10)+random _Rradius
    _angle=(random 360)
    _size = 5
    _col = 1
    _CC=[_col,_col,_col,.3*_Cloudalpha]
    drop ["\ca\data\cl_basic", "", "Billboard", 8+random 1,8+random 1,  [(getpos Player select 0)+_radius*(sin(_angle)),(getpos Player select 1)+_radius*(cos(_angle)),_height],[0,0,0],5 , 0.2, 0.1568, 0,[_size], [[_col,_col,_col,0],_CC,_CC,_CC,_CC,_CC,_CC,[_col,_col,_col,0]], [0],0,0,"", "",""]
    _i=_i+1
    ?(_i<1800):goto "loop"
    ~1
    goto "bigloop"
    It basicly creates fog around gamelogic, nothing to do with triggers, etc...

  • #2
    Re: Fog script MP question...

    BURN IT WITH FIRE!!

    ...

    *ahem*

    Sorry, but those damn SQS scripts just won't go away.

    The main command in this script is the "drop" command ( http://community.bistudio.com/wiki/drop ). It is a local command, so, it needs to be run on each client.

    Comment


    • #3
      Re: Fog script MP question...

      Fyi, here's how BIS created the fog in "Delaying the bear". This needs to be run on each client. In the example snippet fog is only created when overcast is high enough, but you can ofcourse tweak the conditions to your liking.

      init.sqf
      Code:
      [] execVM "fog.sqf";
      fog.sqf
      Code:
      //From "Delaying the Bear"
      //Create volumetric fog if weather is bad enough at mission start
      #define FOG 0.6
      if(overCast > FOG) then
      {
      	_pos = position vehicle player;
      	_ps = "#particlesource" createVehicleLocal _pos; 
      	_ps setParticleParams [["\Ca\Data\ParticleEffects\Universal\universal.p3d" , 16, 12, 13, 0], "", "Billboard", 1, 10, [0, 0, -6], [0, 0, 0], 1, 1.275, 1, 0, [4], [[1, 1, 1, 0], [1, 1, 1, 0.04], [1, 1, 1, 0]], [1000], 1, 0, "", "", _obj];
      	_ps setParticleRandom [3, [40, 40, 0], [0, 0, 0], 2, 0.5, [0, 0, 0, 0.1], 0, 0];
      	_ps setParticleCircle [0.1, [0, 0, 0]];
      	_ps setDropInterval 0.01;
      
      	while {overCast > FOG} do
      	{
      		waituntil {vehicle player == player};
      		_ps setpos position vehicle player;
      		sleep 1;
      	};
      	
      	deleteVehicle _ps;
      };

      Comment


      • #4
        Re: Fog script MP question...

        The lack of comments in the coding makes it very difficult to understand the exact functionality of the script. But glancing at it, it makes use of the scripting command "player" in which case if this is run in a dedicated server, it will create a particle effect depending where "player" is. In multiplayer ArmA, "player" returns a unique value depending on the client so therefore the creation of the particle (which is called by the command "drop" in the script) is a function of the number of players in the server. In other words, it will create an amount of fogs depending on how many players are connected to the server.

        NOTE: I just glanced through the code so this is just a theory. You're better off just testing it with multiple clients connected at once.

        Hope that helps! Happy editing!

        EDIT: I just realized that the "drop" command is broadcasted locally so therefore it will only create that particle effect client side so it should not be a problem. Happy editing!


        IN GAME ARMA: |TG-Irr| Lq.Snake

        Comment


        • #5
          Re: Fog script MP question...

          Actually it won't do much on a dedicated server, because player is always null on a dedi-server.

          Comment


          • #6
            Re: Fog script MP question...

            Yeah, I meant to say that the script would only affect the local client that is connected to the dedicated server since "player" doesn't exist in the actual server.


            IN GAME ARMA: |TG-Irr| Lq.Snake

            Comment


            • #7
              Re: Fog script MP question...

              So, I understand that if I run this script in the mission, it will not be executed 20 times at once (20 players), but separately on each client local?

              Comment


              • #8
                Re: Fog script MP question...

                that's correct Mikee. The drop command broadcasts locally on each separate clients so it will only create that particle effect once on each individual machine.


                IN GAME ARMA: |TG-Irr| Lq.Snake

                Comment


                • #9
                  Re: Fog script MP question...

                  Thank you guys, I've been working on one Coop mission for a while. Expect something unusual, there is no mission such as this on TG Server :).

                  Comment

                  Connect

                  Collapse

                  TeamSpeak 3 Server

                  Collapse

                  Advertisement

                  Collapse

                  Twitter Feed

                  Collapse

                  Working...
                  X