Jump to content
RedBelette

RedFramework - Easier way to make an Arma mission

Recommended Posts

 

FRAMEWORK5.png

RED FRAMEWORK

A collection of useful functions for mission maker.
Website under construction: http://www.redframework.com

 

Version: 1.0.9

Release date:  11-03-2018

WORKSHOP: https://steamcommunity.com/sharedfiles/filedetails/?id=1226877632

GITHUB: https://github.com/RedBelette/RED_FRAMEWORK

LICENSE: https://github.com/RedBelette/RED_FRAMEWORK/blob/master/LICENSE

 

MISSION TEMPLATE (take it for a quick start !)

https://github.com/RedBelette/RedFramework-Simple-Template 

https://github.com/RedBelette/RedFramework-TGV-Template

 

INITIALIZATION

- Voice is disabled for players (just for ingame recorded speeches, not VOIP).
- Saving is disabled.
 

FUNCTIONS


ace improvements

// This feature allows you to use a huntir ammo as a satellite that you can later use via ACE's huntir monitor.
_huntirAmmo = [satellitePos] call RF_fnc_huntirSatellite; 


Action mecanism
Trigger (by script) in arma are very useful but contain a lot of code to do something. We need to create new paradigm to replace it and to enhanced the behavior. We need an action mechanism. An action is to execute something when the condition is true. In more we can specify if the action is a one shot or in a loop. Maybe you want that the action is timed also. By creating a registry of action we can start and stop an action.

// This function acts as a trigger and executes code when a condition is true.
_action = [_condition, _codeAsString, _params(*default=[])] call RF_fnc_action; 
// This function acts as a trigger and executes code when a condition is true with a delay time.
_action = [_condition, _codeAsString, _delayAsSecond, _params(*default=[])] call RF_fnc_delayedAction; 
// This function acts as a trigger and executes code every x seconds.
_action = [_condition, _codeAsString, _timeToTheNextExecutionAsSecond, _params(*default=[])] call RF_fnc_repeatedAction; 
// This function acts as a trigger and executes code when a condition is true on the targeted remote side.
_action = [_condition, _codeAsString, _params(*default=[]), _target(*default=0)] call RF_fnc_remoteAction; 
// This function acts as a trigger and executes code when a condition is true with a delay time on the targeted remote side.
_action = [_condition, _codeAsString, _delayAsSecond, _params(*default=[]), _target(*default=0)] call RF_fnc_remoteDelayedAction; 
// This function acts as a trigger and executes code every x seconds on the targeted remote side.
_action = [_condition, _codeAsString, _timeToTheNextExecutionAsSecond, _params(*default=[]), _target(*default=0)] call RF_fnc_remoteRepeatedAction; 
// This function opens a register of actions, allowing you to start or stop an action.
call RF_fnc_actionRegistry; 
// The RF_fnc_actionRegistry function needs to be called beforehand to open an action register.
_action = [_actionIdAsString, _actionAsReturnedAction] call RF_fnc_addAction; 
// This function allows you to find an action in the action register.
_action = [_actionIdAsString] call RF_fnc_getAction; 
// Activate the action from the action register.
[_actionIdAsString] call RF_fnc_runAction; 
// Desactivate the action from the action register.
[_actionIdAsString] call RF_fnc_stopAction; 
// Remove action from the action register.
[_actionIdAsString] call RF_fnc_unregisterAction; 


Ai behavior

// Surrender occurs when the remaining units of the desired faction are below the desired minimum number.
_trueOrFalse = [_side, _minUnitsToSurrenderTheSide] call RF_fnc_makeSideSurrender; 
// Order the entire faction to defend an area around a radius.
[_side, _position, _radius] call RF_fnc_sideDefendArea; 

Ambience

// Flash on the desired area (like zeus).
[_position, _delay(*default:0)] call RF_fnc_lightningBolt


Animation

// Play a looping animation with the playMove instruction
[_unit, _animClassName] call RF_fnc_playMoveLoop; 


Condition

// Check if the unit is inside a vehicle
_trueOrFalse = [_unit] call RF_fnc_isInVehicle; 
// Checks if a player is close to an entity following a radius
_trueOrFalse = [_entity, _radius] call RF_fnc_isPlayerNearEntity; 


