[Mod] Player Classes [0.1.3] [classes]

User avatar
stu
Member
 
Posts: 906
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

[Mod] Player Classes [0.1.3] [classes]

by stu » Fri Mar 15, 2013 22:35

Playable Classes

Introducing some role-play into minetest. Playable character classes, currently include human, dwarf and elf.

To change class issue the chat command: /class human | dwarf | elf

To view your current class simply type /class

Changing class requires the 'class' privilege.

Default class can be set via minetest.conf, eg: classes_default_class = dwarf

Screenshot:
Image

Minetest version: 0.4.7

Depends: default

License Textures:
character_human.png - Sam II by Jordach (CC-BY-SA-NC)
character_dwarf.png, character_elf.png - Copyright (C) 2013 Stuart Jones (CC-BY-SA)

License Source Code: Copyright (C) 2013 Stuart Jones - WTFPL

Download: https://github.com/stujones11/minetest-classes/archive/master.zip

GitHub: https://github.com/stujones11/minetest-classes

Mod Release: Fri, 15 Mar 2013

Version: 0.1.1 Mon, 18 Mar 2013

Made some minor code improvements and updated dwarf models. Functionality should not be affected.

Version: 0.1.2 Thu, 11 Jul 2013

Classes now effect the player physics and base armor level.

Dwarf is the toughest but moves more slowly.
Elf is the quickest but is more susceptible to damage.
Human is currently unchanged.

Restructured the code to allow for easy customization with classes:register_class()
see init.lua for example usage.

Added default skins for the elf and dwarf models.
Note, these will be overridden if you use any skin changing mods.

Currently not compatible with the minetest-3d_armor modpack, however, support will be re-added as soon as possible.

Mod Updated: Sat, 13 Jul 2013
Version: 0.1.3

Updated models and textures.
Added human model & skin (Sam II by Jordach)

To Do

Maybe play with the scale of the models some more, opinions are welcome here.

Please let me know if you find any bugs.

Cheers!
Last edited by stu on Sat Jul 13, 2013 21:04, edited 1 time in total.
 

User avatar
BrandonReese
Member
 
Posts: 839
Joined: Wed Sep 12, 2012 00:44
Location: USA
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

by BrandonReese » Fri Mar 15, 2013 22:37

Obviously dwarves would be able to mine faster, or their mining tools last longer.
 

User avatar
stu
Member
 
Posts: 906
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Fri Mar 15, 2013 23:28

BrandonReese wrote:Obviously dwarves would be able to mine faster, or their mining tools last longer.

I like your way of thinking and It's a great idea. Not sure if that is easiliy doable though, I will give it some thought.

Cheers.
 

prestidigitator
Member
 
Posts: 640
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Fri Mar 15, 2013 23:40

I THINK you can set the max HPs of players on the fly using ObjectRef:set_properties just like you can update the visual (mesh, textures). I haven't tried it though. Maybe also makes_footstep_sound (for stealthy elves)?
 

User avatar
stu
Member
 
Posts: 906
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Fri Mar 15, 2013 23:51

prestidigitator wrote:I THINK you can set the max HPs of players on the fly using ObjectRef:set_properties just like you can update the visual (mesh, textures). I haven't tried it though. Maybe also makes_footstep_sound (for stealthy elves)?

Interesting, too late tonight but I will definitely be looking into that tomorrow. Love the footsteps idea also, if that can be done.

Thanks for the tip!
 

User avatar
Likwid H-Craft
Member
 
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Sat Mar 16, 2013 00:20

■IDEA■

Class Should spawn with some different weapons, and if you can make it work we can make TFTest
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Sat Mar 16, 2013 00:22

Likwid H-Craft wrote:■IDEA■

Class Should spawn with some different weapons, and if you can make it work we can make TFTest
that would be a seperate mod. i think something like this should be added to default.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
Chinchow
Member
 
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Sat Mar 16, 2013 02:05

Good work and thanks for using some of my skins in your mods.
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests
 

User avatar
Topywo
Member
 
Posts: 1720
Joined: Fri May 18, 2012 20:27

by Topywo » Sat Mar 16, 2013 13:18

This might be a interesting direction for minetest to go to.

For expansion:
Elves could have better/stronger/faster/further bows. Run faster, sneak further.
Dwarves could have more hearts, but no fast.
Humans could stay default, but maybe have strong longswords, ability to use horses (ostriches)

Other races: Orc's, undead, giants, babarians, mechanical race etc...

Just the standard Fantasy settings.

Edit: Typo
Last edited by Topywo on Sat Mar 16, 2013 13:19, edited 1 time in total.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Sat Mar 16, 2013 13:28

lol that is what i am doing with my npcs
Topywo wrote:This might be a interesting direction for minetest to go to.

For expansion:
Elves could have better/stronger/faster/further bows. Run faster, sneak further.
Dwarves could have more hearts, but no fast.
Humans could stay default, but maybe have strong longswords, ability to use horses (ostriches)

Other races: Orc's, undead, giants, babarians, mechanical race etc...

