Page MenuHomeFeedback Tracker

"DropBag" action is broken
Closed, ResolvedPublic


  _backpack = unitBackpack _unit;
  _backpackWH = "GroundWeaponHolder" createVehicle (position _unit);
  _backpackType = typeOf _backpack;

  _unit action ["DropBag", _backpackWH, _backpackType];

...does not work most of the time, and instead:

  Action::Process - No target [action: DropBag]

...pops up in the RPT-file. It does work occasionally though (no idea why), but rather rarely.
The other action "PutBag" works fine, but then you don't have a pointer to the weapon holder - which is kind of handy, if you'd like to "AddBag" the backpack later on...


Legacy ID
No Bug
Steps To Reproduce

Spawn some guys with backpacks, and try to "DropBag". Observe results.

Additional Information

Event Timeline

ruebe edited Steps To Reproduce. (Show Details)Apr 19 2015, 8:29 PM
ruebe edited Additional Information. (Show Details)
ruebe set Category to Scripting.
ruebe set Reproducibility to Random.
ruebe set Severity to None.
ruebe set Resolution to No Bug.
ruebe set Legacy ID to 3417314912.May 8 2016, 11:58 AM
ruebe added a subscriber: ruebe.
ruebe added a comment.Apr 19 2015, 9:04 PM

Wild guess: could it be possible that, by the time the unit is playing that action/animation (looks like it would open a door? So it's maybe even the wrong animation?) to drop the bag, the weaponholder got already *deleted* again by the engine in the meantime?

Empty weaponholders get automatically deleted rather quickly, right? So maybe the action doesn't execute fast enough?

That would also explain, why it sometimes does work afterall: maybe the unit didn't have to move, and could execute that action rightaway, and luckily the weaponholder was still there!

^^ Pretty sure this is it (a quick test at least confirmed how the weapon holder turned to objNull a state later in my FSM). With this aggressive deletion of empty weaponholders, actions like this "DropBag" are completely unusable (and no: there is no other command between creating the weapon holder and executing the action...). :(

Use Weapon_Empty class that doesnt autodelete or put something in normal weaponholder to stop it from getting deleted. Not a bug.

Okay, I see how the problem is more about weaponholders, and not so much about the "DropBag"-action. Still, anyone reading will most likely end up here right away...

Use Weapon_Empty class that doesnt autodelete

Uhm, as in:

  _backpackWH = "Weapon_Empty" createVehicle _pos;
  _unit action ["DropBag", _backpackWH, _backpackType];

? Because that doesn't seem to be working for backpacks(?). But I don't get any RPT spam, so that probably means, the weaponholder is still there, the moment the action gets executed. Could you please confirm that you're able to drop backpacks in this way? :/

[...] or put something in normal weaponholder to stop it from getting deleted

Ugh, I'd rather not start with such hacks/workarounds... a clear sign that something *is* broken (even if not on the lowest, technical level).

Is there another weaponholder-class, maybe inheriting from Weapon_Empty, that I'm missing? And couldn't the engine simply check on recieving an action "DropBag" (...or any other action with potential to get an empty weaponholder) if it got a weaponholder, and if so, then stop trying to delete it, until that action has finished... or something along those lines?

IMHO such engine-subtleties should *not* be exposed by the API. That's - apparently - super fragile. :(

"Weapon_Empty" works, no idea why you say it doesnt

ruebe added a comment.Apr 20 2015, 7:53 PM

*gnaaaah*, right!

I did something stupid while trying to make this work and haven't undone that mess, which is why it didn't work in my actual thing as I gave this "Weapon_Empty" a quick try earlier.

But it works flawless in a small example mission I've now put together, so yay!

Thanks for pitching in! ;)

PS. Oh, and thanks for updating the community wiki. I was just about to do that, now that I have all the missing pieces together. :)