I’m trying to add the main player’s inventory to my game.
What is the expected result.
I’m using the standard inventory from the examples.
What is the actual result
When I change the camera zoom by 2x, when moving items inside the inventory, the actual location of the mouse cursor and the actual location of the dragged item differ by 2x, exactly by how much the camera zoom was applied.
**Question. I understand the reason but I don’t understand how to fix it.
The inventory slots and pointer object are located on their own layer called “inventory”. Can you apply 2x zoom on the inventory layer too? It should solve the problem.
Otherwise if you need to keep the zoom on the inventory 1x yes you need to do the math to take in to account the slots and pointer object in the inventory slots are on separate layers and the camera on the inventory layer has default 1x zoom.
Okay I have also realised, in the Inventory example when I position the pointer object to the mouse, I forgot to take in to account the possibility the camera on the base layer may going to move. So if you move the camera, it is possible the camera zoom got nothing to do with the problem you are experiencing, but I have positiond the pointer object on the mouse relative to base layer.
So what you need to do is change the expression from this:
Dear ddabrahim. I realize that I can take up your time and ask stupid questions.
But this is the second problem I have encountered with gdevelop.io.
How to import the code you sent me. I’ve seen videos on how to save a project, but I don’t know how to upload my code.
I didn’t manage to transfer the inventory to my game, so I took a standard example of inventory and started to transfer my game and all its mechanics there. Do you have any idea how ridiculous that sounds?
If you show me how to upload this file on gdevelop.io. I will be very grateful.
if you are using the browser version of GDevelop, it is possible you need to clear your cache and reload your project to see changes take effect.
I don’t personally use the browser version but it seems to me you need to extract the project from the zip, upload the folder to your Google Drive and you can import the project from your Google Drive.
After you have extracted the project folder from the zip, to open it just go build->Open a project next to the “+ Create a project” button
In the web version then select Google Drive and then your project.
In the desktop version select the project folder wherever it is on your computer.
I like the atmosphere, looks interesting.
If you have any further problems with the inventory example let me know, it was just a quick, dirty experiment 5 years ago so I would imagine there are tons of things I didn’t consider when I made it.
I knew you were making it.
What do you have to do with gdevelop.io?
Let me tell you something.
the icons for the test scenes are very lacking. I could help to make them for free so that people understand what it is about, because it is much easier to search visually.
Immediately after you helped me solve this problem I moved on. I would like the inventory can be dragged in space and again I have a stupor, how to implement this, because there are so many logical variables in dragging items inside the backpack. What to say about the full inventory.
I think that there will be no problem that objects are automatically added to the backpack when the player bumps into an object.
Of course the character’s backpack is great, but how about a backpack at the enemy and the ability to search it.
I would also very much like to be able to display a small information window when pointing at the object where there will be a description of what the object and why it is needed, as well as its characteristics.
I like to work with this mechanism, but the examples are not enough to realize more or less a game in an interesting mechanics.
I’m willing to pay if you can help me implement some mechanics in this game. I’m a designer with a lot of experience, but it’s quite difficult for me to understand even visual coding.
You can leave me your personal contacts and we can try to work of course if you are interested.
I am not a member of the dev team, I have only contributed with some examples years ago to help beginners but I have 0 control over how things are done with the website and the software or even the examples. Now that they have included the examples it is up to the dev team what they want to do with them. I have 0 control.
It can be easily done. Just make the background draggable and update the position of the slots every frame to stay in place.
I think you can just replace the mouse click event with a collision check and it should work. So instead of checking if the mouse was clicked, you check if the player did collide with it.
It can be done easily I would think using just some object variables, each enemy would have one or more random items stored in variables and display them when clicked. Then same logic apply if we click item, we put it in to inventory.
I think it would require only an additional variable to store a short description we can display when mouse is hover over or something.
If you can send me a link to your project in DM, maybe I can help you to implement some mechanics. I have some free time in the next couple days.