Whenever I use setVariable on a location, it does not work. It does work on other objects though.
Description
Details
- Legacy ID
- 3001373828
- Severity
- None
- Resolution
- Open
- Reproducibility
- Always
- Category
- Scripting
_loc = nearestLocation [[0,0,0], _type];
_loc setVariable ["WepObAr", "Value"];
hint format["%1", _loc getVariable "WepObAr"];
returns null
I need to have variables for each town to contain an array of objects that has to spawn there.
Event Timeline
setVariable does work with mission created locations, but (like almost all of the other set* location commands) does not work on locations that are part of the current terrain definition - consider them read only
As far as I know, setSide is the only one that does modify these locations
Thank you for the info ceeeb. What would you suggest I do to keep information per location? Maybe an array that I need to spam with publicVariable?
To go around you could always create a game logic at the coordinates of the location (can be read from config). Since the setVariable command works on game logics you could store your variables there.
no need to read config. location position can be be found with both locationPosition and position commands.