Just the standard Fantasy settings.

Edit: Typo
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

rarkenin
Member
 
Posts: 668
Joined: Tue Nov 20, 2012 20:48

by rarkenin » Sat Mar 16, 2013 13:50

jojoa1997 wrote:lol that is what i am doing with my npcs
Topywo wrote:This might be a interesting direction for minetest to go to.

For expansion:
Elves could have better/stronger/faster/further bows. Run faster, sneak further.
Dwarves could have more hearts, but no fast.
Humans could stay default, but maybe have strong longswords, ability to use horses (ostriches)

Other races: Orc's, undead, giants, babarians, mechanical race etc...

Just the standard Fantasy settings.

Edit: Typo


By overriding the regular crafting grid with your own, you can make it so each craft turns into a different object. For instance, if the class is dwarf, you get classes:pick_mese_dwarf, which has different properties then classes:pick_mese_elf. When changing classes, loop through the inventory to update these. Chests are a problem, though.
Admin pro tempore on 0gb.us:30000. Ask me if you have a problem, or just want help.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Sat Mar 16, 2013 14:11

dwarves and elves ca trade
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

prestidigitator
Member
 
Posts: 640
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Sat Mar 16, 2013 20:54

prestidigitator wrote:I THINK you can set the max HPs of players on the fly using ObjectRef:set_properties just like you can update the visual (mesh, textures). I haven't tried it though. Maybe also makes_footstep_sound (for stealthy elves)?

I was wrong about the HP thing. I just found a place in the C++ source code that where it is very obvious the number of max HP of a player is static. I believe you can change it for Lua (non-player) entities, but you definitely can't (at this point) for players.
 

User avatar
pandaro
Member
 
Posts: 307
Joined: Sun Jan 08, 2012 21:34
Location: behind
GitHub: pandaro

by pandaro » Sat Mar 16, 2013 22:28

First of all congratulations, I have not tried this mod but I think that is the right way.
I have already written about this topic:http://forum.minetest.net/viewtopic.php?id=2434&p=12
What that could differentiate the races:

-a different diet (dwarf like potatoes, but are allergic to apples);
-different mobile capabilities (max speed, acceleration, max jump height);
-physical characteristics (collision box, weight);
different-sized inventory (4x8, 5x9, 3x7);

These are just examples.
So we would have a system roguelike.
sorry for bad english
Linux debian 7 wheezy 64
kde
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Sun Mar 17, 2013 14:56

you know who already screams like a little girl seeing this mod? that' right, i do! added in my dwarves game ;)
 

User avatar
stu
Member
 
Posts: 906
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Sun Mar 17, 2013 19:51

Chinchow wrote:Good work and thanks for using some of my skins in your mods.

Love your skins Chinchow, thank you for making them available.

Topywo wrote:This might be a interesting direction for minetest to go to.

For expansion:
Elves could have better/stronger/faster/further bows. Run faster, sneak further.
Dwarves could have more hearts, but no fast.
Humans could stay default, but maybe have strong longswords, ability to use horses (ostriches)

Other races: Orc's, undead, giants, babarians, mechanical race etc...

Interesting ideas, I will try to incorporate as many as I can. Although we do need to be careful not to give one particular class an obvious unfair advantage over others.

More classes may well be added in future. I'm really leaving it up to the community to decide the direction of this mod.

rarkenin wrote:By overriding the regular crafting grid with your own, you can make it so each craft turns into a different object. For instance, if the class is dwarf, you get classes:pick_mese_dwarf, which has different properties then classes:pick_mese_elf. When changing classes, loop through the inventory to update these. Chests are a problem, though.


I was thinking along these same lines myself but then what about tools/weapons included by other mods?

prestidigitator wrote:I was wrong about the HP thing. I just found a place in the C++ source code that where it is very obvious the number of max HP of a player is static. I believe you can change it for Lua (non-player) entities, but you definitely can't (at this point) for players.


No problem, I kinda suspected this. Thanks for your help all the same.

pandaro wrote:First of all congratulations, I have not tried this mod but I think that is the right way.
I have already written about this topic:http://forum.minetest.net/viewtopic.php?id=2434&p=12
What that could differentiate the races:

-a different diet (dwarf like potatoes, but are allergic to apples);
-different mobile capabilities (max speed, acceleration, max jump height);
-physical characteristics (collision box, weight);
different-sized inventory (4x8, 5x9, 3x7);

These are just examples.
So we would have a system roguelike.


Once again, great ideas, not sure which are easily doable with the current lua api.

collision box is certainly possible, though I'm not sure what the effects would be.
different-sized inventory is an interesting one too.

Mito551 wrote:you know who already screams like a little girl seeing this mod? that' right, i do! added in my dwarves game ;)


Really glad you like it Mito, much of the inspiration to do this came from seeing your Dwarves game. I would especially like to hear your ideas to expand on this mod.

Thanks to everyone who has replied.

PS. There has been a minor update. I added registration of the 'class' privilege and removed some redundant code. It worked fine for me without the reg but I thought I best include it for completeness.

