Cuberite Forum
mmo plugin help wanted - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: mmo plugin help wanted (/thread-2401.html)

Pages: 1 2


mmo plugin help wanted - danny9484 - 03-09-2016

Hey there,
I created a plugin called mmo


https://github.com/danny9484/mmo

basically you can raise levels, set skillpoints and get stronger ...
it also has magic and you can cast spells thats were I would like to have some help because im lazy xD

I just need some people who could come up with some spells like blasting a fireball or something and create a spell that could be inserted in my plugin
magic drain ... is already handled by the plugin I only need the action
it could be everything that comes to your mind
I can later add it to my github project.

I invented some kind of a spell system for that
take a look at the existing spells heal and revive for reference


would be funny to work together with some people Smile


RE: mmo plugin help wanted - NiLSPACE - 03-09-2016

I see you've pretty much copied over all my old SQL code from Login. I advice using my new SQL code instead. The old one is pretty much a huge wrapper that only allows some basic functionality.


RE: mmo plugin help wanted - danny9484 - 03-09-2016

were can I get the new code? I hope it's ok that I'm using it. I was very confused with the sql commands in lua but your functions helped.


RE: mmo plugin help wanted - NiLSPACE - 03-10-2016

Of course you may use it, but I'm not sure if it's really SQL injection free. That's why I advice against it.

My new code can be found here
The queries are stored in a name called "Queries" here
These are loaded here. Then you can execute them with this piece of code. Then you can call the query with parameters like this. Parameters inside queries are noted with a dollar sign ($) in front of it.

You can modify it so queries don't have to be stored in separate files. I did that with WorldEdit.


RE: mmo plugin help wanted - NiLSPACE - 03-10-2016

Btw, I made a similar plugin about 1.5 years ago: https://github.com/NiLSPACE/Magic You might want to check it out Smile The spells were mostly based of an anime called Fairy Tail. I have a video of the Ice-make spell's on youtube: https://www.youtube.com/watch?v=sUpxCN5cRvk The code is really ugly though. Please notify me if it doesn't work or if you don't understand what something does.


RE: mmo plugin help wanted - danny9484 - 03-10-2016

ok I have a question to you new sql function. Why do I have to create a temptable at the Initialize.sql? If I don't I get this error

Code:
[09:40:30] LUA: Plugins/mmo/storage_sqlite.lua:76: calling 'step' on bad self (attempt to use closed sqlite virtual machine)
[09:40:30] Stack trace:
[09:40:30]   [C](-1): step
[09:40:30]   Plugins/mmo/storage_sqlite.lua(76): ExecuteCommand
[09:40:30]   Plugins/mmo/storage_sqlite.lua(41): new
[09:40:30]   Plugins/mmo/main.lua(644): create_database
[09:40:30]   Plugins/mmo/main.lua(27): (no name)
[09:40:30] Stack trace end
[09:40:30] Error in plugin mmo calling function Initialize()
[09:40:30] Error in plugin mmo: Cannot call the Initialize() function. Plugin is temporarily disabled.



RE: mmo plugin help wanted - NiLSPACE - 03-10-2016

That was because I made a mistake while designing the table at first. I had to alter it, but sqlite didn't support an easy way to do that. You can leave it out.


RE: mmo plugin help wanted - danny9484 - 03-10-2016

This surely is something very obvious but I just don't get it

Code:
[10:59:23] LUA: Plugins/mmo/storage_sqlite.lua:59: attempt to index field 'DB' (a nil value)
[10:59:23] Stack trace:
[10:59:23]   Plugins/mmo/storage_sqlite.lua(59): ExecuteCommand
[10:59:23]   Plugins/mmo/main.lua(379): get_stats_initialize
[10:59:23]   Plugins/mmo/main.lua(399): get_stats
[10:59:23]   Plugins/mmo/main.lua(113): save_player
[10:59:23]   Plugins/mmo/main.lua(81): (no name)
[10:59:23] Stack trace end
[10:59:23] Error in plugin mmo calling function <callback>()


Code:
function get_stats_initialize(Player)
    local Success, ErrorMsg = cSQLiteStorage:ExecuteCommand("initialize_player",
    {
        player_name = Player:GetName()
    },
    function(stats_sql)
        stats[1][Player:GetName()] = stats_sql
    end
)
    return stats
end



RE: mmo plugin help wanted - NiLSPACE - 03-10-2016

No, use this:
cSQLiteStorage:Get():ExecuteCommand("initialize_player", ....)



RE: mmo plugin help wanted - danny9484 - 03-10-2016

Code:
[11:32:14] LUA: Plugins/mmo/main.lua:379: attempt to call method 'Get' (a nil value)
[11:32:14] Stack trace:
[11:32:14]   Plugins/mmo/main.lua(379): get_stats_initialize
[11:32:14]   Plugins/mmo/main.lua(399): get_stats
[11:32:14]   Plugins/mmo/main.lua(113): save_player
[11:32:14]   Plugins/mmo/main.lua(81): (no name)
[11:32:14] Stack trace end
[11:32:14] Error in plugin mmo calling function <callback>()

nope didn't worked
if u want checkout my dev branch I have uploaded my current code