BIS fnc createRuin: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl>" 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


| arma3 |Game name=
| arma3


|1.76|Game version=
|1.76


|gr1 = Environment |GROUP1=
|gr1 = Environment


| Create a building ruin and hide the original object. |DESCRIPTION=
| Create a building ruin and hide the original object.


| building call [[BIS_fnc_createRuin]] |SYNTAX=
| building call [[BIS_fnc_createRuin]]


|p1= building: [[Object]] - building to "destroy" |PARAMETER1=
|p1= building: [[Object]] - building to "destroy"


| [[Object]] - the created ruin |RETURNVALUE=
| [[Object]] - the created ruin


|x1= <code>aBuilding [[call]] [[BIS_fnc_createRuin]];</code> |EXAMPLE1=
|x1= <code>aBuilding [[call]] [[BIS_fnc_createRuin]];</code>


|x2= <code> {{codecomment|// will destroy every building in a 50m radius around the player}}
|x2= <code> {{codecomment|// will destroy every building in a 50m radius around the player}}
{ _x [[call]] [[BIS_fnc_createRuin]]; } [[forEach]] ([[player]] [[nearObjects]] ["House", 50]);</code> |EXAMPLE2=
{ _x [[call]] [[BIS_fnc_createRuin]]; } [[forEach]] ([[player]] [[nearObjects]] ["House", 50]);</code>


| |SEEALSO=
|
}}
}}



Revision as of 22:38, 17 January 2021

Hover & click on the images for description

Description

Description:
Create a building ruin and hide the original object.
Execution:
call
Groups:
Environment

Syntax

Syntax:
building call BIS_fnc_createRuin
Parameters:
building: Object - building to "destroy"
Return Value:
Object - the created ruin

Examples

Example 1:
aBuilding call BIS_fnc_createRuin;
Example 2:
// will destroy every building in a 50m radius around the player { _x call BIS_fnc_createRuin; } forEach (player nearObjects ["House", 50]);

Additional Information

See also:
See also needed

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

Posted on June 1, 2019 - 13:14 (UTC)
beno_83au
In MP this function doesn't hide the building globally, so other clients will see both the original building AND the newly created ruined building - https://feedback.bistudio.com/T140045. To get around this I've been hiding the object manually on all other clients:

_building call BIS_fnc_createRuin;
[_building,true] remoteExecCall ["hideObject",-clientOwner];

This will run hideObject on all other clients besides the client (or server) that this was executed from.