Page MenuHomeFeedback Tracker

getMissionConfigValue returns a hash instead of value
Closed, ResolvedPublic

Description

For the record, on 1.56RC but it isn't available in product version. RC isn't available in Game Version, so I hope choosing the stable branch would be correct for RC.

Based on the description in the BIKI, getMissionConfigValue seems to behave erratically. Rather than returning the relevant value as a number, text or array, it seems rather to return a hash.

Details

Legacy ID
2486560868
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
Scripting
Steps To Reproduce

General directions

  • Create a custom class in your description.ext.
  • Set a value of some sort within the class.
  • Try to fetch the value with getMissionConfigValue.

Specific example

  • Add the attached description.ext to a mission.
  • Go ingame and type the following in the debug console:

hint format["Value: %1", getMissionConfigValue "CfgAutodoor" >> "Vehicles" >> "Land_Airport_side_base_F" >> "doorList"];

  • Observe as it displays something like this in the hint dialog:

Value: 02558CB8

Additional Information

The following excerpts from the BIKI is what makes this seem like incorrect behaviour:

  • "Returns value of given scenario attribute from the 1st tier."
  • "Return Value: Number, String or Array, depending on the attribute value type. Nil when the attribute is undefined."

Currently, in order to get the value you still have to fall back on the old getNumber/getText/getArray commands combined with getMissionConfig.

This is the aforementioned description.ext I've been used:
allowFunctionsLog = 1;

class CfgAutodoor {
class Vehicles {

		class Land_Airport_side_base_F {
			class Door_7 {
				class delays {
					stayOpen = 5;
					reopen = 0.5;
					closeReactivate = 0.1;
				};
				class disablerBIS {
					value = 1;
					varname = "bis_disabled_Door_7";
				};
				doorList[] = {
					"Door_7A_move",
					"Door_7B_move"
				};
				class sensor {
					radius = 4;
					triggerSelection = "Door_7_trigger";
				};
			};
			class Door_8: Door_7 {
				class disablerBIS: disablerBIS {
					varname = "bis_disabled_Door_8";
				};
				doorList[] = {
					"Door_8A_move",
					"Door_8B_move"
				};
				class sensor: sensor {
					triggerSelection = "Door_8_trigger";
				};
			};
		};
		class Land_Airport_right_F: Land_Airport_side_base_F {};
		class Land_Airport_left_F: Land_Airport_side_base_F {};

};
};

Event Timeline

Kresjah edited Steps To Reproduce. (Show Details)Feb 14 2016, 4:47 PM
Kresjah edited Additional Information. (Show Details)
Kresjah set Category to Scripting.
Kresjah set Reproducibility to Always.
Kresjah set Severity to None.
Kresjah set Resolution to Fixed.
Kresjah set Legacy ID to 2486560868.May 8 2016, 1:44 PM
Kresjah edited a custom field.

https://community.bistudio.com/wiki/getMissionConfigValue supports string or array. You are not passing string, but some hybrid of string and config. Make sure it is either string or array.

Kresjah added a subscriber: Kresjah.May 8 2016, 1:44 PM

Does this then imply that getMissionConfigValue can not access subclasses, and as such is not a replacement for using getNumber/getText/getArray along with missionConfigFile/getMissionConfig? Or does this require a special syntax?

Please read the description of the command

"Returns value of given scenario attribute from the 1st tier"

1st tier means it cannot access subclasses

My apologies. I honestly missed out on that. I have misinterpreted the command then.