BIS fnc createRuin: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Some wiki formatting)
 
(27 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.76


| arma3 |= Game name
|gr1= Environment


|1.76|= Game version
|descr= Create a building ruin and hide the original object.
____________________________________________________________________________________________


| <pre>/*
|s1= building call [[BIS_fnc_createRuin]]


Description:
|p1= building: [[Object]] - building to "destroy"
Create a building ruin and hide the original object


Parameter(s):
|r1= [[Object]] - the created ruin
0: OBJECT


Returns:
|x1= <sqf>aBuilding call BIS_fnc_createRuin;</sqf>
OBJECT - ruin
*/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|x2= <sqf>
____________________________________________________________________________________________
// will destroy every building in a 50m radius around the player
private _nearBuildings = player nearObjects ["House", 50];
{ _x call BIS_fnc_createRuin } forEach _nearBuildings;
</sqf>


| <!-- [] call [[BIS_fnc_createRuin]]; --> |= Syntax
|seealso= [[setDamage]]
 
}}
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
 
|x1= <code></code> |=
____________________________________________________________________________________________
 
| |= See also


{{Note
|user= Beno_83au
|timestamp= 20190601131400
|text= 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 - {{Link|https://feedback.bistudio.com/T140045}}.
To get around this I've been hiding the object manually on all other clients:
<sqf>
_building call BIS_fnc_createRuin;
[_building, true] remoteExecCall ["hideObject", -clientOwner];
</sqf>
This will run [[hideObject]] on all other clients besides the client (or server) that this was executed from.
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Misc|{{uc:createRuin}}]]
[[Category:Functions|{{uc:createRuin}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:createRuin}}]]

Latest revision as of 16:21, 10 September 2023

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 private _nearBuildings = player nearObjects ["House", 50]; { _x call BIS_fnc_createRuin } forEach _nearBuildings;

Additional Information

See also:
setDamage

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
Beno_83au - c
Posted on Jun 01, 2019 - 13:14 (UTC)
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 - [1]. 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.