Page MenuHomeFeedback Tracker

selectWeapon "Put" or "Throw" won't stay on
New, WishlistPublic


If I want to script player placing down C4 so that he can "touchoff" later it with a scripted action there is a problem as selectWeapon "PipeBombMuzzle" for example will only flash for a split second in the ammo indicator and deselect itself. Because of this it is not possible to fire or reload "Put" weapon as it gets deselected very quickly.

If I force continuous selectWeapon via oneachframe for example it works but i need also to bring up some sort of GUI, so there is a way to allow it in the game for scripting control.


Legacy ID
Steps To Reproduce

spawn unit in editor
open debug console and type

player addAction ["Place Mine", {
player addMagazine "APERSMine_Range_Mag";
oneachframe {player selectWeapon "ClassicMineRangeMuzzle"};
player fire ["ClassicMineRangeMuzzle", "ClassicMineRangeMuzzle", "APERSMine_Range_Mag"];
player action ["Gear", player];

  • spawn {
		waitUntil {dialog};
		sleep 1;
		closeDialog 0;
		oneachframe {};



Notice how Put weapon shows when dialog is open

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Scripting.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Open.
Killzone_Kid set Legacy ID to 3696793968.May 7 2016, 4:36 PM
Bohemia added a subscriber: AD2001.Sep 8 2013, 11:50 AM

ArmA 3, v1.10 official:
the following code, put into a unit (named buddy) init field:

oneachframe { buddy selectWeapon "Throw"; buddy globalchat format["%1", currentweapon buddy]; };

Always returns unit's primary weapon.
Enclosing code into a spawn {} block does not change the result.