View Single Post
nosoop
Veteran Member
Join Date: Aug 2014
Old 07-01-2018 , 12:47   Re: (fake) Classes/Objects in SourcePawn
Reply With Quote #5

Quote:
Originally Posted by hmmmmm View Post
CustomKeyValues

[...] The main aim was to get data from maps/mappers that they can implement as KeyValues from hammer, but you can also set keys/values from the plugin side.
Oh right, that's a thing! Didn't think about being able to dispatch keys through plugins myself.

It doesn't seem like any of the nested StringMaps in your plugin get disposed until the next OnLevelInit call, so if I dispatch keys to a lot of short-lived entities on a long map, it'd be a bit leaky.

I had a proof-of-concept for something similar (minus native KV dispatch) as the groundwork for a cleaner Custom Weapons-like plugin framework; never got around to finishing the API design though.

But anyways, to get back on the topic of fake objects: definitely think about whether your use-case needs completely custom object-oriented programming logic and storage; don't do OOP for the sake of it.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline