Because the target variable (name) must be clearly declared, and canât be modified dynamically.
Allowed: toolBox.page1.row1.column1.name
What I need: toolBox.pageX.rowY.columnZ.name
X,Y,Z value will be based from other variable.
Need help with this or suggestion for another way to move items to another slots.
Thanks.
In the second one thatâs underlined in red, it looks like youâre adding a number to a string instead of another string. Either change the variable to a string or use ToString() like you did in your first image.
It can move selected slot to current slot but failed to move current slot to selected slot, basically its just swapping the two slots but I only managed to do it half way.
Current slot position is top left with âhoeâ in it.
The several text in the pic is to keep track of the variable used.
I want to move the âhoeâ to the slot bellow it, currently its still empty thus the text TOOL PAGE1 ROW1 COLUMN1 = 0.
Now i move down and press a button to complete the process, and the slot now become âhoeâ and the text TOOL PAGE1 ROW1 COLLUMN1: HOE.
The first problem is the slot above should have become empty, but it still display âhoeâ (because it should be swapped).
The second problem is when I select the âhoeâ(below) that has been moved from above it, the text TEMPORARY TOOL: should display âHoeâ but instead it display [OBJECTOBJECT].
Sorry if my explanations is bad.
Thanks
Iâll look at the code in a bit. Iâm currently using my phone. What code are you using to display the information getting the return of âobjectâ? Sounds like youâre looking at an object not a variable. Maybe youâre missing the final part of the variable like .name
From what you posted; it looks good. Maybe thereâs a typo Iâm not seeing or the problem is in another section. What does the code look like where you do the moving of the sprites? I would also make sure everything that needs to have a âonce while trueâ condition has one.
Can you post a larger image showing the variable actions together with the preceding lines for context?
What causes both the variables that the arrow is pointing at to be true? And is this line supposed to be a sub-event of the previous line because it doesnât have any actions.
The first variable will become true if player press Z, and the current position of the slot will become selected slot.
The second variable will become true if Z key is released.
You can move to other slot using arrow keys, and the position of the slot â current slot.
By Pressing Z key(and you are currently didnât select any slot) the current position of the slot will become â selected slot.
Move the position of current slot using arrow keys to the other slot you want to change the value.
By pressing Z key if you already have a selected slot then the value of the selected slot will be moved to the new slot (or the current slot/ new position)
I thought that empty event will just get ignored by GDev, so it will just become the sub event of Z key press event.
I also think that it should be good not sure why.
Moving a structure Var1 to structure Var2 then move structure Var2 to structure Var3 should be possible right? But somehow when moving structure Var2 to structure Var3 it become object instead, its like it can only be done once.
I use it to prevent it keep executing events when the key is pressed.
Z key is used to display inventory window, after the inventory window is displayed because Z is still being pressed it will immediately execute another event thatâs why I disable Z key after being used and to use Z key again you need to release Z key first.