Page 1 of 1

Questions about the inventory system

Posted: Wed Apr 17, 2013 2:37 am
by Nugetti
Greetings!

As we know, there are calls like "A_GiveInventory" and the like.
The questions:

1. Is there a way to actually check what the player has in his inventory UI-wise? Like a list or something with item/ammo types and quantities.

2. How would one (or is it possible to) go and create a rather basic inventory system which uses pre-defined keys for navigation? Something like:
- Player presses the "I" key. An UI overlay pops up, with a simple 3x6 grid made of squares, each square could contain one type of item.
- The player can navigate the inventory with the arrow keys. Pressing use would activate/consume the selected item, if possible. Pressing a predefined drop key would remove said item from inventory and throw it on the ground.

Thanks guys!

RE: Questions about the inventory system

Posted: Wed Apr 17, 2013 2:47 am
by Ænima
Nugetti wrote: Greetings!

As we know, there are calls like "A_GiveInventory" and the like.
The questions:

1. Is there a way to actually check what the player has in his inventory UI-wise? Like a list or something with item/ammo types and quantities.
Type "printinv" in the console. c:
Nugetti wrote: 2. How would one (or is it possible to) go and create a rather basic inventory system which uses pre-defined keys for navigation? Something like:
- Player presses the "I" key. An UI overlay pops up, with a simple 3x6 grid made of squares, each square could contain one type of item.
- The player can navigate the inventory with the arrow keys. Pressing use would activate/consume the selected item, if possible. Pressing a predefined drop key would remove said item from inventory and throw it on the ground.
I've done something similar in my Mercenaries mod (a grid-based "buy menu" system where you can buy items) but I haven't seen a grid-based inventory screen yet. Basically, what you need to accomplish this is a lot of GetPlayerInput and HudMessage. And a lot of ACS know-how.

RE: Questions about the inventory system

Posted: Wed Apr 17, 2013 3:14 am
by Watermelon
If you want to go to the next level you could use a mouse and create your own one. I should make a public thingy for people to use.

RE: Questions about the inventory system

Posted: Wed Apr 17, 2013 7:18 am
by Nugetti
Thanks for the quick replies guys.

Another Q:
- How would one make the FBF_NORANDOM flag work with A_FireBullets? Do I need the beta build of Zandronum to get support for this flag?

Code: Select all

A_FireBullets(2,2,1,12,"BulletPuff",FBF_NORANDOM)
Shouldn't it work like that?

RE: Questions about the inventory system

Posted: Wed Apr 17, 2013 7:31 am
by -Jes-
Puff NORANDOM does indeed not work in Zandro 1.0

It's in the 1.1 beta.

RE: Questions about the inventory system

Posted: Wed Apr 17, 2013 8:11 am
by Ivan
I think ijon was working on something like this. Not sure.

RE: Questions about the inventory system

Posted: Wed Apr 17, 2013 9:47 am
by Nugetti
-Jes- wrote: Puff NORANDOM does indeed not work in Zandro 1.0

It's in the 1.1 beta.
Thank you! Works perfectly fine in the beta.

This is turning into a question thread, but as you guys seem to be very helpful I might as well ask stuff.

Q: MoveBob can be set via a CVAR which is placed in the .ini when you use the archivecvar command.

Is there any way to force CVARs in .wad files - so it would work for everybody when you play online?

I dont think it would go in DECORATE, so some other file entry perhaps?

RE: Questions about the inventory system

Posted: Wed Apr 17, 2013 9:52 am
by Ivan
Nugetti wrote:
-Jes- wrote: Puff NORANDOM does indeed not work in Zandro 1.0

It's in the 1.1 beta.
Thank you! Works perfectly fine in the beta.

This is turning into a question thread, but as you guys seem to be very helpful I might as well ask stuff.

Q: MoveBob can be set via a CVAR which is placed in the .ini when you use the archivecvar command.

Is there any way to force CVARs in .wad files - so it would work for everybody when you play online?

I dont think it would go in DECORATE, so some other file entry perhaps?
Forcing things through inis are not a good idea unless it's absolutely needed, and in your case it doesn't seem like it is. You can however disable weapon bobbing by using the +NOBOB flag.

RE: Questions about the inventory system

Posted: Wed Apr 17, 2013 10:15 am
by Nugetti
Ivan wrote: Forcing things through inis are not a good idea unless it's absolutely needed, and in your case it doesn't seem like it is. You can however disable weapon bobbing by using the +NOBOB flag.
I am currently using the +DONTBOB flag in my weapons, since the Weapon.BobRangeX and BobRangeY are not supported or I'm using them wrong.

However, I was talking about the player movement bobbing - how much the crosshair and view bob when you move. Surely it's a personal preference but for my (survival horror-esque) project the default bobbing seems too arcade-ish. :wink:

RE: Questions about the inventory system

Posted: Thu Apr 18, 2013 8:16 am
by Nugetti
Sorry for doublepost.

Another Q:

Is it possible to sort of "mix" ACS & DECORATE?

I read some stuff about GetPlayerInput. Would it be possible to create a "stamina" system to prevent infinite running via ACS by using an "if" parameter and BT_SPEED?
What I mean is, it would A_GiveInventory on each tic if BT_SPEED is pressed, and would disable BT_SPEED (or somehow modify player speed) if a certain amount of "negative" stamina has accumulated.

RE: Questions about the inventory system

Posted: Thu Apr 18, 2013 11:59 am
by Ijon Tichy
you can call ACS from DECORATE with ACS_ExecuteAlways and ACS_ExecuteWithResult, and you can "execute" DECORATE with ACS by using +AUTOACTIVATE CustomInventory items, but you can't mix the two languages together

the most overlap they have is in the action specials, which they can both use

btw ACS has GiveInventory and TakeInventory