Results 1 to 6 of 6

Thread: How to stop JW Custom Weather script

  1. #1

    How to stop JW Custom Weather script

    After days of searching and reading hundreds of posts, I give up. I am a noob as far as functions go. I have tried declaring a variable- SandStrm=true; publicVariable "SandStrm"; - and replacing the true in the "while {true} do" statement. I have declared the variable in the init.sqs, init.sqf, and at the beginning of the sandstorm script. But when ingame and setting the variable to false does not stop the sandstorm. The vanilla OA mission will be MP on a dedicated server with JIP and respawn into the initial units that are set to "Playable". I know this is probably something simple and I will be embarrased when I find out. Thanks for any help.

    PHP Code:
    //Light sandstorm script by JW
    //Fog effect from delaying the bear edited to mimic a light sandstorm.

    _pos position player;

    _sand1 "#particlesource" createVehicleLocal _pos
    _sand1 setParticleParams [
       [
    "\Ca\Data\ParticleEffects\Universal\universal.p3d" 1612130], """Billboard"110
       [
    00, -6], [000], 11.27510
       [
    7,6], [[0.7970.6760.4450], [0.7770.6480.4020.04], [0.7700.5980.4340]], [1000], 10""""_pos
    ];
    _sand1 setParticleRandom [3, [55550.2], [00, -0.1], 20.45, [0000.1], 00];
    _sand1 setParticleCircle [0.001, [00, -0.12]];
    _sand1 setDropInterval 0.0001;


    while {
    true} do
    {
    _pos position player;
    _sand1 setpos _pos;
    sleep 2;
    }; 
    Thanks to JW Custom for the weather scripts. My family, brothers-uncles-kids, play MP coop ARMA2: OA together every week. Everyone enjoys the atmosphere your scripts help create.

  2. #2
    Four days and no help. I guess scripts like this can not be stopped. They must run until you shut down the sim, maybe even longer!

  3. #3
    Second Lieutenant Kremator's Avatar
    Join Date
    Jun 8 2007
    Location
    Cambridge, UK
    Posts
    4,970
    Ever thought to PM the actual author ?

  4. #4
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    Code:
    while {true} do {
    could easily be:
    Code:
    SandStrm = true;  // or add this line in init.sqf or a object init, just needs to be activated before this script line.
    while {SandStrm} do {
    now when you do this in a trigger or another script:
    Code:
    SandStrm = false;
    publicVariable SandStrm;
    it should stop and you should delete the particles like this:
    Code:
    while {SandStrm} do
    {
    _pos = position player;
    _sand1 setpos _pos;
    sleep 2;
    };
    deleteVehicle _sand1;  // this will delete the particle.
    My scripts:
    Spoiler:

    what to do when posting any kind of code dammit!!

    Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

  5. #5
    Sorry, posts seem to go by fast in the summer A way to stop a script is by using termiante on the scripts handle, but in this case you also have to delete the particle (deleteVehicle as Demonized says).

    Just a variation on dusty conditions I use in my Domino edit. Not exactly a sandstorm, but when combined with blur when looking into the wind, it's annoying enough to serve the purpose. Makes weather have more of an impact:
    Code:
    [] spawn {
    	while {true} do {
    		if (rain == 0) then {
    			_obj = vehicle player;
    			_pos = getPosASL _obj;
    			_multiplier = 1 + (_pos select 2) / 1400; //means wind effect is 1.5x at 700 meter altitude.
    			_velocity = [_multiplier * (wind select 0), _multiplier * (wind select 1),0];
    			_color = [1.0, 0.9, 0.8];
    			_wforce = sqrt ((wind select 0)^2+(wind select 1)^2);
    			_wforce = 0.1 * ((_wforce - 5.55) max 0); //Based on Beaufort scale.
    			_wforce = _wforce * (1 - sqrt(rain));
    			_range = 0.25 * _wforce * _multiplier;
    			_alpha = _range + random _range;
    			_ps = "#particlesource" createVehicleLocal _pos;  
    			_ps setParticleParams [["\Ca\Data\ParticleEffects\Universal\universal.p3d", 16, 12, 8], "", "Billboard", 1, 3, [0, 0, -6], _velocity, 1, 1.275, 1, 0, [9], [_color + [0], _color + [_alpha], _color + [0]], [1000], 1, 0, "", "", _obj];
    			_ps setParticleRandom [3, [30, 30, 0], [0, 0, 0], 1, 0, [0, 0, 0, 0.01], 0, 0];
    			_ps setParticleCircle [0.1, [0, 0, 0]];
    			_ps setDropInterval 0.01;
    			sleep 10;
    			deleteVehicle _ps;
    			sleep 0.1;
    		} else {
    			sleep 10;
    		};
    	};
    };
    Regards
    Carl Gustaffa - left this game due becoming Steam Exclusive

  6. #6
    deleteVehicle _sand1; // this will delete the particle.
    Thanks Demonized and CarlGustaffa.
    Deleting the _sand1 is what I was missing.

Posting Permissions

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