Jump to content

Grumpy Old Man

Member
  • Content Count

    4313
  • Joined

  • Last visited

  • Medals

Posts posted by Grumpy Old Man


  1. The static weapon support is currently bugged, I tried to fix it a few times and can't put my finger on what's going wrong.

    Need to revisit this when I have more time and probably split the static weapon support into a seperate script.

    For now my spare time is very limited and I'm focusing on my campaign but I'll definitely continue to support this script (since the current dev version has player modules for all arty related roles and has undergone a major rewrite) ;)

    Cheers


  2. Hey folks,

    just something minor I stumbled across but unpleasing non the less:

    When I create a marker within a script and add a diary entry and a task containing the marker the text is greyed out but unclickable, or there just isn't anything happening when clicking on it.

    When I create a marker in the editor it's working just fine, no matter the markerType.

    The marker is appearing like it's supposed to.

    Here's the snippet:

    _mtext = format ["Markertest: <marker name='_mtext'>%1</marker> has %2",name _unit,text _rndsentence];
    
    _m = createMarker [_mtext,[(_locationPos select 0) + random 250,(_locationPos select 1) + random 250]];
    _m setMarkerShape "ICON";
    _m setMarkerSize [1,1];
    _m setMarkerType "hd_warning";
    _m setMarkerAlpha 1;
    _m setMarkerColor "ColorRed";
    _m setmarkertext _mtext;
    
    player creatediaryrecord ["Diary",["Markertest:",_mtext]];
    _nul = [player, _mtext, [_mtext, "Markertest!", ""], _mpos, true] spawn BIS_fnc_taskCreate;

    The marker, task and diary entry are appearing correct, with the markers text greyed out like it's supposed to be, but when clicking on the marker name nothing happens.

    If I place a marker named "enemyBase" in the editor using this line, the diary and task entries are clickable and will zoom the map to the marker, which doesn't happen with the script snippet above.

    player createDiaryRecord ["Diary", ["Intel", "Enemy base is on grid <marker name='enemyBase'>161170</marker>"]];

    Am I missing something?


  3. Well you can repace your spawn lines with these:

    ag1spawn = createVehicle ["I_Plane_Fighter_03_CAS_F",getmarkerpos "ag1spawn", [], 0, "FLY"];
    createvehiclecrew ag1spawn;

    In general I'd change your script to look like this:

    _ag1 = createVehicle ["I_Plane_Fighter_03_CAS_F",getmarkerpos "ag1spawn", [], 0, "FLY"];
    createvehiclecrew _ag1;
    _ag1 allowfleeing 0;
    
    _ag1height = 250;
    _ag1 flyinheight _ag1height;
    _ag1 setpos [getposATL _ag1 select 0, getposATL _ag1 select 1, _ag1height];
    
    _reldir = [getmarkerpos "ag1spawn",getmarkerpos "ag1move1"] call BIS_fnc_dirTo;
    _ag1 setdir _reldir;
    
    waypoint0 = _ag1 addwaypoint[getmarkerpos"ag1move1",0];
    waypoint0 setwaypointtype"Move"; 
    
    waypoint1 = _ag1 addwaypoint[getmarkerpos"ag1move2",0];
    waypoint1 setwaypointtype"Move";
    
    waypoint2 = _ag1 addwaypoint[getmarkerpos"ag1move3",0];
    waypoint2 setwaypointtype"Move";
    
    waypoint0 = _ag1 addwaypoint[getmarkerpos"ag1move1",0];
    waypoint0 setwaypointtype"Move";
    
    waypoint0 setwaypointtype "CYCLE"; 
    
    
    [_ag1, 1] setWaypointSpeed "FULL";
    [_ag1, 1] setWaypointCombatMode "RED";
    [_ag1, 1] setWaypointBehaviour "AWARE";

    Got no access to A3 right now but that should work.

    This way you can run it multiple times.

    You could further advance it to use a marker array instead of having to rewrite the script for everytime you want to use more or less waypoints.

    Cheers


  4. I've got a similar CAS patrol script that I don't want to share yet.

    As you want to improve your own script how about this:

    ag1spawn = [getMarkerPos "ag1spawn", 0, "I_Plane_Fighter_03_CAS_F", INDEPENDENT] call bis_fnc_spawnvehicle;
    ag1air = ag1spawn select 0;	//the aircraft
    ag1crew = ag1spawn select 1;	//the units that make up the crew
    ag1 = ag1spawn select 2;	//the group
    {_x allowFleeing 0} forEach units ag1;
    
    ag1height = 250;
    ag1air flyinheight ag1height;
    ag1air setpos [getposATL ag1air select 0, getposATL ag1air select 1, ag1height];
    
    reldir = [getmarkerpos "ag1spawn",getmarkerpos "ag1move1"] call BIS_fnc_dirTo;
    ag1air setdir reldir;
    
    waypoint0 = ag1 addwaypoint[getmarkerpos"ag1move1",0];
    waypoint0 setwaypointtype"Move"; 
    
    waypoint1 = ag1 addwaypoint[getmarkerpos"ag1move2",0];
    waypoint1 setwaypointtype"Move";
    
    waypoint2 = ag1 addwaypoint[getmarkerpos"ag1move3",0];
    waypoint2 setwaypointtype"Move";
    
    waypoint0 = ag1 addwaypoint[getmarkerpos"ag1move1",0];
    waypoint0 setwaypointtype"Move";
    
    waypoint0 setwaypointtype "CYCLE"; 
    
    
    [ag1, 1] setWaypointSpeed "FULL";
    [ag1, 1] setWaypointCombatMode "RED";
    [ag1, 1] setWaypointBehaviour "AWARE";

    The five lines above the waypoints are probably what you were looking for. ;)

    I used the dirTo functions to make the jet look into the direction of the first marker after spawning.

    The underscore makes variables local to the script only so only the script itself knows what _ag1air is, which is a huge advantage if you want to run a script multiple times within a mission.

    Without underscores the variables are usable in the entire mission by other scripts, so ag1air would reference to your jet in any other script running in the same mission.

    for your script it would practically make no difference, no idea about performance impact but it should be non existant.

    • Like 1

  5. From what I've seen earlier these won't fit too well as a chopper spotlight since the light distance fades off pretty quickly.

    You can use this to force chopper lights on, since currently only player controlled choppers will use headlights.

    Might be of use to you:

    nul = [] spawn {
    
    while {canmove yourchoppername} do {
    
    driver yourchoppername action ["lightOn", yourchoppername];sleep 0.01
    };
    };


  6. I do not understand why no one takes the minute or two to fix it.

    I don't know either, there's a few game breaking things that either no one seems to care about and there's even more stuff that's just plain annoying for mission makers.

    It's a pain for having to find a workaround (if possible at all) for stuff that's probably fixed with one config entry edit or similar.

    Especially bugs which are in arma3 since alpha and no one bothered to touch/give feedback about are very exhausting, at least for me.

    It's not like they need 40+ people playtesting these fixes for months before releasing them...

    On the other hand it's ridiculous to see how, within a few weeks, Zeus is getting functionality and other cool stuff that the community requested for the 2d editor for a long time.

    Cheers


  7. GOM - Carpet Bombing V1.1

     

     

     

     



    This simple script will simulate carpet bombing and is easy to use.
    Air Raid sirens will sound an alarm before the bombing takes place (directional sound).

    Custom placed objects will also play the air raid sound (i.e. "Land_Loudspeakers_F").
    Bombs will make a bomb dropping sound before impact.

     

    //GOM_CB V1.1 by Grumpy Old Man
    //
    //Changelog V1.1
    //-MP and dedicated Server compatible

    //improved bomb spread and spacing
    //added air raid sirens to various vanilla buildings (fully autonomous) and bomb falling sounds

    //first parameter gives the bomb type, empty string will make the script use a random bomb, mod bombs will also be used
    //second parameter holds the position that should be bombed
    //third parameter holds the direction
    //fourth parameter defines the amount of bombs to be dropped
    //fifth parameter defines the average distance for the bombs to spread

    //example:

    
    _bomb = ["",screenToWorld [0.5,0.5],270,20,100] spawn GOM_fnc_carpetbombing;


    //this will drop a carpet of 20 bombs of a random type, beginning at the screen center position, moving ~100m from east to west

    //value limits are 48 bombs, 250 meters to prevent the script from bombing the entire map

     


    init.sqf:

    call compile preprocessFileLineNumbers "scripts\GOM\GOM_fnc_carpetBombing.sqf";

     

    scripts\GOM\GOM_fnc_carpetBombing.sqf:

     
    
    //GOM_CB V1.1 by Grumpy Old Man
    //
    //Changelog V1.1
    //-MP and dedicated Server compatible
    //added air raid sirens to various vanilla buildings (fully autonomous) and bomb falling sounds
    
    //first parameter gives the bomb type, empty string will make the script use a random bomb, mod bombs will also be used
    //second parameter holds the position that should be bombed
    //third parameter holds the direction
    //fourth parameter defines the amount of bombs to be dropped
    //fifth parameter defines the average distance for the bombs to spread
    
    //example:
    // _bomb = ["",screenToWorld [0.5,0.5],270,20,100] spawn GOM_fnc_carpetbombing;
    //this will drop a carpet of 20 bombs of a random type, beginning at the screen center position, moving ~100m from east to west
    
    //value limits are 48 bombs, 250 meters to prevent the script from bombing the entire map
    
    
    GOM_fnc_airRaidSirens = {
    
        params ["_bomblocation"];
    
        _airraidsirens = nearestobjects [_bomblocation,["Land_BellTower_01_V1_F","Land_BellTower_01_V2_F","Land_BellTower_02_V1_F","Land_BellTower_02_V2_F","Land_Cargo_HQ_V1_F","Land_Cargo_HQ_V2_F","Land_Cargo_HQ_V3_F","Land_Chapel_Small_V1_F","Land_Chapel_Small_V2_F","Land_Chapel_V1_F","Land_Chapel_V2_F","Land_Church_01_V1_F","Land_Loudspeakers_F"],1500];
    
        for "_i" from 0 to 4 do {
    
            {[_x,["air_raid",500,1]] remoteExec ["say3D",[0,-2] select isDedicated]} foreach _airraidsirens;
            sleep 8.6;
    
        };
    
    };
    
    GOM_fnc_carpetBombing = {
    	params [["_bombType",""],["_bomblocation",[0,0,0]],["_direction",random 360],["_amount",20],["_distance",50]];
    
    	if (_bomblocation isEqualTo [0,0,0]) exitWith {systemchat "GOM_carpetbombing: Error, no bomb location given!"};
    
    
    	if (_bombType isEqualTo "") then {_bombType = selectRandom ["Bo_GBU12_LGB","Bo_Mk82_MI08","Bomb_03_F","Bomb_04_F"]};
    
    	if (!isClass (configFile >> "CfgAmmo" >> _bombType)) exitWith {systemchat "GOM_carpetbombing: Error, bombtype is not a valid class!"};
    	if !(missionNamespace getVariable ["GOM_fnc_carpetBombingAvailable",true]) exitWith {systemchat "GOM_carpetbombing: Already running!"};
    	missionNamespace setVariable ["GOM_fnc_carpetBombingAvailable",false,true];
    
    	_amount = _amount min 48;
    	_distance = _distance min 250;
    	_debug = false;
    
    	_firstImpactPos = (_bomblocation getPos [(_distance / 2),_direction + 180]) vectorAdd [0,0,200];
    	_posincrement = _distance / _amount;
    
    	_sirens = [_firstImpactPos] spawn GOM_fnc_airRaidSirens;
    
    	sleep random [5,10,15];
    	_randomsound = selectRandom ["BattlefieldJet1_3D","BattlefieldJet2_3D","BattlefieldJet3_3D"];
    	_closePlayers = allPlayers select {_x distance2D _firstImpactPos < 1500};
    	[_randomsound] remoteExec ["playSound",_closePlayers];
    
    	sleep 20;
    
    	_relpos = _firstImpactPos;
    	_bomb = objNull;
    	for "_i" from 1 to _amount do {
    
    		sleep 0.1;
    		_tempPos = _relpos vectorAdd [random [-20,0,20],random [-20,0,20],random [-5,0,5]];
    
    
    		_bomb = _bombType createvehicle _tempPos;
    		_bomb setposasl _tempPos;
    		_relpos = _firstImpactPos getPos [(_posincrement * _i),_direction] vectorAdd [0,0,200];
    
    		if (_debug) then {
    
    			_helper = "Sign_Arrow_Large_F" createvehicle [getposATL _bomb select 0, getposATL _bomb select 1,0];
    
    		};
    
    		_bomb setVectorDirAndUp [[0,0,-1],[0,0.8,0]];
    		_bomb setVelocityModelSpace [0,50,-50];
    		_bomb setFeatureType 2;
    
    		_nul = [_bomb] spawn {
    
    			params ["_bomb"];
    			waituntil {getposATL _bomb select 2 <= 700};
    			_soundarray = ["Shell1","Shell2","Shell3","Shell4"];
    			_soundpos = [getposATL _bomb select 0, getposATL _bomb select 1,0];
    			_helper = "Land_Battery_F" createvehicle _soundpos;
    			_helper hideobjectGlobal true;
    			_rndSound = selectRandom _soundarray;
    
    			[_helper,[_rndSound,1,200]] remoteExec ["say3D",[0,-2] select isDedicated];
    			waituntil {!alive _bomb};
    			deletevehicle _helper;
    
    		};
    
    	};
    
    
    	sleep 30;
    	missionNamespace setVariable ["GOM_fnc_carpetBombingAvailable",true,true];
    true
    };

     





    Update:

    V1.1

    • Script and sound handling is now MP and dedi-Server compatible
    • improved bomb spread and spacing

     

    Enjoy!

    • Like 3
    • Thanks 2

  8. Sorry to hijack your thread but has anyone seen these in the editor (unit placement)? I can copy and place them from BIS' missions but if I open them to put something in the init and then hit "Ok" they turn into large woodpiles. Wasn't able to find them in any category. (I know I can simply spawn them or use the copy & paste method; I was just wondering.)

    For anyone who wants to know this:

    Place a helper object in the editor, like an arrow or similar, then put this in the helper init field:

    _lamp = "Land_PortableLight_single_F" createvehicle getpos this;
    deletevehicle this

    tried it earlier and it should work, don't have access to arma right now ;)

    this light will give a decent directional light just as I wanted.

    They're definitely not in the editor, and as far as I know they didn't emit light in the earlier versions of arma, a welcome surprise that they do now.

    Cheers


  9. Is it somehow possible to reduce the amount of ambient patrols or limit them to a certain amount of units/area?

    As of right now it looks like they're spawning indefinitely, player groups/vehicles will run out of ammo even before reaching the mission objectives, that's a reason why most groups will just halo in and therefore making the ambient patrols and vehicle usage obsolete in the first place.

    Cheers


  10. Hey folks,

    thanks to BI not adding searchlights and other cool stuff for mission makers I wondered if it's possible to create a directional light, similar to the searchlight from A2 or the current weapon flashlights.

    Looking at the current light scripting commands there doesn't seem to be a way to create directional light, or am I missing something?

    Cheers


  11. By working on this manual I was able to confirm ArmA's bomb physics ARE indeed CORRECT unlike some state...

    I hate to be the one correcting you on this one, but bomb physics aren't correct.

    Bombs just won't stop accelerating at all. If you drop some GBU12s at 55km altitude they will impact with a speed of (!)~3700km/h after ~108 seconds.

    Already made a ticket about this:

    http://feedback.arma3.com/view.php?id=18188

    What Xendance experienced might be the "weird" flight physics in arma, a spawned bomb is aimed at the horizon and therefor seems to be in a "gliding" mode until it's heading towards the ground, only then the bomb will enter the freefall mode.

    If you want I can add a repro mission to check that on your own.

    Other than that I appreciate your tutorial and enjoyed your videos, gonna put that knowledge to good use, heh.

×