Converter

// Convert string on side ojbect
_side = [_sideAsString] call RF_fnc_convertSideStr;


Heli control

// Initialize a helicopter so that it stays quietly on the ground.
[_group] call RF_fnc_heliInit; 
// Order the helicopter to land in the desired area.
[_group, _position] call RF_fnc_landHeli; 
// Send the helicopter to fight.
[_group, _position, _radius] call RF_fnc_sendHeliToFight; 
// The helicopters unload the units present in an area and then disappear.
[_vehicle, _landingPosition, _getOutPosition] call RF_fnc_unloadUnitsWithHeli; 


Init

// This function allows you to wait for the end of the loading screen.
call RF_fnc_loadingComplete; waitUntil {loadingFinished}; 


Layer

// Enable 3den editor layer.
[_layerIdAsString] call RF_fnc_enableLayer; 
// Disable 3den editor layer.
[_layerIdAsString] call RF_fnc_disableLayer; 


Mission generator
This engine offer to you a complete engine to manage tasks and missions.
You have a completer CRUD fort the task to create, changing state, close or remove it. 
You can also generate a random mission with a little configuration from description.ext.
 

// Creates a new mission in the framework and generates an Arma task. This task may not be visible to players.
_missionIdUnique = [_missionIdAsString, _side, _parentMissionIdAsString, _title, _description, _taskType(*default="default"), _taskDestination(*default=objNull), _taskSetCurrent(*default=false), _taskPriority(*default=0), _taskNotification(*default=true), _taskSharing(*default=false)] call RF_fnc_createMission;
// Closes the mission identified by the missionID passed in parameter. By default, the status of the mission will be successful and an alert will be displayed.
[_missionIdAsString, _taskStatus(*default="SUCCEEDED"), _taskShowHint(*default=true)] call RF_fnc_closeMission; 
// Returns true when the mission is closed.
_trueOrFalse = [_missionIdAsString] call RF_fnc_isMissionClosed; 
// Return the task state of the mission
_taskStatus = [_missionIdAsString] call RF_fnc_missionState;
// Returns all the cities of the map.
_locations = call RF_fnc_locations; 
// Return a random location of the map.
_randomLocation = call RF_fnc_locationGenerator; 
// Generate a random mission based on the description.ext. (see config on the bottom)
_missionIdUnique = call RF_fnc_missionGenerator; 
// Generates an example mission based on the condig file or past parameters.
_missionIdUnique = [_side(*default=config), _helicopterClassName(*default=config), _unitsClassNameArray(*default=config)] call RF_fnc_spawnMissionHelicopterCrashInTown; 


Spawn

// Create units.
_group = [_side, _unitsClassNameArray, _position] call RF_fnc_spawnUnits; 
// Create garrisons around an area based on the description.ext or parameters.
_allGroups = [_position, _radius(*default=config), _side(*default=config), _unitsClassNameArray(*default=config), _randomDistance(*default=config)] call RF_fnc_spawnGarrison; 
 // Create patrols around an area based on the description.ext or parameters.
_allGroups = [_position, _radius(*default=config), _side(*default=config), _unitsClassNameArray(*default=config), _radiusPatrols(*default=config)] call RF_fnc_spawnCirclePatrols;
// Create a helicopter and teleport the group inside to the desired position. After landing the helicopter drops off the group, returns to its starting position and disappears.
[_groupWillTeleportedInsideHeli, _spawnPosition, _landingPos, _heliClassName(*default="B_Heli_Light_01_F"), _side(*default=west), _driverClassName(*default="B_Helipilot_F")] call RF_fnc_spawnByHeli; 

 

Spectator

// This script will allow you to create the spectator's mode. (config acre and tfar inside)
call RF_fnc_spectator; 
// Add an action into object to enter spectator mode
[_object] call RF_fnc_addSpectatorAction;


Ui

