Page MenuHomeFeedback Tracker

GetInCargo action index is not the same as cargo index
New, NormalPublic

Description

The index used by the GetInCargo action is the config index, not cargo index. It should be the cargo index (to comply with the wiki, getInTurret action, and the moveInCargo command),

Details

Severity
Minor
Resolution
Open
Reproducibility
Sometimes
Operating System
Windows 10 x64
Category
Scripting
Steps To Reproduce
  1. Create a "Van (Cargo)" vehicle in 3den (name it "van") and spawn an AI too (name it "ai")
  2. Run this script:
[] spawn {
  ai action ["getInCargo", van, 3];
  sleep 2;
  systemChat str (fullCrew [van, "cargo", false] param [0,[]] param [2, -1])
};
  1. It prints 5 instead of 3 (which is what I passed to the action). The cargo array for this vehicle is [0,3,4,5,6,9] (and 5 is indeed at index 3)

Event Timeline

Leopard20 updated the task description. (Show Details)Fri, Mar 14, 8:31 PM
Leopard20 updated the task description. (Show Details)Fri, Mar 14, 8:34 PM