Jump to content

-ami- mofo

Member
  • Content Count

    201
  • Joined

  • Last visited

  • Medals

Posts posted by -ami- mofo


  1. Hmmm can't get this to work.

     

    Tested it just on the town of Sofia..

     

    Trigger activated by blufor with... 

     

    Quote

    _null = [] execVM "destruction.sqf";

     

    A marker in the middle of Sofia called 

     

    Quote

    DESTROYALL_SOFIA

     

     

    then this in a 'destruction.sqf' file in the mission folder..

     

    Quote

    B_types = [            
                "Land_Chapel_V1_F",
                "Land_Chapel_V2_F",
                "Land_i_House_Big_01_V1_F",
                "Land_i_House_Big_01_V2_F",
                "Land_i_House_Big_01_V3_F",
                "Land_i_House_Big_02_V1_F",
                "Land_i_House_Big_02_V2_F",
                "Land_i_House_Big_02_V3_F",
                "Land_i_Shop_01_V1_F",
                "Land_i_Shop_01_V2_F",
                "Land_i_Shop_01_V3_F",
                "Land_i_Shop_02_V1_F",
                "Land_i_Shop_02_V2_F",
                "Land_i_Shop_02_V3_F",
                "Land_i_House_Small_01_V1_F",
                "Land_i_House_Small_01_V2_F",
                "Land_i_House_Small_01_V3_F",
                "Land_i_House_Small_02_V1_F",
                "Land_i_House_Small_02_V2_F",
                "Land_i_House_Small_02_V3_F"
    ];

    fn_destroyall_sofia = {
    [] spawn{

    systemChat "Starting to destroy Sofia..";

    for [{_i=0},{_i < (count B_types)},{_i=_i+1}] do {
            _building = getMarkerPos "DESTROYALL_SOFIA" nearObjects [B_types select _i, 300];
            sleep 7;
            {_x setDamage 1} forEach _building;
    };
    systemChat "Sofia - Ready";

     

     

    Nothing happens at all. 

     

    Any ideas what I've done incorrectly?


  2. Hi guys I'm wanting to spawn a few AI groups every so often at regular intervals (say every 30 seconds) on different markers as players descend onto a town. I've got it working fine by using half a dozen triggers all with their centers at the same point but each one with a smaller radius than the last.

     

    But I'd really like to make it all happen with just one trigger.

     

    Quick example of what I have now:-

     

    The 1st trigger with 1200m radius with this... 

     

    Quote

    grp = [getmarkerpos "M10", independent, 6] call bis_fnc_spawngroup; 
    [grp, getmarkerpos "M10", 150] call BIS_fnc_taskPatrol;
    grp setbehaviour "combat";

            _x removeAllEventHandlers "HandleDamage"; 
            _x addEventHandler ["HandleDamage",{ 
                _damage = (_this select 2)*1.5; 
                _damage 
            }]; 
    }forEach units grp;

     

     

    Then the 2nd trigger with 1150m radius with this...

     

    Quote

    grp = [getmarkerpos "M11", independent, 6] call bis_fnc_spawngroup; 
    [grp, getmarkerpos "M11", 150] call BIS_fnc_taskPatrol;
    grp setbehaviour "combat";

            _x removeAllEventHandlers "HandleDamage"; 
            _x addEventHandler ["HandleDamage",{ 
                _damage = (_this select 2)*1.5; 
                _damage 
            }]; 
    }forEach units grp;

     

    And so on for a total of 6 different triggers, 6 different markers and 6 different timed spawns.

     

    So is it possible to put all this scripting into just 1 trigger and have each lot fire at 30 second intervals?

     

    Thanks.


  3. Hi guys,

     

    I already have this in my init.sqf which works fine on the damage handling of editor placed units.

     

    Quote

    if ( side _x == INDEPENDENT ) then {
            _x removeAllEventHandlers "HandleDamage";
            _x addEventHandler ["HandleDamage",{
                _damage = (_this select 2)*1.5;
                _damage
            }];
        };
    }forEach allUnits;

     

     

    What I'd like to do though is have any spawned units spawn with the same damage handling. Currently any units spawned have the default damage.

     

    I'm spawning units via the BIS fnc...

     

    Quote

    grp = [getmarkerpos "M1", independent, 6] call bis_fnc_spawngroup; grp

     

    Hoping it's an easy fix.

     

    Thanks.

     


  4. Hi guys I have a marker called M1 and a trigger with this...

     

    grp = [getMarkerPos "M1", independent, 6] call bis_fnc_spawngroup;

     

    I want the group to spawn and take their formation all facing in a certain direction though and as yet I've failed. Tried something from the wiki which didn't work but I'm a scripting nub anyway.

     

    Is there a little bit of extra code I can add to that to achieve what I want?

     

    Thanks


  5. Hi guys, I have a scorcher called arty1 and an invisible marker called arty_target1

     

    Then I have a trigger with activation as "radio alpha" and in the on act I have 

    Quote

    arty1 doArtilleryFire [getmarkerpos "arty_target1", "32Rnd_155mm_Mo_shells", 10]; 

    arty1 addeventhandler ["fired", {(_this select 0) setvehicleammo 1}];

     

    This is a co-op MP mission and works as it should for the mission host.. but for any other player the radio alpha only results in the scorchers gun barrel pointing skywards (and kind of wiggling a bit)... but nothing comes out?! 

    Does anyone know why this happens and what I need to change so that the scorcher actually fires for the non host players?

     

    Thanks.


  6. Yep Larrow's the man... he sorted me out.

     

    Make an InitPlayerLocal.sqf file with Larrow's scripting and slip it into your missions folder and then you can stay in revive mode until the timer runs out without taking anymore damage and dying.

     

    I use the script below (also from Larrow) as it does ^^that but also enables me to alter the damage we take as we often play in a small co-op group against quite a few AI. So we need to be less prone to damage than usual.

     

    Quote

    params[ "_unit" ];

    //Exit if we are a player and not local
    //Otherwise add EH for AI every where just incase their locality
    //changes due to moving into a players group
    //the EH will only fire where the AI is local
    if ( isPlayer _unit && { !local _unit } ) exitWith {};

    if ( isPlayer _unit ) then {
        //Waituntil REVIVE handleDamage EH has been applied
        waitUntil{ !isNil { _unit getVariable "bis_revive_ehDamage" } };
        //Remove REVIVE HandleDamage EH
        _unit removeEventHandler[ "HandleDamage", _unit getVariable "bis_revive_ehDamage" ];
    };

    //Only damage from last applied handleDamage EH is taken into consideration by the engine
    //Apply a new EH so as we can override the damage applied
    _unit addEventHandler [ "HandleDamage", {
        params ["_unit", "_selection", "_damage","_source","","_index"];
        
          
        if ( lifeState _unit != "INCAPACITATED" ) then {
            
            //Do any other damage calculations here
            //_damage is the total damage the unit has for this selection once this EH returns
            //e.g lets change the damage recieved for each selection
            if ( _index > -1 ) then {
                private _selectionDamage = _unit getHit _selection;
                private _damageRecieved = (_damage - _selectionDamage) max 0;
                _damageRecieved = _damageRecieved / 5;
                _damage = _damageRecieved + _selectionDamage;
            };
            
                
            //Only players respond to REVIVE
            if ( isPlayer _unit ) then {
                _this set[ 2, _damage ];
                //Call BI REVIVE HandleDamage EH passing new _damage value
                _damage = _this call BIS_fnc_reviveOnPlayerHandleDamage;
            };
        }else{
            _damage = 0;
        };
        
           
        _damage
        
    }];

     

    Couple of other things...

     

    I think you have to disable respawn in the editors multiplayer attributes as I've heard revive and respawn don't work well together. I don't use respawn though anyway so can't confirm whether true or not.

    Also in editor MP attributes have the revive mode 'controlled by player attributes'.

    Incapacitation mode 'basic'.

    Set the revive timer to how long you want players to stay in revive until they bleed out and die.

     

    Then right click on your playable units and choose 'attributes', 'object special states' and check the 'revive enable' box.

     

    Now you should be good to go. 

     

     


  7. Hi guys I had two scripts working fine in MP before the update and now neither works.

    One in the init.sqf file which kept the player in revive mode and not able to be killed until the revive timer ran out...

    // Stay in revive until bleed out
     if (hasInterface) then {
    
    	player addEventHandler ["Dammaged", {
        
            params ["_unit"];
     
            
                if (lifeState _unit == "INCAPACITATED") then {
                    
                    _unit allowDamage false;
                    
                    null = [_unit] spawn {
                    
                        params ["_guy"];
    					
    			waitUntil {sleep 1; lifeState _guy != "INCAPACITATED" || isNull _guy || !alive _guy};
    						
    			if (!isNull _guy && alive _guy) then {
    				_guy allowDamage true;
    			};
                    };
     
                };
     
    	}];
    };
    

    And I had an initplayerlocal.sqf that reduced the player damage a bit...

    params[ "_unit" ];
    
    //Exit if we are a player and not local
    //Otherwise add EH for AI every where just incase their locality
    //changes due to moving into a players group
    //the EH will only fire where the AI is local
    if ( isPlayer _unit && { !local _unit } ) exitWith {};
    
    if ( isPlayer _unit ) then {
    	//Waituntil REVIVE handleDamage EH has been applied
    	waitUntil{ !isNil { _unit getVariable "bis_revive_ehDamage" } };
    	//Remove REVIVE HandleDamage EH
    	_unit removeEventHandler[ "HandleDamage", _unit getVariable "bis_revive_ehDamage" ];
    };
    
    //Only damage from last applied handleDamage EH is taken into consideration by the engine
    //Apply a new EH so as we can override the damage applied
    _unit addEventHandler [ "HandleDamage", {
    	params ["_unit", "_selection", "_damage","_source","","_index"];
    	
    		
    	//Do any other damage calculations here
    	//_damage is the total damage the unit has for this selection once this EH returns
    	//e.g lets change the damage recieved for each selection
    	if ( _index > -1 ) then {
    		private _selectionDamage = _unit getHit _selection;
    		private _damageRecieved = (_damage - _selectionDamage) max 0;
    		_damageRecieved = _damageRecieved / 4;
    		_damage = _damageRecieved + _selectionDamage;
    	};
    	
    		
    	//Only players respond to REVIVE
    	if ( isPlayer _unit ) then {
    		_this set[ 2, _damage ];
    		//Call BI REVIVE HandleDamage EH passing new _damage value
    		_damage = _this call BIS_fnc_reviveOnPlayerHandleDamage;
    	};
    	
    		
    	_damage
    	
    }];
    
    

    I thought I'd better give them a MP test since the new update because.. ya know. And unfortunately both aren't working.

    The update log mentioned a couple of things regarding the game's damage / revive...

    Tweaked: The damage model for the 'Basic' Revive setting was changed 
    
    Fixed: The "onPlayerKilled.sqf" and the "Killed" Event Handlers were not fired when players would bleed out in Revive
    
    Tweaked: The damage model for the 'Basic' Revive setting was changed

    Not being a scripter or game tech savvy I'm not sure whether these have something to do with it or whether all that's needed is a tweak to the scripts to get them working again?

     

    Any help would be terrific though.

     

    Thanks.


  8. Thank you Larrow and Bad Benson  :)

     

    That did indeed work. Tested in MP with Arma's revive plus a little script I have that keeps players in revive mode until time out. Worked perfect! 

     

    The only question I have left is that when somebody takes any kind of damage even if small damage (ie- jumps off a wall) it lists all the damage info on the screen (bottom left).

     

    Is there a way to remove that?


  9. After a little more testing it seems that the culprit is Arma's own revive system. Seems like it and damage handler won't work together.

     

    Turn arma's revive off and that script does work in MP. But we use revive so unfortunately no reducing player damage for us. May just have to make the enemy a little less accurate lol.

    • Like 1
×