I think i have a neat idea for a fairly simple mod, and i think i can butcher most of it from existing plugins that i have found, but i need to add a persistent Boolean to each player that i can then interact with. I have decompiled Assembly-CSharp.dll as was suggested in another thread, but im still left fairly in the dark as to how to approach it.
I would need to create a new sql column for my variable would i not? or would it get built automatically through the engine and just a simple declaration with accessors be enough?
Since its just a boolean i could add people to a group maybe, i am not 100% on how to do that either and it seems a bit of a hacky approach. Any suggestions of where to go from here would be amazing.
Creating player persistent variables
Discussion in 'Rust Development' started by GGPedro, Feb 19, 2016.
-
Wulf Community Admin
You could store the player or their user ID along with the bool in a dictionary or hashset, or even a datafile with Oxide if you'd like. I don't think you'd really need MySQL unless you plan on using that data with something else externally as well. If you could explain a bit of what you are trying to do, then we may be able to provide more info.
-
I wanted to make a highlander mod, If you have seen the film highlander (with Sean Connery's superb Spanish accent) it should be easy to understand. Basically, in the film there are immortals who can only be killed by chopping of their head. And there is some prophecy about the last one getting super powers etc etc.
So i want the Boolean to represent whether you are an immortal or not, i imagine i will let people continue to play as normal people after they lose their immortal status but it could also operate like a permadeath server too. but that option doesnt close if i add an immortal permastate so i would still like to have one.
It would be nice to have access to it on a webpage, then i can make a community page around it and people can easily see who is left without having to make some crazy UI because i can do web much easier than Rust.
It seems like a nice simple mod to start with, and an interesting little meta game to add into Rust -
Wulf Community Admin
Yeah, you can handle that with one of the methods I suggested previously. The best way to make it persistent would be to store it to a datafile, and then load that datafile when the server is started. There wouldn't be any way to decapitate a player though that I am aware of.
-
haha no, but you can detect headshots and weapons though right? so death via headshot from a slashing melee weapon? I mean, i dont think i will stick too close to the film, but the general idea is there - lose your special status under abnormal death conditions.
You mentioned Sql would only be needed if i wanted to interact with it via another program, does a website to display peoples status not count for that?
My plan currently is to butcher the Kill Feed plugin until i can get it to read out an immortal state and then go from there, sound like a good way to go about it? Can you recommend any other plugins that might be good reading for what i am trying to do? -
Wulf Community Admin
Yeah, MySQL would be a good option for that. There aren't many plugins that utilize it, as most of the time it's overkill for internal use. You may try ZLevels Remaster, as it uses MySQL and such. -
Thanks, I am going to spend some time trying to understand these plugins and mess with them, i will probably be back. Lets hope my questions wont be too stupid.
Thanks again.