// Displays an image in full screen for a given time.
[_imagePath, _timeInSecond] call RF_fnc_imageFullScreen; 
// Displays an image in full screen in the sky during a given time.
[_imagePath, _timeInSecond] call RF_fnc_imageInSky; 
// Simplify the code to create a progress bar.
[_object, _progressBarId, _titleAction, _titleBar, _codeAsString, _cancelCodeAsString, _parametersToTheCode, _timeInSecond, _actionType(*default=0), _actionParent(*default="ACE_MainActions"), _actionIcon(*default="")] call RF_fnc_progressBar; 
// Displays the name of the scenario and its author at the bottom right.
[_missionName, _byAuthor] call RF_fnc_scenarioTitle; 

Vehicle

// Charge a group of players in the cargo of a vehicle. The basic moveInCargo instruction is defective in MP.
[_group, _vehicle] call RF_fnc_moveInCargo;


Zeus

// Allows zeus to modify all new spawner units by script.
call RF_fnc_makeAllUnitsEditableForAllCurators; 
// Allows to make editable all the objects passed in parameter.
[_objectArray] call RF_fnc_makeObjectsEditableForAllCurators; 

 

Zombie

/*
* The mod zombie Ryan's spawner module seems to pose performance
* concerns in MP so here is a spawner optimize.
*
* Parameters
* side: west, east, ...
* gameLogic: gameLogic module
* numberByWave: number of Z max spawned by wave.
* time: delay between wave
* type: (default: mediumCivilian)
* - fastCivilian
* - fastSoldier
* - fastCivilianAndSoldier
* - mediumCivilian
* - mediumSoldier
* - mediumCivilianAndSoldier
* - slowCivilian
* - slowSoldier
* - slowCivilianAndSoldier
* - walkerCivilian
* - walkerSoldier
* - walkerCivilianAndSoldier
* - demon
* - spider
* - brittleCrawler
* - mixedZombie
* - mixedZombieNoSpiderNoCrawler
*/
[_side, _gameLogic, _numberByWave, _time, _type(*default:'mediumCivilian')] call RF_fnc_zSpawner

Configuration in description.ext (optional)

// Example 
class RedFrameworkConfig {
  
  class missionCfg {
    addItemEarPlugs=true;
    putInEarPlugs=true;
    putSafeMode=true;
  };

class MissionGenerator {
missionPaths[] = {
// HERE THE PATH OF YOUR MISSION
"pathofmission1.sqf",
"pathofmission2.sqf"
};
};

class combatPatrol_CfgEnemis {
	side = "east"; // HERE THE DEFAULT SIDE
};

class combatPatrol_SpawnCirclePatrols {  // HERE THE FUNCTION DEFAULT VALUES
        distance = 200;
        unitTypes[] = {{"LOP_US_Infantry_SL", "LOP_US_Infantry_Rifleman_4", "LOP_US_Infantry_TL"}, {"LOP_US_Infantry_MG_2", "LOP_US_Infantry_MG_Asst"}, {"LOP_US_Infantry_Rifleman_2", "LOP_US_Infantry_Rifleman_4"}, {"LOP_US_Infantry_Rifleman_2", "LOP_US_Infantry_Rifleman_4", "LOP_US_Infantry_MG_Asst", "LOP_US_Infantry_MG_2"}};
        radiusPatrols[] = {50, 100, 200};
    };

    class combatPatrol_SpawnGarrison { // HERE THE FUNCTION DEFAULT VALUES
        distance = 100;
        unitTypes[] = {{"LOP_US_Infantry_SL", "LOP_US_Infantry_Rifleman_4", "LOP_US_Infantry_TL"}, {"LOP_US_Infantry_MG_2", "LOP_US_Infantry_MG_Asst"}, {"LOP_US_Infantry_Rifleman_2", "LOP_US_Infantry_Rifleman_4"}, {"LOP_US_Infantry_Rifleman_2", "LOP_US_Infantry_Rifleman_4", "LOP_US_Infantry_MG_Asst", "LOP_US_Infantry_MG_2"}};
        ramdomizeDistance = 80;
    };

    class combatPatrol_missions { 
        class combatPatrol_helicopterCrashInTown { // HERE THE FUNCTION DEFAULT VALUES
            helicopterClass = "B_Heli_Light_01_dynamicLoadout_F";
            unitTypes[] = {{"LOP_US_Infantry_SL", "LOP_US_Infantry_Rifleman_4", "LOP_US_Infantry_TL"}};
        };
    };

};

