Jump to content

lappihuan

Member
  • Content Count

    567
  • Joined

  • Last visited

  • Medals

Posts posted by lappihuan


  1. 1 hour ago, [VW]Wrath said:

     

    I was actually thinking about this the other day, an animation pack that replaced many animations in favor of seconnd world war styled ones. For instance the classic German run with the rifle carried in the left hand, or US troops with the .30 Cal on their shoulder.

     

    I have no idea how feasable it would actually be to implement, and it's far beyond my skills, but I agree it would be cool as hell.

    This would mean creating a whole movement set for each of these diffrent styles of weapon carrying.
    Walking-Front
              ...-Left

              ...-Right

              ...-Back

              ...-Diagonal (Front-Left)

    ...
    Sprinting-Front
              ...-Left
    ...

    Same for all Stances
    ...

    I guess you get the idea.
    BI has one movementset which is already a huge pile of work.

    • Like 1

  2. On 7.7.2017 at 10:31 PM, Larrow said:

     

    How about we don't break existing scripts/missions available in the community. Something like..

      Reveal hidden contents
    
    
    /*
    	Author: Nelson Duarte
    
    	Description:
    	This function adds a new item that will be stacked and called upon event handler selected has been executed
    
    	Parameter(s):
    	_this select 0:	STRING			- The unique ID of the item inside the stack
    	_this select 1:	STRING			- The onXxx event handler to monitor and execute code upon
    	_this select 2:	STRING or CODE	- The function name or code to execute upon the event triggering
    	_this select 3:	ANY				- Arguments passed to function/code
    
    	Returns:
    	STRING - The stacked item ID
    */
    
    // Parameters
    params [["_id", "", [""]], ["_event", "", [""]], ["_code", {}, [{}]], ["_arguments", [], [[]]]];
    
    // Supported event handlers - for backwards compatability
    private _supportedEvents = ["oneachframe", "onpreloadstarted", "onpreloadfinished", "onmapsingleclick", "onplayerconnected", "onplayerdisconnected"];
    
    // Validate event type
    if !(toLower _event in _supportedEvents) exitWith
    {
    	["Stack with ID (%1) could not be added because the Event (%2) is not supported or does not exist. Supported Events (%3)", _id, _event, _supportedEvents] call BIS_fnc_error;
    };
    
    // Mission namespace id
    private _namespaceId 	= "BIS_stackedEventHandlers_";
    private _namespaceEvent = _namespaceId + _event;
    
    // The data
    private _data	= missionNamespace getVariable [_namespaceEvent, []];
    private _index	= -1;
    
    // Go through all event handler data and find if id is already defined, if so, we override it
    {
    	// Item id
    	private _itemId	= _x param [0, "", [""]];
    
    	// Is this the correct one?
    	if (_id == _itemId) exitWith
    	{
    		_index = _forEachIndex;
    	};
    }
    forEach _data;
    
    private _objects = [];
    {
    	if ( _x isEqualType objNull ) then {
    		private _nul = _objects pushBack [ _forEachIndex, _x call BIS_fnc_netId ];
    		_arguments set[ _forEachIndex, nil ];
    	};
    }forEach _arguments;
    
    private _header = "
    	_arguments = %1;
    	{
    		_x params[ '_index', '_id' ];
    		_arguments set[ _index, _id call BIS_fnc_objectFromNetId ];
    	}forEach %3;
    ";
    
    private _headerWithArgs = _header + "( _this + _arguments ) call %2;";
    _header = _header + "_arguments call %2;";
    
    // Is data related to event empty
    // If so, we need to initialize it
    private _i = switch (toLower _event) do
    {
    	case "oneachframe" : 			{ addMissionEventHandler ["EachFrame", compile format [_header, _arguments, _code, _objects]]; };
    	case "onpreloadstarted" : 		{ addMissionEventHandler ["PreloadStarted", compile format [_header, _arguments, _code, _objects]]; };
    	case "onpreloadfinished" : 		{ addMissionEventHandler ["PreloadFinished", compile format [_header, _arguments, _code, _objects]]; };
    	case "onmapsingleclick" : 		{ addMissionEventHandler ["MapSingleClick", compile format [_headerWithArgs, _arguments, _code, _objects]]; };
    	case "onplayerconnected" : 		{ addMissionEventHandler ["PlayerConnected", compile format [_headerWithArgs, _arguments, _code, _objects]]; };
    	case "onplayerdisconnected" : 	{ addMissionEventHandler ["PlayerDisconnected", compile format [_headerWithArgs, _arguments, _code, _objects]]; };
    };
    
    // Add new item, or override old one with same id
    if (_index == -1) then
    {
    	// Add
    	_data set [count _data, [_id, _event, _i]];
    }
    else
    {
    	// Override
    	_data set [_index, [_id, _event, _i]];
    };
    
    // Store in namespace
    missionNameSpace setVariable [_namespaceEvent, _data];
    
    // Log
    ["Stack as been updated with ID (%1) for Event (%2), Replaced: (%3)", _id, _event, _index != -1] call BIS_fnc_logFormat;
    
    // Return
    _id;

     

     

    It may add some overhead but at least its not breaking content already available. Anyone who is still around and gives a damn has likely updated their content but if not at least BI wont be breaking it.

    Feedback Ticket for this issue:
    https://feedback.bistudio.com/T126078

×