Home   Help Search Login Register  

Author Topic: RMM Core Functions  (Read 2386 times)

0 Members and 1 Guest are viewing this topic.

Offline Rommel92

  • Members
  • *
RMM Core Functions
« on: 01 Dec 2009, 07:10:56 »
Description:
These functions are some of most used generalised functions that I have produced for ArmA 2, and despite sharing them with others, they are used in my upcoming scripts.

They will be loaded into memory, and that is the end of it, there are no running scripts in this pack, they are simply functions for use by the mission maker / programmer.

Contents (mission folder):
init.sqf
mission.sqm
RMM_core.sqf
functions\f_doActionArgument.sqf
functions\f_getAlive.sqf
functions\f_getDirection.sqf
functions\f_getDistance.sqf
functions\f_getForecast.sqf
functions\f_getGroup.sqf
functions\f_getNearest.sqf
functions\f_getNearestBuilding.sqf
functions\f_getPosition.sqf

Usage:

functions\f_doActionArgument.sqf
Code: [Select]
Parameters: object addAction ["Action name", "functions\f_doActionArgument.sqf", {code}];
Example: this addaction ["Ask to Follow", "functions\f_doActionArgument.sqf", {[_target] joinSilent (group _caller)}];
Local Variables: _target, _caller
Relevant BIKI: http://community.bistudio.com/wiki/addAction

functions\f_getAlive.sqf
Code: [Select]
Description: A function used to find out who is alive in an array, being a group or an array.
Parameters: Units Array, Group or Unit
Example: (Units player) call RMM_f_getAlive
Returns: Array of alive units or Alive Unit

functions\f_getDirection.sqf
Code: [Select]
Description: A function used to find out the direction of a unit, group, or between two positions.
Parameters: Array containing two of [Object, Location, Group or Position]
Example: [[0,0,0], group player] call RMM_f_getDirection;
Returns: Number - Direction in degrees

functions\f_getDistance.sqf
Code: [Select]
Description: A function used to find out the distance between two positions.
Parameters: Array containing two of [Object, Location, Group or Position]
Example: _distance = [Player, [0,0,0]] call RMM_f_getDistance
Returns: Number - Distance in meters

functions\f_getForecast.sqf
Code: [Select]
Description: Function that returns a string containing the weather forecast
Example: _string = call RMM_f_getForecast
Returns: String - Weather Forecast

functions\f_getGroup.sqf
Code: [Select]
Description: A function used to find out the group of an object
Example1: _group = player call RMM_f_getGroup
Example2: _group = (group player) call RMM_f_getGroup
Returns: Group

functions\f_getNearest.sqf
Code: [Select]
Description: A function used to find out the nearest entity parsed in an array to a position. Compares the distance between entity's in the parsed array.
Parameters: Array with [[Object, Location, Group or Position], [Array of [Objects, Locations, Groups and or Positions]] or [[Object, Location, Group or Position], [Array of [Objects, Locations, Groups and or Positions], Distance]
Example: _nearestVeh = [player, vehicles] call RMM_f_getNearest
Example2: _nearestGroup = [[0,0,0], allGroups] call RMM_f_getNearest
Returns: Nearest given entity or List of entities within given distance

functions\f_getNearestBuilding.sqf
Code: [Select]
Description: A function used to find out the nearest building and appropriate building positions available
Parameters: Object
Example:_array = player call RMM_f_getNearestBuilding
Returns: Array with [building object, building positions (count)]

functions\f_getPosition.sqf
Code: [Select]
Description: A function used to position of an entity
Parameters: [Object, Location, Group or Position]
Example: _position = (group player) call RMM_f_getPosition
Returns: Position - [X,Y,Z]

Dependencies:
None

Installation:
Simple installation; copy and paste the functions folder (and its contents) into your mission directory.
copy and paste the RMM_Core.sqf file into your mission directory.
Either copy the line out of the init.sqf or paste the following line somewhere to execute the RMM_Core.sqf.

Code: [Select]
execvm "RMM_Core.sqf";
Compatibility Issues:
None known

Bug Report:
If you find anything, just post here or send me an email admin@australianarmedforces.org
... or forever hold your peace.

Author: Rommel
Date: 02/12/2009 (thats 12/02/2009 for the yanks)
Revision: 1.03

------------- DOWNLOAD -------------

Size: 4KB
Type: 7zip | .7z
Unpacker: www.7-zip.org

Mirrors:
http://www.4shared.com/file/163868701/e0f6de78/RMM_CoreChernarus.html
« Last Edit: 09 Jun 2013, 05:49:02 by Rommel92 »

Offline Trexian

  • Members
  • *
Re: RMM Core Functions
« Reply #1 on: 01 Dec 2009, 16:39:13 »
Very nice. :)

Some of those were on my list of things to do, too! (Now, less work for me!)
Sic semper tyrannosauro.

Offline Rommel92

  • Members
  • *
Re: RMM Core Functions
« Reply #2 on: 02 Dec 2009, 06:13:25 »
Cheers.

Updated to v1.03
Quote from: Changelog
103 Changed: RMM_Initdone can now be used to determine successful completion of RMM_Core execution.
102 Fixed: Function RMM_f_getPosition zero divisor error
101 Improved: Variable names

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: RMM Core Functions
« Reply #3 on: 05 Dec 2009, 18:28:31 »
Nice pack Rommel92  :good:
Now, for clarity in the missions going to use this set of functions you might put all inside a RMMCore folder, including the RMM_Core.sqf, also include a txt or html file with the list of functions and usage.