CHANGELOG

## 05-02-2018 version 1.0.1

- ADD RF_fnc_moveInCargo
- FIX RF_fnc_spawnByHeli with the new move in cargo (MP fail)

 

## 05-05-2018 version 1.0.2

- FIX RF_fnc_moveInCargo: brute force moveInCargo with infinite loop protection

 

## 05-10-2018 version 1.0.3

- ADD RF_fnc_lightningBolt to flash on desirated area.
- ADD RF_fnc_spectator create the spectator's mode on client
- ADD RF_fnc_addSpectatorAction to addAction your object with the previous spectator's function.
- ADD RF_fnc_zSpawner to spawn Zombie and Demons with more performance in MP

 

## 05-10-2018 version 1.0.4

- ADD Configure your mission with features: add and put earplugs, security safemod for weapons.

// Example description.ext: 
class RedFrameworkConfig {
  class missionCfg {
    addItemEarPlugs=true;
    putInEarPlugs=true;
    putSafeMode=true;
  };
};

## 05-13-2018 version 1.0.5

- FIX counter variable's name mistake, '_' missing

 

CHANGELOG version 1.0.6

## 05-20-2018 

- HOTFIX: Resolve default value on the init
- HOTFIX: Partial hotfix for RF_fnc_moveInCargo and RF_fnc_spawnByHeli

 

CHANGELOG version 1.0.7

## 06-02-2018 

- ADD capabilities to recieve code instead string for the executed job.
- ADD capabilities to recieve parameters 
- ADD remote action for all the types of actions

see action mecanism for more details

 

## 07-15-2018 version 1.0.8

- FIX when you try to configure earPlug with description.ext

 

## 11-03-2018 version 1.0.9

- FIX move in cargo for MP

  • Like 8
  • Thanks 1

Share this post


Link to post
Share on other sites

I couldn't find a license anywhere.  Is that just me being to ... to find it or is there no license anywhere?  Without a license not many people will use it as they have no clue what they are allowed to do with it and what not.

  • Like 1

Share this post


Link to post
Share on other sites

Just a suggestion:

I recommend use you code tags. Easier to read.

// Like this

 

Share this post


Link to post
Share on other sites

CHANGELOG version 1.0.1

## 05-02-2018

- ADD RF_fnc_moveInCargo
- FIX RF_fnc_spawnByHeli with the new move in cargo (MP fail)

  • Thanks 1

Share this post


Link to post
Share on other sites

Great job! Your framework will probably be useful for my next missions.

  • Like 1

Share this post


Link to post
Share on other sites

CHANGELOG version 1.0.3

## 10-05-2018 

- ADD RF_fnc_lightningBolt to flash on desirated area.
- ADD RF_fnc_spectator create the spectator's mode on client
- ADD RF_fnc_addSpectatorAction to addAction your object with the previous spectator's function.
- ADD RF_fnc_zSpawner to spawn Zombie and Demons with more performance in MP

  • Like 1

Share this post


Link to post
Share on other sites

CHANGELOG version 1.0.4

## 10-05-2018 

- ADD Configure your mission with features: add and put earplugs, security safemod for weapons.

// Example description.ext: 
class RedFrameworkConfig {
  class missionCfg {
    addItemEarPlugs=true;
    putInEarPlugs=true;
    putSafeMode=true;
  };
};

MISSION TEMPLATE

Add TGV mission template (french comments) : https://github.com/RedBelette/RedFramework-TGV-Template

  • Like 1

Share this post


Link to post
Share on other sites

CHANGELOG version 1.0.5

## 13-05-2018 

- FIX counter variable's name mistake, '_' missing

  • Thanks 1

Share this post


Link to post
Share on other sites

Your attention please!
Version 1.0.5 has two known bugs that will be partially resolved in version 1.0.6:
- RF_fnc_moveInCargo still causes me problems and affects RF_fnc_spawnByHeli. A fix exists so far but is not optimal for multiplayer. I continue the investigation. I am also open to discuss ;)
- The default values are mismanaged in the initialization of the mission. Workarround:  add this configuration in the desciption.ext.

