BIS fnc createSimpleObject: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...)
Line 1: Line 1:
{{Function|Comments=
{{Function


| Arma 3 |Game=
| Arma 3 |Game=


|1.62|Game Version=
|1.62


|gr1 = Object Manipulation |GROUP1=
|gr1 = Object Manipulation


| Creates non-simulated framerate and network performance friendly object - a simple object - and applies different adjustments to fake non-existing physX and engine interactions. The adjustments need either to be stored in the object config or provided as the function input, otherwise they need to be done manually.<br>
| Creates non-simulated framerate and network performance friendly object - a simple object - and applies different adjustments to fake non-existing physX and engine interactions. The adjustments need either to be stored in the object config or provided as the function input, otherwise they need to be done manually.<br>
<br>
<br>
Simple objects cannot be destroyed and do not interact with the environment. They are useful for creating low performance-demanding static compositions (walls, rocks, wrecks, …) and/or environments where shooting and collisions are not expected. |DESCRIPTION=
Simple objects cannot be destroyed and do not interact with the environment. They are useful for creating low performance-demanding static compositions (walls, rocks, wrecks, …) and/or environments where shooting and collisions are not expected.


| [input, position, direction, followTerrain, forceSuperSimpleObject] [[call]] '''BIS_fnc_createSimpleObject''' |SYNTAX=
| [input, position, direction, followTerrain, forceSuperSimpleObject] [[call]] '''BIS_fnc_createSimpleObject'''


|p1= input: [[String]] or [[Array]]:
|p1= input: [[String]] or [[Array]]:
Line 27: Line 27:
*** animationState: [[Number]] - animation state
*** animationState: [[Number]] - animation state
** selectionsToHide: [[Array]] - (Optional, default []) all listed selections will be hidden
** selectionsToHide: [[Array]] - (Optional, default []) all listed selections will be hidden
&nbsp; |PARAMETER1=
&nbsp;


|p2= position: [[Position#PositionWorld|PositionWorld]] |PARAMETER2=
|p2= position: [[Position#PositionWorld|PositionWorld]]


|p3= direction: [[Number]] - (Optional, default 0) |PARAMETER3=
|p3= direction: [[Number]] - (Optional, default 0)


|p4= followTerrain: [[Boolean]] - (Optional, default true) [[true]] to follow terrain inclination, [[false]] to be horizontally aligned |PARAMETER4=
|p4= followTerrain: [[Boolean]] - (Optional, default true) [[true]] to follow terrain inclination, [[false]] to be horizontally aligned


|p5= forceSuperSimpleObject: [[Boolean]] - (Optional, default false) [[true]] to create a '''Super Simple Object''' from p3d path (that '''''must''''' be provided) |PARAMETER5=
|p5= forceSuperSimpleObject: [[Boolean]] - (Optional, default false) [[true]] to create a '''Super Simple Object''' from p3d path (that '''''must''''' be provided)


| [[Object]] - the created Simple Object, [[objNull]] if creation failed |RETURNVALUE=
| [[Object]] - the created Simple Object, [[objNull]] if creation failed


|x1= <code>["B_Boat_Armed_01_minigun_F", [[getPosWorld]] [[player]], [[getDir]] [[player]]] [[call]] [[BIS_fnc_createSimpleObject]];</code> |EXAMPLE1=
|x1= <code>["B_Boat_Armed_01_minigun_F", [[getPosWorld]] [[player]], [[getDir]] [[player]]] [[call]] [[BIS_fnc_createSimpleObject]];</code>


|x2= <code>["B_Boat_Armed_01_minigun_F", [[player]] [[modelToWorldWorld]] [0,5,0], [[getDir]] [[player]] + 90, [[false]], [[false]]] [[call]] [[BIS_fnc_createSimpleObject]];</code> |EXAMPLE2=
|x2= <code>["B_Boat_Armed_01_minigun_F", [[player]] [[modelToWorldWorld]] [0,5,0], [[getDir]] [[player]] + 90, [[false]], [[false]]] [[call]] [[BIS_fnc_createSimpleObject]];</code>


|[[BIS_fnc_adjustSimpleObject]], [[BIS_fnc_replaceWithSimpleObject]], [[BIS_fnc_simpleObjectData]] |SEEALSO=
|[[BIS_fnc_adjustSimpleObject]], [[BIS_fnc_replaceWithSimpleObject]], [[BIS_fnc_simpleObjectData]]
}}
}}



Revision as of 22:36, 17 January 2021

Hover & click on the images for description

Description

Description:
Creates non-simulated framerate and network performance friendly object - a simple object - and applies different adjustments to fake non-existing physX and engine interactions. The adjustments need either to be stored in the object config or provided as the function input, otherwise they need to be done manually.

Simple objects cannot be destroyed and do not interact with the environment. They are useful for creating low performance-demanding static compositions (walls, rocks, wrecks, …) and/or environments where shooting and collisions are not expected.
Execution:
call
Groups:
Object Manipulation

Syntax

Syntax:
[input, position, direction, followTerrain, forceSuperSimpleObject] call BIS_fnc_createSimpleObject
Parameters:
input: String or Array:
  • String: classname of the object to be created. This is the preferred way if the asset config definition contains the adjustment data or the data are not needed (most objects do not need adjustments).
  • Array: adjustment data in format [class, model, reversed, verticalOffset, animationAdjustments, selectionsToHide]:
    • class: String - (Optional, default "") asset CfgVehicles config class (at least either model or class must be provided, ideally both)
    • model: String - (Optional, default "") Path to the vehicle p3d model; needs to start without backslash and must end with the proper file extension ".p3d"
    • reversed: Number - (Optional, default 0) some objects, usually vehicles, are reveresed in p3d; valid values are:
      •  0: no change
      •  1: reverse
      • -1: unknown (behaves as 0)
    • verticalOffset: Array - (Optional, default 0) fix for non-existant physX; usually needed only for vehicles
    • animationAdjustments: Array - (Optional, default []) Animation that need to be animated to given state, in format [animationName, animationState]:
      • animationName: String - animation name
      • animationState: Number - animation state
    • selectionsToHide: Array - (Optional, default []) all listed selections will be hidden
 
position: PositionWorld
direction: Number - (Optional, default 0)
followTerrain: Boolean - (Optional, default true) true to follow terrain inclination, false to be horizontally aligned
forceSuperSimpleObject: Boolean - (Optional, default false) true to create a Super Simple Object from p3d path (that must be provided)
Return Value:
Object - the created Simple Object, objNull if creation failed

Examples

Example 1:
["B_Boat_Armed_01_minigun_F", getPosWorld player, getDir player] call BIS_fnc_createSimpleObject;
Example 2:
["B_Boat_Armed_01_minigun_F", player modelToWorldWorld [0,5,0], getDir player + 90, false, false] call BIS_fnc_createSimpleObject;

Additional Information

See also:
BIS_fnc_adjustSimpleObjectBIS_fnc_replaceWithSimpleObjectBIS_fnc_simpleObjectData

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Bottom Section