BIS fnc createRuin: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " {2,}\}\}" to " }}")
m (Some wiki formatting)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Function
{{RV|type=function


| arma3
|game1= arma3
|version1= 1.76


|1.76
|gr1= Environment


|gr1 = Environment
|descr= Create a building ruin and hide the original object.


| Create a building ruin and hide the original object.
|s1= building call [[BIS_fnc_createRuin]]


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


|p1= building: [[Object]] - building to "destroy"
|r1= [[Object]] - the created ruin


| [[Object]] - the created ruin
|x1= <sqf>aBuilding call BIS_fnc_createRuin;</sqf>


|x1= <code>aBuilding [[call]] [[BIS_fnc_createRuin]];</code>
|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>


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


 
{{Note
 
|user= Beno_83au
 
|timestamp= 20190601131400
[[Category:Functions|{{uc:createRuin}}]]
|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}}.
[[Category:{{Name|arma3}}: Functions|{{uc:createRuin}}]]
To get around this I've been hiding the object manually on all other clients:
 
<sqf>
<!-- CONTINUE Notes -->
_building call BIS_fnc_createRuin;
<dl class="command_description">
[_building, true] remoteExecCall ["hideObject", -clientOwner];
<dd class="notedate">Posted on June 1, 2019 - 13:14 (UTC)</dd>
</sqf>
<dt class="note">[[User:beno_83au|beno_83au]]</dt>
This will run [[hideObject]] on all other clients besides the client (or server) that this was executed from.
<dd class="note">
}}
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:<br><br>
<code>_building call BIS_fnc_createRuin;<br>[_building,true] remoteExecCall ["hideObject",-clientOwner];</code><br>
This will run '''hideObject''' on all other clients besides the client (or server) that this was executed from.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 17: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.