class RedFrameworkConfig {
  class missionCfg {
    addItemEarPlugs=true;
    putInEarPlugs=true;
    putSafeMode=true;
  };
};

Other communication:
I'm going to review my features production way to guarantee the stability of the framework. Indeed, my eagerness to release the features have produced its mistakes, you see me sorry.
For info, I chose Git-Flow to structure my work. To make clear:
New features will come out at regular intervals (ex: every month) and hotfixes (will come out every week if necessary). Controller my eagerness will help you, at least I hope so;)

 

I will let you know when this change is effective.

  • Like 1

Share this post


Link to post
Share on other sites

CHANGELOG version 1.0.6

## 20-05-2018 

- HOTFIX: Resolve default value on the init
- HOTFIX: Partial hotfix for RF_fnc_moveInCargo and RF_fnc_spawnByHeli

  • Like 1

Share this post


Link to post
Share on other sites

Gît flow initialized and refactoring of gît repo. Only core project inside.  Next feature... params and codes insides action mecanism. 

Share this post


Link to post
Share on other sites

CHANGELOG version 1.0.7

## 02-06-2018 

- ADD capabilities to recieve code instead string for the executed job.
- ADD capabilities to recieve parameters 
- ADD remote action for all the types of actions

see action mecanism for more details

 

Note: all default values allow scalability

 

Some examples:

Quote

 


params ["_computer"];

_computer addAction ["Local action with string code",{
["true", "hint 'Local action executed with string code';"] call RF_fnc_action;
}];

_computer addAction ["Local action with string code and parameters",{
["true", "params['_params'];hint format ['Local action executed with string code and parameters: %1', _params]", ["params inside"]] call RF_fnc_action;
}];

_computer addAction ["Local action with code",{
	["true",
		{
			hint 'Local action executed with code';
		}
	] call RF_fnc_action;
}];

_computer addAction ["Local action with code and parameters",{
	["true",
		{
			params['_params'];
			hint format ['Local action executed with code and parameters: %1', _params]
		}, ["params inside"]
	] call RF_fnc_action;
}];

_computer addAction ["Remote action with string code",{
	{
		["true", "hint 'Remote action executed with string code';"] call RF_fnc_remoteAction;
	} remoteExec ["call", 2];
}];


_computer addAction ["Remote action with string code with parameters",{
	{
		["true", "hint format ['Remote action executed with string code and parameters: %1', _params]", ["params inside", "toto"]] call RF_fnc_remoteAction;
	} remoteExec ["call", 2];
}];

_computer addAction ["Remote action with code",{
	{
		["true", {hint 'Remote action executed with code';}] call RF_fnc_remoteAction;
	} remoteExec ["call", 2];
}];


_computer addAction ["Remote action with code with parameters",{
	{
		["true", {
			params['_params'];
			hint format ['Local action executed with code and parameters: %1', _params];
		}, ["params inside"]] call RF_fnc_remoteAction;
	} remoteExec ["call", 2];
}];

 

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Hello Guys,

 

Sorry, i am very busy for the moment, i can't work on the framework as i want. Maybe the situation could be resolved after this summer. 

Stay in touch ;)

 

RedBelette

 

CHANGELOG version 1.0.8

## 07-15-2018 

- FIX when you try to configure earPlug with description.ext

Share this post


Link to post
Share on other sites

Hello guys,

 

I take this break to ask you your impressions on the framework. Does it meet your expectations? Do you encounter particular difficulties? Do you have any proposals or wishes?

I'm glad to see that the framework is used by 122 steamworkshop subscribers. It deserves that I don't leave the case.

 

Have a nice day.

 

RedBelette

  • Like 1

Share this post


Link to post
Share on other sites

Hi Red, 

 

Just found this.

 

I'm going to give this a look over. I am looking for a objective generating framework that I can use to create missions and tasks. I'll have to go over everything, and see how this works. I'll feedback anything I find, and/or make suggestions. 

 

 

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi Blackheart_Six,

 

Thank you for your interest in the framework, I am at your service if you have any questions.

To answer you, the dependence on ace and CBA is not mandatory could be removed. They are mainly used for spawns functions. I just have to consider the users who use these functions, not to cause them harm. What is your opinion on the question?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×