Admittedly this may not be a bug..but without knowing a way to resolve it, I thought I would report it.
Does the issue occur in the editor or during gameplay? If it occurs during gameplay, please specify which movement system is being used (free movement or grid movement):
Gameplay.
Briefly describe the issue you're experiencing:
If you query a custom container widget's contents before opening the container then it will be null.
if widget["container"].element["0001"].item ! = null then
display_message("item slot filled");
else
display_message("Item Slot Vacant");
end;
That will always show the slot being vacant, even if you place an item in the container in the map editor.
I even tried add_item_to_container() in startup to see if it would force it to be filled at the start.
If you show_widget("container"), it will also be empty.
However, as soon as you open the container (showing an item in the slot), then even if closed, it will now actually show the item filled message.
show_widget("container") will now also show the items
Are there any errors in the in-game debug console or external console window?
No
Provide the steps necessary to reproduce the issue:
- create a container, with a custom container widget, and put something in it using the + button
- quick play
- use console to execute the following:
if widget["container"].element["0001"].item != null then display_message("FILLED"); else display_message("VACANT"); end;
- VACANT will show, and if you show_widget() it will be empty.
- actually interact with the container object and open the container...that wiget will have the items in it.
- re-run the "if" console command and now it will accurately return FILLED, and show_widget() will show the container contents, including showing the container name text, which the first time it just used the widget editor text.