This will probably end up in mods sooner or later, but I would like to get some feedback.
I’m strongly considering jumping back in and redoing the item handling system. I think, right now, it’s rather messy, and getting it working properly for some things can be a bit of a chore.
So what I’d like to do is something along these lines:
Switch to an external text-file - a proper config file, basically
Switch to a tag-based handling system - so order doesn’t matter so much and we don’t need to worry about the stuff we aren’t using
Tieing the spawn conditions to the item itself - This is probably the bit I’ll need some help figuring out. It could be as simple as adding tags for spawngroups, and then its automatically placed wherever that spawngroup is placed. [SPAWN: Domestic:120][SPAWN: Appliance:200][Spawn: Carried:2] and the definitions for those groups are defined as they are now (The second number would be the frequency for that spawn type).
For an example, take this generic GUN
[ITEM:
[NAME: GlyphGryph Brand Gun] #Name field, mandatory
[UNIQID: GGGUN] #UNIQID field, optional, used for code hooks or references from other items
[IS: Gun] #Treated as a gun, which means others will see it as a deadly weapon
[IS: Metal] #Treated as a metal object, so doesn’t erupt into flame with the touch of a lighter
[ACTION: Fire:Shoot] #Add commands/actions to this gun. Some items can have more than one action type.
[SHOOTDAMAGE: 4:10]
[SHOOTTYPE: Semiauto: 9MM]
[SHOOTRECOIL: 5]
[AMMO: 9MM:21]
[VOLUME: 5]
[WEIGHT: 20]
[ACTION: Use:SwitchMode(2)] #When the item is used, it runs the code for the SwitchMode event with a specific target.
[MODE2: ACTION: Fire:Shoot] #If you don’t have a SwitchMode action, this won’t do much, but you don’t have to define it with use.
[MODE2: SHOOTDAMAGE: 8]
[MODE2: SHOOTTYPE: Launch: RPG]
[MODE2: SHOOTRECOIL: 10]
[AMMO: RPG:1] #Ammo can be used across modes and reloaded from any mode, so shouldn’t be mode-specific.
[MODE2: ACTION: Use:SwitchMode(1)] #Sends us back to mode 1 when used.
]
Note that in the actual implementation, there would probably be a [MODES: #] tag, and you’d only have to define one [ACTION: Use:SwitchMode], since it would automatically cycle through the modes (hypothetically). Tags are only overwritten for a specific mode IF you have an action of that type defined for that mode, meaning disabling a behaviour would be done with [MODE2: ACTION: use:NONE] or by making the original behaviour mode specific. You can also have multiple actions tied to a command, so [MODE2: ACTION: Fire:Shoot:SwitchMode(1)] would be possible, if you want it to switch automatically back to bullet mode after firing grenades.
What are the commands we can tie to items right now?
Eat
Drink
Fire
Use
???