View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000399 | Gameplay + OpenGL | [All Projects] Feature | public | 2017-03-07 09:52 | 2017-03-08 05:50 |
Reporter | Lud | ||||
Assigned To | |||||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | closed | Resolution | no change required | ||
Platform | Microsoft Windows | OS | Windows | OS Version | 10 |
Summary | 0000399: Ability to use variables for Inventory.MaxAmount. | ||||
Description | Either that or a function such as A_SetMaxInventory. Can make the latter a separate report if needed, but it's basically the same thing, essentially. I would use it so that I can customize the actor's MaxAmount from within the game and not have to tinker with the source code every time. | ||||
Tags | No tags attached. | ||||
You can do that with ZScript. MaxAmount is a normal interger variable in the Inventory class. But you have to be careful, if the item gets completely removed you will lose the counter! |
|
So where in this code am I screwing up? What I'm trying to do is to be able to set the MaxInventory property on creating the actor in the inventory so I can dynamically adjust how many items of that class the player can have. I have a feeling it might be the wrong function, but I can't seem to find the right one. I get this error on start-up: Unable to access class member CustomVar from constant declaration My debugging skills when it comes to ZScript aren't anywhere near great. Any help would be greatly appreciated. |
|
You have do set MaxAmount inside your code. (MaxAmount = GetCVar("blahblah")) You cannot set a static property to an address, it's physically impossible. | |
You're a hero, Graf. It works flawlessly. Thank you for the help! | |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-03-07 09:52 | Lud | New Issue | |
2017-03-07 11:35 | Graf Zahl | Note Added: 0000902 | |
2017-03-07 11:35 | Graf Zahl | Status | new => closed |
2017-03-07 11:35 | Graf Zahl | Resolution | open => no change required |
2017-03-07 17:29 | Lud | Note Added: 0000906 | |
2017-03-08 03:19 | Graf Zahl | Note Added: 0000910 | |
2017-03-08 05:50 | Lud | Note Added: 0000913 |