BIS fnc addRespawnPosition: 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 - " " to " ")
(39 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function


| arma3 |Game name=
|game1= arma3
|version1= 0.50


|0.50|Game version=
|gr1= Respawn


|gr1= Respawn |GROUP1=
|eff= global


|eff= global |MPeff=
|descr= Add a respawn position for the [[Arma 3: Respawn|{{arma3}} Respawn Menu]].


| Add a respawn position for [[Arma 3 Respawn#MenuPosition|respawn menu]]. |DESCRIPTION=
|s1= [target, position, name] call [[BIS_fnc_addRespawnPosition]]


| [<target>,<position>] call [[BIS_fnc_addRespawnPosition]]; |SYNTAX=
|p1= '''target''': [[Namespace]], [[Side]], [[Group]] or [[Object]] - receiver of the respawn position. Use [[missionNamespace]] to add the position to everyone


|p1= '''target''': Receiver of the respawn position
|p2= '''position''': [[Array]], [[Object]] or [[String]]
*[[Namespace]] - use [[missionNamespace]] to add the position to everyone
* [[Array]] - format [[Position#PositionATL|PositionATL]]
*[[Side]]
* [[Object]] - specific object. When some crew positions are available and unlocked, players will be respawned on them, otherwise they will appear around the object.
*[[Group]]
* [[String]] - marker name
*[[Object]]|Parameter1=
|p2= '''position''':
*[[Array]] - format [[Position]]
*[[Object]] - specific object. When some crew positions are available and unlocked, players will be respawned on them, otherwise they will appear around the object.
*[[String]] - marker name|Parameter2=


|p3= '''name (optional)''':
|p3= '''name''': [[String]] - (Optional) respawn name, can be text or link to localization key
*[[String]] - respawn name, can be text or link to localization key|PARAMETER3=


| [[Array]] - format [target,id] (used in [[BIS_fnc_removeRespawnPosition]]) |RETURNVALUE=
|r1= [[Array]] - format [target,id] (used in [[BIS_fnc_removeRespawnPosition]])
 
|x1= <code><nowiki>[</nowiki>[[west]], myRespawnAPC] [[call]] [[BIS_fnc_addRespawnPosition]];</code> |Example1=


|x2= <code>myRespawn<nowiki> = [</nowiki>[[missionNamespace]],"arena","Battle Arena"] [[call]] [[BIS_fnc_addRespawnPosition]];</code> |EXAMPLE2=
|x1= <sqf>[west, myRespawnAPC] call BIS_fnc_addRespawnPosition;</sqf>


| [[BIS_fnc_removeRespawnPosition]], [[Arma 3 Respawn]], [[BIS_fnc_respawnTickets]]|SEEALSO=
|x2= <sqf>myRespawn = [missionNamespace,"arena","Battle Arena"] call BIS_fnc_addRespawnPosition;</sqf>


|seealso= [[BIS_fnc_removeRespawnPosition]] [[Arma 3: Respawn]] [[BIS_fnc_respawnTickets]]
}}
}}


{{Note
|user= Krzmbrzl00
|timestamp= 20160601112200
|game= arma3
|text= Make sure the used [[Position]] is in format [[Position#Introduction|Position3D]] (i.e. it contains a third coordinate (z-coordinate)) because otherwise you will get an error as soon as you open the respawn screen and you will be respawned at position [0,0,0] (lower left corner of the map), although the map marker for the spawn position is placed as intended
}}


<h3 style="display:none">Bottom Section</h3>
{{Note
 
|user= Leopard20
[[Category:Functions|{{uc:addRespawnPosition}}]]
|timestamp= 20220708173814
[[Category:{{Name|arma3}}: Functions|{{uc:addRespawnPosition}}]]
|text= As of {{arma}} 3 {{GVI|arma3|2.10}}, when you use an object as the respawn position on water (e.g. on a carrier), the respawn position is incorrect. Instead, just pass the [[Position#PositionATL|ATL position]]. For example, if you intend to add a respawn position in [[3DEN]], instead of the respawn position module, place a dummy object such as '''User Texture (1m)''' ({{hl|class UserTexture1m_F}}) and paste this in its init:
 
<sqf>
<!-- CONTINUE Notes -->
if (isServer) then {
<dl class="command_description">
[BLUFOR, getPosATL this, "My West Respawn"] call BIS_fnc_addRespawnPosition;
<dd class="notedate">Posted on July 1, 2016 - 11:22 (UTC)</dd>
deleteVehicle this;
<dt class="note">[[User:Krzmbrzl00|Krzmbrzl00]]</dt>
}
<dd class="note">
</sqf>
Make sure the used [[Position]] is in format [[Position3D]] (i.e. it contains a third coordinate (z-coordinate)) because otherwise you will get an error as soon as you open the respawn screen and you will be respawned at position [0,0,0] (lower left corner of the map), although the map marker for the spawn position is placed as intended
This code adds a respawn position at the position of the dummy object, and deletes the dummy object afterwards.
</dd>
}}
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 12:12, 27 July 2022

Hover & click on the images for description

Description

Description:
Add a respawn position for the Arma 3 Respawn Menu.
Execution:
call
Groups:
Respawn

Syntax

Syntax:
[target, position, name] call BIS_fnc_addRespawnPosition
Parameters:
target: Namespace, Side, Group or Object - receiver of the respawn position. Use missionNamespace to add the position to everyone
position: Array, Object or String
  • Array - format PositionATL
  • Object - specific object. When some crew positions are available and unlocked, players will be respawned on them, otherwise they will appear around the object.
  • String - marker name
name: String - (Optional) respawn name, can be text or link to localization key
Return Value:
Array - format [target,id] (used in BIS_fnc_removeRespawnPosition)

Examples

Example 1:
[west, myRespawnAPC] call BIS_fnc_addRespawnPosition;
Example 2:
myRespawn = [missionNamespace,"arena","Battle Arena"] call BIS_fnc_addRespawnPosition;

Additional Information

See also:
BIS_fnc_removeRespawnPosition Arma 3: Respawn BIS_fnc_respawnTickets

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
Krzmbrzl00 - c
Posted on Jun 01, 2016 - 11:22 (UTC)

Make sure the used Position is in format Position3D (i.e. it contains a third coordinate (z-coordinate)) because otherwise you will get an error as soon as you open the respawn screen and you will be respawned at position [0,0,0] (lower left corner of the map), although the map marker for the spawn position is placed as intended

Leopard20 - c
Posted on Jul 08, 2022 - 17:38 (UTC)
As of Arma 3 Arma 3 logo black.png2.10, when you use an object as the respawn position on water (e.g. on a carrier), the respawn position is incorrect. Instead, just pass the ATL position. For example, if you intend to add a respawn position in 3DEN, instead of the respawn position module, place a dummy object such as User Texture (1m) (class UserTexture1m_F) and paste this in its init:
if (isServer) then { [BLUFOR, getPosATL this, "My West Respawn"] call BIS_fnc_addRespawnPosition; deleteVehicle this; }
This code adds a respawn position at the position of the dummy object, and deletes the dummy object afterwards.