[Added] Inventory UNCLEARABLE flag

Moderator: GZDoom Developers

Inventory UNCLEARABLE flag

Postby Major Cooke » Fri Feb 01, 2019 10:41 am

Graf has merged this PR so this can be closed.

Pull Request
I'd like to allow items to remain droppable at any time, yet immune to ClearInventory.
Last edited by Major Cooke on Fri Feb 01, 2019 12:31 pm, edited 2 times in total.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Inventory UNCLEARABLE flag

Postby Rachael » Fri Feb 01, 2019 10:50 am

In the wake of what seems to be yet another trend of creating yet another massive pile of very light-weight convenience features - why do you need this?

I'll be honest - the reason why I don't like this is because ClearInventry() in my opinion should do exactly what it implies - the need for exceptions for every little thing in the game engine is senseless to me - which often evolves into exceptions to exceptions - and the DamageMobj refactor should stand as a perfect testament to that.

Piling on exception to the exception after exception to the exception after 50 dozen more exceptions is exactly what gets the engine into such an unwieldy state in the long run.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: Inventory UNCLEARABLE flag

Postby phantombeta » Fri Feb 01, 2019 11:00 am

In this case, there's a real use case for the feature: depending on what you're doing with your mod (an RPG mod, for example), ClearInventory can actually completely break the mod - I imagine this would be for situations like that.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland
Discord: phantombeta#2461
Twitch ID: phantombeta_

Re: Inventory UNCLEARABLE flag

Postby Major Cooke » Fri Feb 01, 2019 11:16 am

Adding onto what Phantom said, I would have to create hacky workarounds that make it even MORE unwieldy than introducing an Unclearable flag, JUST so I can clear the Undroppable flag and then drop an item.

An upcoming mod of mine is reliant upon ensuring inter-mod compatibility will work properly, since you can have multiple players at once.
Last edited by Major Cooke on Fri Feb 01, 2019 11:47 am, edited 2 times in total.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Inventory UNCLEARABLE flag

Postby Apeirogon » Fri Feb 01, 2019 11:26 am

But clear inventory is virtual, so you can override it with you own function.
https://github.com/coelckers/gzdoom/blo ... y.txt#L314
Or you talking about acs clear inventory function?

Also, yes, "exception to the exception for the exception" is not good. Since at some moment function would contain only exception for the exceptions, with handling for the exceptions which doesnt except exceptions from the previous exceptions list.
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Inventory UNCLEARABLE flag

Postby Major Cooke » Fri Feb 01, 2019 11:29 am

The scope of that function is too narrow.

ClearInventory would need to be applied to other actors when they might not even exist in the mod, or some actors that are incapable of inheriting from another.

Furthermore, stacking on check after check for actor classes/names costs more than an extra check for a flag.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Inventory UNCLEARABLE flag

Postby Graf Zahl » Fri Feb 01, 2019 12:30 pm

While I understand Rachael's reservations for cluttering up the code, this is simple enough to not become an obstacle like the infamous pain flags.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest