Questions about the inventory system

Discuss all aspects related to modding Zandronum here.
Post Reply
Nugetti
New User
Posts: 12
Joined: Wed Apr 17, 2013 2:15 am
Location: Finland

Questions about the inventory system

#1

Post by Nugetti » Wed Apr 17, 2013 2:37 am

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!

User avatar
Ænima
Addicted to Zandronum
Posts: 3579
Joined: Tue Jun 05, 2012 6:12 pm

RE: Questions about the inventory system

#2

Post by Ænima » Wed Apr 17, 2013 2:47 am

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.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: Questions about the inventory system

#3

Post by Watermelon » Wed Apr 17, 2013 3:14 am

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.

Nugetti
New User
Posts: 12
Joined: Wed Apr 17, 2013 2:15 am
Location: Finland

RE: Questions about the inventory system

#4

Post by Nugetti » Wed Apr 17, 2013 7:18 am

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?

User avatar
-Jes-
Frequent Poster Miles card holder
Posts: 975
Joined: Fri Aug 03, 2012 9:55 am
Location: Void Zone

RE: Questions about the inventory system

#5

Post by -Jes- » Wed Apr 17, 2013 7:31 am

Puff NORANDOM does indeed not work in Zandro 1.0

It's in the 1.1 beta.

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Questions about the inventory system

#6

Post by Ivan » Wed Apr 17, 2013 8:11 am

I think ijon was working on something like this. Not sure.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Nugetti
New User
Posts: 12
Joined: Wed Apr 17, 2013 2:15 am
Location: Finland

RE: Questions about the inventory system

#7

Post by Nugetti » Wed Apr 17, 2013 9:47 am

-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?
Last edited by Nugetti on Wed Apr 17, 2013 9:47 am, edited 1 time in total.

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Questions about the inventory system

#8

Post by Ivan » Wed Apr 17, 2013 9:52 am

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.
Last edited by Ivan on Wed Apr 17, 2013 9:53 am, edited 1 time in total.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Nugetti
New User
Posts: 12
Joined: Wed Apr 17, 2013 2:15 am
Location: Finland

RE: Questions about the inventory system

#9

Post by Nugetti » Wed Apr 17, 2013 10:15 am

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:

Nugetti
New User
Posts: 12
Joined: Wed Apr 17, 2013 2:15 am
Location: Finland

RE: Questions about the inventory system

#10

Post by Nugetti » Thu Apr 18, 2013 8:16 am

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.

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Questions about the inventory system

#11

Post by Ijon Tichy » Thu Apr 18, 2013 11:59 am

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
Last edited by Ijon Tichy on Thu Apr 18, 2013 12:00 pm, edited 1 time in total.

Post Reply