Welcome to Tactical Gamer

+ Reply to Thread
Results 1 to 9 of 9
Discussion: ArmA - Development / ArmA - Mission Development - Fog script MP question... - I recently downloaded a fog script from armaholic. Can someone check it out and tell
  1. #1

    Mikee's Avatar

    Join Date
    Jun 2009
    Location
    Naugatuck, CT | USA
    Posts
    619

    Question 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.  
  3. #2


    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    737

    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.

  4.  
  5. #3

    Fincuan's Avatar

    Join Date
    Jan 2009
    Location
    Helsinki, Finland
    Posts
    772

    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;
    };

  6.  

     
  7. #4

    nthamma's Avatar

    Join Date
    Jul 2008
    Location
    Houston, Tx
    Age
    23
    Posts
    338

    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


  8.  
  9. #5

    Fincuan's Avatar

    Join Date
    Jan 2009
    Location
    Helsinki, Finland
    Posts
    772

    Re: Fog script MP question...

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

  10.  
  11. #6

    nthamma's Avatar

    Join Date
    Jul 2008
    Location
    Houston, Tx
    Age
    23
    Posts
    338

    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


  12.  

     
  13. #7

    Mikee's Avatar

    Join Date
    Jun 2009
    Location
    Naugatuck, CT | USA
    Posts
    619

    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?

  14.  
  15. #8

    nthamma's Avatar

    Join Date
    Jul 2008
    Location
    Houston, Tx
    Age
    23
    Posts
    338

    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


  16.  
  17. #9

    Mikee's Avatar

    Join Date
    Jun 2009
    Location
    Naugatuck, CT | USA
    Posts
    619

    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 .

  18.  

     

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


  
 

Back to top