Page MenuHomeFeedback Tracker

Respawn menu doesn't spawn player on the location he chooses
Closed, ResolvedPublic

Description

Try a mission with respawnTemplates[] = {"MenuPosition"}; and respawn. You will see that the respawn location list and the Suspend and Respawn buttons flicker constantly which indicates some script is running in the background and updating the respawn location list. This is bothering some players that choose a respawn location then hit "Respawn" button and find themselves in a random position (maybe the background script temporarily defaults the selection to item number 0 in the list which is "random").

Details

Legacy ID
58523095
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
Menu UI

Event Timeline

d3nn16 edited Steps To Reproduce. (Show Details)Sep 13 2014, 12:59 AM
d3nn16 edited Additional Information. (Show Details)
d3nn16 set Category to Menu UI.
d3nn16 set Reproducibility to Always.
d3nn16 set Severity to None.
d3nn16 set Resolution to Fixed.
d3nn16 set Legacy ID to 58523095.May 7 2016, 7:25 PM

Yes, confirmed.

Also noticed this behavior. It started happening with the changes along with the ZEUS update and the reworking of the respawn menu, especially respawnTemplates[] = {"MenuPosition"}; . Before, the respawns were working correctly at the selected positions.

Fixed in the dev version already

Thank you Karel!

Will test it when it is integrated into the stable branch.

d3nn16 added a subscriber: d3nn16.May 7 2016, 7:25 PM

The flickering is indeed fixed (this wasn't really the issue but it looked more like the cause).
The fact that player doesn't respawn on the location he chose is not fixed. This was the issue I wanted to report but maybe I chose bad ticket title.

If anyone is editing the code of the respawn menu ([player] spawn BIS_FNC_RESPAWNMENUPOSITION) please share your fix before BIS solves this.

I should maybe mention that I am using respawn markers (respawn_west_xxx, respawn_east_xx) with script added positions, maybe this is causing the trouble.

I removed the "respawn_west/east_xxx" markers and tried calling BIS_FNC8ADDRESPAWNPOSITION with both objects and position arrays. The result is the same I respawn on the position where I died.
respawn = "BASE";
respawnDelay = 10;
respawnDialog = 0;

Tried with and without respawnTemplates[] = {"Base"};

Maybe the problem comes from the fact I'm calling "[player] spawn BIS_FNC_RESPAWNMENUPOSITION" from script and haven't defined any respawn templates (respawnTemplates[] = {"MenuPosition"}). It seems that [player] spawn BIS_FNC_RESPAWNMENUPOSITION must be also called at player respawn. Adding [player] spawn BIS_FNC_RESPAWNMENUPOSITION to onPlayerRespawn.sqf file seems to fix the issue (I respawn where I select).

A call BIS_fnc_addRespawnPosition used with the target parameter type SIDE, will result in a long list of errors and respawn is not possible. Parameter type GROUP works, as do the marker respawns (did not test for namespace, objects).

https://community.bistudio.com/wiki/BIS_fnc_addRespawnPosition

Error log excerpt:
Error in expression <ist lbsetdata [_lbAdd,_xStr];
_ctrlList lbsetpicture [_lbAdd,_picture];
if (_xSt>

Error position: <lbsetpicture [_lbAdd,_picture];

if (_xSt>

Error Type Any, expected String

File A3\functions_f\respawn\fn_respawnMenuPosition.sqf, line 297
Error in expression <ist lbsetdata [_lbAdd,_xStr];
_ctrlList lbsetpicture [_lbAdd,_picture];
if (_xSt>

Error position: <lbsetpicture [_lbAdd,_picture];

if (_xSt>

Error Type Any, expected String

File A3\functions_f\respawn\fn_respawnMenuPosition.sqf, line 297

and so on...

I finally fixed this problem by doing the following:

description.ext
respawnTemplates[] = {};

init.sqf
player addEventHandler
[
"Respawn",
{

		_new_unit = _this select 0;
		_dead_body = _this select 1;

		if (not (_dead_body getVariable ["zcm_isrevived", false])) then
		{
			[_new_unit, nil, nil, 10] spawn BIS_FNC_RESPAWNMENUPOSITION;
		};

}
];

With the above I can call [player, nil, nil, 10] spawn BIS_FNC_RESPAWNMENUPOSITION and it will work as expected.

I haven't experienced errors reported by caliban although I am using side type of target (_respid = [playerSide, player call ZCM_F_POS, localize "STR_ZCM_ITEM_MHQ"] call MBIS_FNC_ADDRESPAWNPOSITION;).

So from my point of view this ticket can be closed.

Addition/correction to my note from above.

The respawn menu is working correctly, with Side/Namespace target parameters. The problem was, that BIS_fnc_addRespawnPosition expects the position in an [x, y, z] format, providing only [x, y] coordinates will result in the error described above. The client menu respawn dialog will not show the correct markers then and the respawn not work.

Maybe this can be added in the description for the function.

Summary:
_CreatedRespawnPositionArray = [WEST, [1, 1], "Respawn menu string"] call BIS_fnc_addRespawnPosition; -> will NOT work.

_CreatedRespawnPositionArray = [WEST, [1, 1, 0], "Respawn menu string"] call BIS_fnc_addRespawnPosition; -> works as intended.

Mass-closing all resolved issues not updated in the last month.

Please PM me in BI Forums (http://forums.bistudio.com/member.php?55374-Fireball) if you feel your bug was closed in error.