I also updated the 3d_armor dwarf model as I added the wrong one in the initial commit.
 

prestidigitator
Member
 
Posts: 640
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Mon Mar 18, 2013 00:15

How about this? It should be pretty easy to add things in the world (nodes and entities) that behave differently toward different races. For example:

  • Dwarven Furnace: Produces output faster, produces more output, and/or consumes less fuel when stoked by a dwarf.
  • Secret Door/Chest/Compartment: Every time you pass by or somehow interact with this item, it has a chance of revealing a secret in some way, and different races might have different chances of detecting the secret (e.g. twice as likely for elves). This could be a door that becomes visible when you get close, a clue that pops up to a player in chat or with a formspec, an extra secret compartment that appears when you open a chest, etc.
  • Racist NPCs: Certain mobs could react differently to different races. For example, trolls might really like to eat elves, having a higher probability of going after them, or always attacking them instead of other targets if both are in range. Or some shop keepers may refuse to sell to anyone who isn't human.

There are plenty of other possibilities, but the general concept is that it might be easier to develop custom things in the world that'll react to race rather than (or in addition to) trying to change the basic behavior of the player/game itself.
 

User avatar
rubenwardy
Moderator
 
Posts: 5544
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Mon Mar 18, 2013 13:10

I recommend you either add a mod_pack.txt file to the root folder, or move the init.lua file to the root file.

It allows for better mod editing with git. (you can test your mod with out moving the files to minetest/mods and then moving them back)
Last edited by rubenwardy on Mon Mar 18, 2013 13:11, edited 1 time in total.
 

User avatar
rubenwardy
Moderator
 
Posts: 5544
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Mon Mar 18, 2013 13:36

Likwid H-Craft wrote:■IDEA■

Class Should spawn with some different weapons, and if you can make it work we can make TFTest


My dwarves game has unique weapons. They might work as class difference, but they are really powerful and hard to get, so i dunno how good that is.
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Mon Mar 18, 2013 13:50

stu wrote:I also updated the 3d_armor dwarf model as I added the wrong one in the initial commit.


i haven't noticed the update in the topic...?

and where are the textures?
Last edited by Mito551 on Mon Mar 18, 2013 13:52, edited 1 time in total.
 

User avatar
stu
Member
 
Posts: 906
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Mon Mar 18, 2013 20:15

rubenwardy wrote:I recommend you either add a mod_pack.txt file to the root folder, or move the init.lua file to the root file.

It allows for better mod editing with git. (you can test your mod with out moving the files to minetest/mods and then moving them back)
Also, it might be better to use register_chatcommand on this function


I added modpack.txt though I have no idea why it is needed. I have seen this file in other mods before but never understood its purpose. Any idea where I can find documentation on this?

Mito551 wrote:i haven't noticed the update in the topic...?

My appologies, the topic has now been updated.
Mito551 wrote:and where are the textures?

There are no textures. The skins pictured in the screenshot are from Player Skins, default and Chinchow respectively, they were used solely to demonstrate compatibility with the skins mod.
Last edited by stu on Mon Mar 18, 2013 20:16, edited 1 time in total.
 

prestidigitator
Member
 
Posts: 640
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Mon Mar 18, 2013 20:28

stu wrote:I added modpack.txt though I have no idea why it is needed. I have seen this file in other mods before but never understood its purpose. Any idea where I can find documentation on this?

I think it might be in the main wiki under mods somewhere. But in any case it is really simple. The presence of the text file tells Minetest not to use the directory as a mod (look for init.lua), but to instead treat each of its subdirectories as a mod. There doesn't have to be anything IN the text file; it can be (and I think it is supposed to be) empty (except for optional comment lines beginning with # that have absolutely no effect on behavior).
Last edited by prestidigitator on Mon Mar 18, 2013 20:29, edited 1 time in total.
 

User avatar
stu
Member
 
Posts: 906
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

by stu » Mon Mar 18, 2013 20:46

prestidigitator wrote:
stu wrote:I added modpack.txt though I have no idea why it is needed. I have seen this file in other mods before but never understood its purpose. Any idea where I can find documentation on this?

I think it might be in the main wiki under mods somewhere. But in any case it is really simple. The presence of the text file tells Minetest not to use the directory as a mod (look for init.lua), but to instead treat each of its subdirectories as a mod. There doesn't have to be anything IN the text file; it can be (and I think it is supposed to be) empty (except for optional comment lines beginning with # that have absolutely no effect on behavior).

I managed to find the relevant info right near the top of lua_api.txt and what you are saying is perfectly correct of course. Thanks again.
Last edited by stu on Mon Mar 18, 2013 20:46, edited 1 time in total.
 

User avatar
pandaro
Member
 
Posts: 307
Joined: Sun Jan 08, 2012 21:34
Location: behind
GitHub: pandaro

by pandaro » Fri Apr 05, 2013 08:54

your mod is still in development? I wanted you to notice a API introduced.
set_physics_override(speed, jump, gravity).
sorry for bad english
Linux debian 7 wheezy 64
kde
 

Next

Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 5 guests