• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

3D Can someone give me an example of a working inventory for 3D?

R

RektByValve

Guest
I tried many tutorials and even tried my own ways. Unfortunately none of them worked. If you have a working inventory that works in 3D please let me know!! I need it for my 3D survival game.
 

TsukaYuriko

☄️
Forum Staff
Moderator
What exactly would an "inventory that works in 3D" be? What makes any other inventory not work in 3D - as in, what does it need to work in 3D? Inventory systems aren't inherently limited to be usable only in 2D or only in 3D, so I'm a bit lost regarding what exactly an "inventory for 3D" is supposed to be...
 
R

RektByValve

Guest
Alright let me explain, what I mean by a 3D inventory is a inventory that would be the same as a 2D one but just with some lines of code changed so that iw would be compatible with 3D. If you still didn't understand what I mean here is that instead of drawing the inventory in 2D I want it so it draws in 3D and usable (by usable I mean so that you can move your mouse and stuff since when you have a 3D game the mouse locks to the center of the screen). Hope you know understand.
 

TailBit

Member
It is pretty much the drawing parts that would be different, as you could still detect slot position with mouse position in view..

"since when you have a 3D game the mouse locks to the center of the screen"
Not all 3D games does this .. so here you need to disable your own codes that is the cause of this .. make it possible to switch between first person for exploring and mouse control for menu management.
 
R

RektByValve

Guest
What I need rn is how do I make so that my cursor is not centered anymore when I enter for example the furnace. Hope you understand what I mean
 

FrostyCat

Redemption Seeker
What I need rn is how do I make so that my cursor is not centered anymore when I enter for example the furnace. Hope you understand what I mean
Having 3D graphics doesn't automatically center your mouse. The reason it's centered in your particular project is because you copied off a 3D game tutorial with mouse panning, and it works by centering the mouse on every step and capturing only the difference in cursor position. This is why it's so important to completely understand tutorial code, and also why blind copying is useless.

Look in your code for a function called window_mouse_set and the section of code responsible for mouse panning that comes after it. I'll denote this as /* Panning */. Now declare a global variable at the beginning of the game like this:
Code:
global.panning_enabled = true;
And wrap the panning code with a condition like this:
Code:
if (global.panning_enabled) {
  /* Panning */
}
Then whenever you show the inventory or do anything that requires the mouse panning adjustments to be off, set global.panning_enabled to false. And when you need the panning back, set it back to true.

This is a very basic technique that you should have mastered well before attempting anything 3D. I suggest that you halt all work on your "dream project" and get your basics in order first. Shirking off responsibility for every little part of your project to the World Wide Web is an unbecoming, disgraceful way to program.
 
R

RektByValve

Guest
THANKS!!!
Recent Edit: Nope still dosent work...I get the same result whenever I enter the furnace my cursor is still locked to the center of the screen
 
Last edited by a moderator:
Top