Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Posts posted by meatball

  1. Also, this may be just my opinion, if a player takes a critical amount of damage there should be no guarantee they can be brought back. This is usually along the lines of a large explosion nearby or a 12.7mm round to the face.

    Depends on the mission in my mind. Certain missions types/styles really are just better if players can't die, but can still lose if everyone is knocked out. Every Escape mission for example. Would suck to die from an explosion and have to wait two hours for your friends to finish up. All that does is lead to people restarting the mission if someone dies or some people not being able to play for long stretches.

  2. Script looks great and I've just started working with it. Trying to understand tcb_ais_revive_guaranty. If that's set to true, that appears to mean that 99% of the time, the player will 'go down' but be revivable. It possible to make that 100%? I basically don't want the players to ever truly 'die', but only go into agony. Then if all players are in agony and down, I'll then end the mission.

    As a related note, if folks want to set up a mission trigger to end a mission if all players are 'in agony', just set up a trigger with this as the condition:

    {_x getVariable "tcb_ais_agony"} count units playergroup == count units playergroup;

    Just swap 'playergroup' for whatever group you have all the players in.

  3. Been working out a few bugs I've found and before I fully publish a v 1.0 and I wanted to throw a version out there for folks to test. Let me know if you run into anything with this version.

    ---------- Post added at 15:43 ---------- Previous post was at 15:42 ----------

    Ok, i'd like to see this. Personally, sometime I stay 3 or 4 minute on a spot to see wath's going to happen, but no ennemy spawn at all. Very frustrating, because I feel a huge potential.

    Edit : ok, I tried on a local server, it worked. But on a dedicated server, there is no AI spawning at all.

    Think I've got this worked out. Just so you know though, the enemy patrols/spawn won't occur at all until you complete at least one task. Figured I'd give folks a little bit of time to get settled into the mission :)

  4. Great work Meatball n co. Can I make a suggestion? I would like to see a snow only version minus the rain for winter maps.

    Without pulling apart the entire script the easiest way I can think of to do that would be to edit the Weather Templates array and remove the rain templates from the Possible Weather Forecasts arrays. So, where Overcast could go to [0,1,2,8], remove the 2, so it can never get to Light Rain, same with Light Fog and Light Snow. You'll also have to tweak the parameter settings to not allow the players to pick Rain as an initial forecast if you do that as well.

    Jman;2619122']I'm sorry to rain on your parade (excuse the pun) but your script will not sync on clients.

    No offense taken :) I guess it's your definition of what 'synch' means. I've tested this script in missions that last a couple of hours with 4-6 people playing and everyone's weather stays the same. It's may not be exact (someone may see rain ten seconds before someone else), but it's worked great for us. JIP clients will start with the most current weather pattern and will be 'caught up' the next weather cycle that goes out to everyone.

    As for setWaves, setGusts, setWindForce, setLightning, I just think that's a lot of additional overhead in the script for something the engine does by default when the conditions are right.

    I agree though, and I think any weather script is just a kludge until BI truly synchs weather effects real time. In the meantime we just have use scripts to force every client to certain weather parameters at set intervals.

    Have you tested it and found it get really out of synch?

  5. Hey, sounds like a really good script, thanks for the work. Just one Question though, does it affect the way the wind behaves in any way? Because right now things as galz wind ballistics do not make a lot of sense with the way the wind behaves as it is not synchronized between clients and changes around like crazy every 2 seconds.

    Yes, wind does update and get synch'd out to everyone with every weather shift.

    I don't think weather has to be "random". For example aÑcording to the climat of Altis it should be clear weather most of the time with rare light rain. And not a tropic rain every half a hour.

    Is this script completly random?

    No, it's not completely random. Here's the basic gist of it. There are 10 pre-set weather 'templates', Clear, Overcast, Light Rain, Medium Rain, Rainstorm, Light Fog, Medium Fog, Dense Fog, Light Snow, Medium Snow and Blizzard. Every 20 minutes the weather has a chance to shift to another one of the weather templates, but it's set so the shifts make sense and each template can only move to other specific templates that make sense. For example, if you are currently at medium rain, you can possibly stay at medium rain, move to light rain, or move to rainstorm. So it's not drastic shifts in weather. Take a look in the script and I think I have it pretty well documented so it makes sense, but let me know if you have any questions.

    Do you plan making it so the snow can collect on the ground simliar to this?

    i think one of the ACE guys said it was possible in the new engine.

    Yeah, I've seen that, and I think it would be awesome, but I believe that actually requires a full mod as opposed to just a script, so right now I really wanted to keep this a simple script. To be honest, snow is somewhat of a kludge, having to use particle effects that 'surround' the player, which is a shame. It'd be really nice if BI just created a new model for snow flakes and used the rain or snow model based on a temperature setting in game :) Other than the noise/model, there's no reason snow couldn't use the same code and behave the same way rain does, just with a different model/sound effect.

  6. randomWeather2 Script

    Completely Rewritten Random and Player Selectable Weather Script for SP/MP Missions

    by Meatball

    Assistance with snow coding by NeoArmageddon






    A simple/single script that allows you to add dynamic random weather for any SP/MP mission with the capability for players to choose initial weather settings.


    - Completely rewrote the original randomWeather script from the ground up to make use of functions as opposed to continuously running loops.

    - There are Clear, Overcast, Rain and Fog weather templates that the server will use to create dynamic weather forecasts every 20 minutes and then synchronize out to clients.

    - Compatibility with parameter setup so players can choose initial weather settings.

    - Test Script/Mission available with snow, but there are some bugs/limitations with it.

    - Demo Missions available to show weather in action.


    1) Copy randomWeather2.sqf into the root of your mission folder.

    2) Add the following to your init.sqf so it will run on the server and all clients.

    execVM "randomWeather2.sqf";

    3) If you'd like, you can add a 'parameter' in your description.ext file to the 'class Params' section to allow players to select the initial weather.

    class Params
          // paramsArray[0]
             class initialWeatherParam {
             title = "Starting Weather";
             values[] = {0,1,2,3,4};
             texts[] = {"Clear","Overcast","Rain","Fog","Random"};
             default = 4;

    NOTE: If you have multiple parameters in your 'class Params' section and you do not put the initialWeatherParam as the first parameter in that section, you must update the rw2Param number (Line 63) in your randomWeather2.sqf file to match the correct number. Remember that 'selecting' values from the parameter section of your description.ext always starts at 0 for the first defined parameter and goes up from there. So if your initialWeatherParam parameter is first in the class Params section, rw2Param = 0; will work. If it is second in the list of class Params you'd need to change it to rw2Param = 1; and so on.

    For more information on Parameters, please see the description.ext biki



    - I've gone through a major change/update with randomWeather2 and removed snow from the 'default' version. There is a crash to desktop bug that can surface when it is snowing and a player respawns. I believe it's related to the known Physx crash bug and caused by a snow particle being in the players body when they die/respawn.

    - While the new v0.9 script does not include snow, I have included a version with snow for anyone that wishes to still use it or wants to experiment with it.

    - I will not be supporting or updating the snow based version going forward unless BI fixes the underlying bug.

    - Tweaked some settings to ensure that it is actually 'raining' when the mission starts if rain is selected.

    - Made a minor adjustment to the initial weather setup to ensure clouds are created properly.

    - Tested on stable build v1.12.


    - Minor fix to code to disable snow underwater.

    - Added in 2 additional changes to snow code to allow the disabling of snow based on player altitude & day or night. Both are disabled by default but can be enabled on lines 236 - 240.


    - Stopped snow from occurring when the player is underwater.

    - Found a random crash bug caused by the snow particle effects and revive scripts (think it has to do with the overall Physx Crash Bug). Updated the snow script and it should fix any Crash to Desktop problems you've been having.


    - First Public Release

    Credits & Thanks:

    - NeoArmageddon for lot's of help including a lot of the snow related code.

    Latest Version:

    - Armaholic (Thanks guys!): randomWeather2 Script

    • Like 1

  7. I've been working with some tweaking on AI. There probably are AI, the issue is they spawn around the players at range, and if the players move quickly, they can easily outpace the enemies. It's a balance between spawning random AI close enough to the players that they run into them, but not close enough that the players suddenly see enemy pop up before their eyes.

    I have a new version just about ready. Just putting some final tweaks on a few things including a little surprise with weather :)

  8. I tried that, but it's actually crashing to desktop with that. Here's a little bit more background. I've got the script that creates particles around the players using functions. One function call will actually start the particles.

    fnc_part_start = {
           _unit = _this select 0;
           _emitter = [_unit] call fnc_part_getEmitter; // Function to check if the emitter exists, and if not, run another function to initialize the emitter and attach it to the player.
    _emitter setDropInterval 0.0009;
    _partEH = _unit addEventHandler ["killed", {[player] call fnc_part_start;}];		

    You'll notice I switched to respawn instead of MPRespawn (have also tried killed/MPKilled), because the MP versions were actually crashing Arma to desktop.

    Additionally, I'm using BTC revive, which I know uses some killed eventhandlers. Not sure if that could be crashing it.

  9. Think I found a bug, seems to be repeatable, but wondering if anyone else can verify.

    1) Set the player invulnerable (player allowdamage false;)

    2) Drop the player from height.

    3) Don't use/open a parachute...

    Basically what I've found is you'll hit the ground and stay stuck in the spread eagle parachuting animation. You can throw grenades, switch weapons, etc., but you can't move or change the animation.

  10. Know this is an old thread, but running into this problem as well and I know what's causing it, just can't seem to get around it. For simplicity sake, here's the basic script:

    _backpack = backpack player;
    removeBackpack player;
    sleep 5;
    player addBackpack _backpack;

    If the player has a backpack originally, works fine and re-adds the backpack. But, if the player initially did not have a backpack, the game spits out a generic "Bad Vehicle Type" error when it goes to add the backpack for those players. So, I tried to remedy that with changing the last line to:

    if (!isNull _backpack) then {player addbackpack _backpack;}; // Also tried !isNil here

    This gets rid of the error message for players without a backpack, but...it doesn't add back the backpack for players that did have one. Any thoughts?

    • Like 1

  11. I made some edits to Zealot's script to make it spawn all the civilian vehicles, seemed to work fine for me.

    // v1c Civilian Vehicles from [sTELS]Zealot
    if(!isServer) exitWith{};
    zlt_civveh_round = 0;
    zlt_civveh_vehicles = [];
    zlt_civveh_spawnedloc = [];
    zlt_rnd_seed = 1;
    zlt_fnc_random = {
     private ["_a","_c","_m"];
     _a = 75;
     _c = 0;
     _m = 65537;
     zlt_rnd_seed = ( zlt_rnd_seed * _a + _c ) mod (_m);
     (zlt_rnd_seed / _m) ;
    zlt_fnc_selectrandom = {
    _this select floor ( ([] call zlt_fnc_random) * count (_this));
    zlt_fnc_civvehs = {
    _debug = [_this, 1, false] call bis_fnc_param;
    _lrange = _this select 2;
    _cars = _this select 3;
    _t1 = diag_ticktime;
    _startpos= _this select 0;
    _houses = _startpos nearobjects ["House",_lrange];
    //_vehmax =  _cars;
    _vehmax = 	(round ((sqrt (count _houses)) * 0.5)) max 1;
    _classes = ["C_Offroad_01_F","C_Quadbike_01_F","C_Hatchback_01_F","C_Hatchback_01_sport_F","C_SUV_01_F","C_Van_01_transport_F","C_Van_01_box_F","C_Van_01_fuel_F"];
    _vehs = 0;
    _attemps = 0;
    zlt_rnd_seed =  ((_startpos select 0) + (_startpos select 1) mod 65537);
    while {_vehs < _vehmax and _attemps < 10} do {
    	_class = (_classes call BIS_fnc_selectRandom);
    	//diag_log ["CV",_startpos, _lrange, _houses];
    	_house = _houses call zlt_fnc_selectrandom;
    	_housepos = _house modeltoworld [0,0,0];
    	_newpos = _housepos findEmptyPosition [ 3 , 15, _class ];
    	_houses = _houses - [_house];
    	if (count _newpos == 0) then {
    		_attemps = _attemps + 1;
    	} else {
    		_veh = _class createVehicle (_newpos ) ;
    		_veh setvariable ["zlt_civveh", true];
    		zlt_civveh_vehicles set [count zlt_civveh_vehicles, _veh];
    		_direction = (random 360);
    		_nearRoads = _newpos nearRoads 10;
    		if(count _nearRoads > 0) then
    			_road = _nearRoads select 0;
    			_roadConnectedTo = roadsConnectedTo _road;
    			if (count _roadConnectedTo > 0) then {
    				_connectedRoad = _roadConnectedTo select 0;
    				_direction = [_road, _connectedRoad] call BIS_fnc_DirTo;
    		_veh setdir _direction;
    		_attemps = 0;
    		_vehs = _vehs + 1;
    		if (_debug) then {
    			["crt"+str(_newpos), _newpos] call zlt_fnc_createmarkerlocal;
    _t2 = diag_ticktime;
    if (_debug) then {
    	diag_log str ["civeh.sqf", _t2-_t1];
    zlt_civ_checkloop = {
    zlt_civveh_notemptyloc = [];
    	_veh = vehicle _x;
    	_isInVeh = (vehicle _x != _x);
    	// or _veh getvariable ["zlt_civ_round", -1] != zlt_civveh_round
    	if (not _isInVeh or {(_veh getvariable ["zlt_civ_round", -1]) != zlt_civveh_round and _veh isKindOf "LandVehicle"}) then {
    		_dist = 1000;
    		_locations = nearestLocations [(getpos vehicle _x), ["NameCityCapital","NameCity","NameVillage"], _dist];
    		_locations2 = nearestLocations [(getpos vehicle _x), ["NameCityCapital","NameCity","NameVillage"], 2500];
    			if ( not (_x in zlt_civveh_spawnedloc) ) then {
    				_lrange = 50; _cars = 1;
    				switch (type _x) do {
    					case ("NameCityCapital") : {_lrange = 250; _cars = 7;};
    					case ("NameCity") : {_lrange = 150; _cars = 3;};
    				_pos = position _x;
    				[ [_pos select 0, _pos select 1, 0], false, _lrange, _cars] call zlt_fnc_civvehs;
    				zlt_civveh_spawnedloc set [count zlt_civveh_spawnedloc, _x ]; 
    //					_x setside east;
    		} foreach _locations;
    			zlt_civveh_notemptyloc set [count zlt_civveh_notemptyloc, _x];
    		} foreach _locations2;
    		if (_isInVeh) then { _veh setvariable ["zlt_civ_round", zlt_civveh_round];};
    } foreach playableunits;
    	_pos = [(position _x) select 0, (position _x) select 1, 0];
    	_ent = ( (_pos) nearEntities [["C_Offroad_01_F","C_Quadbike_01_F","C_Hatchback_01_F","C_Hatchback_01_sport_F","C_SUV_01_F","C_Van_01_transport_F","C_Van_01_box_F","C_Van_01_fuel_F"], 300] );
    		if ( _x getvariable ["zlt_civveh", false] and {count crew _x == 0 and fuel _x == 1}) then {
    			deletevehicle _x;
    	} foreach _ent;
    	zlt_civveh_spawnedloc = zlt_civveh_spawnedloc - [_x];
    } foreach (zlt_civveh_spawnedloc-zlt_civveh_notemptyloc);
    zlt_civveh_round = zlt_civveh_round + 1;
    while {true} do {
    //scan loop
    sleep 3.4; //magic number
    [] call zlt_civ_checkloop;

  12. Hmm, I'm not sure what's happened, but suddenly my A3 crashes every time my player gets knocked out ('dies') but before he respawns to be revived. Was working fine last night and I wonder if the hotfix caused any issues. It's definitely something to do with the way BTC handles respawn as I can mess with RespawnDelay in my description.ext and delay the crash on death for as long as I put in for a delay.

    Anyone else getting any issues?

  13. Believe I figured it out. Basically I had units in game with the this setDamage 1; to kill them to leave a few bodies around, but I'm also using Shuko's moveObjects script to move them around the map. What I'm guessing happened is the mission started, the setDamage on the units kicked in, and while the bodies were ragdolling to the ground, the moveObjects script fired and moved the unit/body elsewhere on the map, which left some sort of stretching graphic artifact on the moved body that actually appeared to be coming from the direction they were moved from.

    I simply put the units in, and then ran a small script to setDamage 1; to all of them _after_ the move and no more glitches...

  14. Yes, that works to start a game with a specific type of weather, but it doesn't help if you want to allow for random changes in weather from mission to mission or even during a mission.

    Some more followup to testing.

    Starting at 0.0, 0 setOvercast 1: Moves up ~ 0.0167/Minute

    Starting at 0.2, 0 setOvercast 1: Moves up ~ 0.0131/Minute

    Starting at 0.4, 0 setOvercast 1: Moves up ~ 0.0099/Minute

    Starting at 0.6, 0 setOvercast 1: Moves up ~ 0.0066/Minute

    Starting at 0.8: 0 setOvercast 1: Moves up ~ 0.0033/Minute

    Doing the reverse inverses the numbers (moving from 0.8 -> 0 at 0.0131, etc.) and there's definitely a pattern here. But even with the pattern, there's no way to use it because if you change the transition time, it throws it off. For example, starting a 0 and moving to 1 you get to 0.2 overcast in 20 minutes. Yet...if you toss in the command 1200 setOvercast 0.2;, (1200 seconds = 20 minutes) after the transition you are only up to .066 overcast (0.0033/minute).

    Le sigh...

  15. Anyone running into a graphical glitch with 'bodies' that are pre-placed in a mission by using 'this setdamage 1;' on them? They seem to be stretched way out and you can't interact with their inventory at all.

    This seems to have only started since the last patch and does not seem to happen for any bodies from units killed in the actual mission, only for those 'pre-placed' bodies. This also only happens when the mission is hosted on a dedicated server, but not when hosted locally.