Page 1 of 4

[Mod] Specialties [3.5] [specialties]

PostPosted: Tue Oct 09, 2012 22:53
by ashenk69
Specialties adds just what the name implies, specialties. When you complete a task like mining stone with a pickaxe you gain a point of XP towards mining. You can then spend those points towards healing your pick or upgrading it to a better one. I don't want to make this like enchanting weapons because it is stupid boring and already done so I am trying to add things that are useful to playing the game.

Compatible with Inventory_Plus

Chat Command:
  • /spec - Opens menu shown in picture below. This is where you will purchase skills and can view your current XP.

Current Specialties:
  • Miner - XP gain from mining with a pickaxe
  • Lumberjack - XP gain from chopping with an axe
  • Digger - XP gain from digging with a shovel
  • Farmer - XP gain from harvesting farming crops
  • Builder - XP gain from placing blocks

Current Skills:
  • Heal[ALL TOOLS] - Repairs tool for a certain amount.
  • Upgrade[ALL TOOLS] - Upgrades tool to one higher metal tier.
  • Superheat[AXE, PICKAXE, SHOVEL] - When a node is dug it returns the cooking result instead of the normal drop. If there is not a cooking result than the normal drop will occur.
  • Greenthumb[HOE] - Now a crop can be dug with a hoe and it'll only remove it if it is at the highest tier.
  • Feller[AXE](new) - Similar to Techic's chainsaw, when the bottom tree node is dug it removes all the nodes in the trunk.

Condenser:
  • Designed like the Equivalent Exchange energy condenser. This converts one type of node or item into another. Currently the condenser is flawless meaning there is no energy loss but I will add in a small random loss every time a conversion occurs so it doesn't feel too OP. Also, not all items and nodes work in the system. Don't worry that won't crash your game. I'm working on the conversion amounts for each node and item.
  • Recipe(picture coming soon)
    O = Obsidian
    m = Mese Crystal
    D = Diamond Block
    |O|O|O|
    |m|D|m|
    |O|O|O|

License: WTFPL

Download: https://github.com/metalstache/specialties/archive/master.zip
GitHub: https://github.com/metalstache/specialties

*Warning* If you aren't able to add an ability(ie superheat) to a tool, it is most likely because the tool is not registered with the system. Exit the game, open the "depends.txt" file in the specialties folder and add the mods name of the tool you were trying to add the ability to. Retry it and if it still doesn't work than bring it up so I can look into it.

*Warning* If Superheat does not drop the cooking result for a node, then reload the world. This should fix the issue.

Screenshot illustrating the new super heat effect
Image

[3.0]
Added Farmer specialty
Fixed specialty tools not upgrading
Moved code into multiple files
Added that mods can now register their tools in the tables by calling specialties.healingamount(toolname) and specialties.upgradetree(toolname higher than current)
[3.1]
Fixed issue with drop handler for null digger
[3.2]
Removed dependence to Inventory Plus
Added chat command /spec to open menu
Fixed Technic compatibility issue
Fixed item entities having flame texture on them
Superheat and Green Thumb textures are now 16x16
Updated farming code to current default style
[3.3]
Fixed typo with Technic compatibility
Cleaned up file management
Added feller skill
Added item pickup option
Fixed item drop to work properly
[3.4]
Added XP display in Bottom Left of HUD
[3.5]
Miscellaneous code fixes and cleanup
Added condenser node

Future Updates:
Add more skills to each specialty
Add EE like skills to builder (in progress)

PostPosted: Wed Oct 10, 2012 00:01
by cornernote
Hey ashenk69,

Nice mod! Welcome back.

PostPosted: Wed Oct 10, 2012 02:29
by SegFault22
+5
Great idea/work!

PostPosted: Wed Oct 10, 2012 06:45
by Mito551
10:38:54: VERBOSE[main]: error_message = ServerError: LuaError: error: ...win32\bin\..\games\dwarves\mods\specialties\init.lua:84: attempt to index local 'file' (a nil value)
10:38:54: VERBOSE[main]: stack traceback:

please help?

PostPosted: Wed Oct 10, 2012 11:13
by ashenk69
I am not sure why it would be having an error problem. The line that it says that it is having an issue with doesn't even have the variable file on it. It is in a totally different function. What other mods do you have installed? Sometimes they can communicate strangely.

PostPosted: Wed Oct 10, 2012 11:21
by Mito551
well...
3dforniture
ambience
mobf(animals)
armor
bags
biggerchests
bones
builtin_item
carts
conifires
clean
creative
creative_inventory
deathsound
defaultgrow
drippingwater
drowning
dwarves
farming (steel, iron, wood, stone hoes)
fire (revised by PilzAdam, if i'm not mistaken)
flowers
food
gates
growing
growing_trees
growing_cactus
gunmod
hatches
home_gui
inventory_plus
item_drop
lava_and_water
locked_furnace
locked_sign
mesecons (crafted with copper ingot from moreores)
money
moreores
nuke
papyrus_bed
particles
pipeworks
plantaging
potions
raft (quite convinient way of travel, if you get sick riding carts ;) )
snow
stairs
stairsplus
suffocating
throwing
tree_plus (realtest pack)
villages
walking_light
workbench
worldedit (+gui)
worldtime
xbar
xdoor2
xladders
xfences
xpanes
...full list it is. but i tried running it on vanilla, just inv_plus and this mod and still gave me the same error. i myself don't understand why it doesn't work.

PostPosted: Wed Oct 10, 2012 11:21
by ashenk69
Actually after I think about it if it is having an issue of accessing the files it is because it only adds the files if a new player joins the game. Are you trying this on a new map or one that you've already played on?

PostPosted: Wed Oct 10, 2012 11:26
by Mito551
this error was on old map. it's okay on a new map. just see if you can fix the old map issue then. thank you for your help and this awesomest mod! i'm including it in dwarves with support of my tools

PostPosted: Wed Oct 10, 2012 11:33
by ashenk69
I'll adjust the system to check if the file is created so if you install it on an old map it still works. Thanks for adding it to your Dwarves game. If you are having issues with a spike in frame drops every once in a while, I have an autosave feature where every 10 seconds it commits your xp to the files. Changing it is pretty easy, if you have issues with it.

PostPosted: Wed Oct 10, 2012 11:46
by ashenk69
Well that was a pretty easy fix so you can either download the new fix in a couple of minutes or you can add in the new code. I tested it by removing specialties, then I created a new world and entered it, and then added specialties back and it worked just fine.

Starts at line 74
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local function readXP(player, specialty)
    local file = io.open(minetest.get_worldpath().."/"..player.."_"..specialty, "r")
    if file == nil then
        writeXP(player, specialty, 0)
        return 0
    end
    local xp = file:read("*number")
    file:close()
    return xp
end

PostPosted: Thu Oct 25, 2012 12:58
by sky
this mod is like Minecraft enchanting but it is without table and it is Minetest style

PostPosted: Thu Oct 25, 2012 16:01
by Iqualfragile
nice idea!
add things like double-drop or faster mining
and add a glowing mese-pickaxe as an ultimate upgrade wich you can only get for xp (take the code from walking light or torch or however it was called)

PostPosted: Thu Oct 25, 2012 18:28
by ashenk69
It is actually more complicated than you would think to change the properties table of a tool dynamically. Double drop is actually easy to do so I'll think about adding that one.

I have actually been working on another mod that would add moving lights, ore finder, and a home protector all in one mod. I call him spot but he hasn't been released yet.

PostPosted: Thu Oct 25, 2012 18:58
by Iqualfragile
I know its complicated, i know how tools work in minetest :D
thanks for the double-drops.
that was just an idea, im shure there is a lot more you could do to -ench- "specialize" your tools.

please dont! split it up in seperate ones, its a lot better:
  • admins can add it in portions

  • people can fork your repos more easily.

  • if one thing breaks it does not break the whole mod

PostPosted: Thu Oct 25, 2012 20:38
by ashenk69
I guess I could release them in separate files but in a single pack that way admins can manage their servers easier and others can modify it in chunks if necessary. Either way the spot mod wouldn't be using all the features at one time because he is only going to be doing one task at a time. It is literally an entity that follows you around to assist you in mining by finding a specific ore or creating a natural light or protecting your home if you set him to stay home.

PostPosted: Thu Oct 25, 2012 20:51
by Iqualfragile
ah, im sorry, i missunderstood you, i thougth it would add those functionalities as i.e. an command not as an "pet"
then its allright with me to put it into one mod of cause

PostPosted: Sat Oct 27, 2012 14:14
by FireStrykeR
When I try to repair my mese pickaxe, my client (server) freezes up.

PostPosted: Sun Oct 28, 2012 18:54
by ashenk69
FireStrykeR wrote:When I try to repair my mese pickaxe, my client (server) freezes up.


I just updated the mod to fix that issue. I missed it when I was testing it initially for some reason. I also added moreores mod support for its tools. There are probably a few imbalances when it comes to healing and upgrading and I'll work on that later since right now is just developing the base of the mod.

PostPosted: Sun Oct 28, 2012 19:28
by Mito551
i dl the version it was before. link is not updated.

PostPosted: Sun Oct 28, 2012 19:56
by ashenk69
Mito551 wrote:i dl the version it was before. link is not updated.


The download link is linked to the same file location so all I do is update the file. That way I don't have to change the download link every time.

PostPosted: Sun Oct 28, 2012 19:57
by Mito551
yes, i thought that was your idea. but codes are identical. 1.1=2.0. and you said you changed it.

PostPosted: Sun Oct 28, 2012 20:04
by ashenk69
I thought I had rezipped my folder but it was really three weeks old so I forgot to update it. Sorry about that it should be fixed now.

PostPosted: Sun Oct 28, 2012 20:06
by Mito551
thanks!

PostPosted: Tue Nov 06, 2012 21:43
by tinoesroho
Great mod. Are you planning on adding Farming Compatibility?

PostPosted: Tue Nov 06, 2012 21:55
by ashenk69
I could work on adding farming into the system. I have some ideas for skills and i think there should be a way for me to register whether a farming node has been dug.

PostPosted: Tue Dec 04, 2012 20:45
by ashenk69
I can't upload the new build of Specialties right now but I added the ability to super heat your tools now. What this does is whenever you mine something with a super heated tool it returns the result of cooking it. For example, cobblestone turns to stone. Also, when stone is dug it returns stone because the normal output is cobble which when cooked yields stone. The only issue with the system is it creates a separate tool for each addition(ie "superheat") you add to a tool so adding multiple additions could cause an exponential amount of tools being added to the game which would make it really cumbersome. A way around this is to allow only one addition to be applied to a single tool this way additions also don't conflict with one already applied.

I plan to add a trash and refill system to the builder skill which will work a lot like EE in minecraft. It is just going to take a while to calculate the values for everything but it isn't that hard.

I haven't worked on farming yet but it shouldn't be too hard to implement. The only thing is skills that could be useful to the farming aspect.

I know some people have been discussing that there should be an XP for swords. I am not going to implement this until there is really a standard mob system in the game to work with.

PostPosted: Tue Dec 04, 2012 21:00
by Doc
I like this mod idea. Keep working on it!

PostPosted: Wed Dec 05, 2012 02:26
by ashenk69
Updated the first post with new info and updated the file so try it out and have fun with it.

Currently the tools that are registered through this mod are shown in the creative inventory. I am not sure if I should leave them or remove them from the creative side. The reason to remove them is that the number of registered tools is equal to (number of tools currently)*(number of specialties and additions). That many can make it cluttered in the inventory. Keeping them would mean if someone was to make an adventure map they could place such tools onto the map through the inventory and not just the /giveme.

PostPosted: Sat Dec 08, 2012 15:27
by ashenk69
Update

Just added farming to specialties. This adds a new ability to which affects the usefulness of hoes. A hoe with "Greenthumb" on it now allows the player to not only till soil but also harvest crops without breaking them. For example, a fully grown wheat plant when harvested by a hoe with greenthumb will drop the normal drops and then be turned into the lowest form of itself to regrow again. It also doesn't break crops until they are fully grown.

*Problem*The code to figure out which node the hoe is targeting is a little off because the on_use function only gives you pointed_thing and that only contains under and above which aren't the true under and below either. What I mean is sometimes you will have to circle the crop until you find the right direction to do it from.

I have added a gui for builder but have not implemented it yet. I am still working on the code to transfer things from items to xp and vice versa.

PostPosted: Sun Dec 09, 2012 09:08
by Mito551
13:07:43: ERROR[main]: ========== ERROR FROM LUA ===========
13:07:43: ERROR[main]: Failed to load and run script from
13:07:43: ERROR[main]: E:\Dropbox\minetest-0.4.4-win32\bin\..\games\dwarves\mods\specialties\init.lua:
13:07:43: ERROR[main]: .....\games\dwarves\mods\specialties/externalmodify.lua:9: attempt to concatenate local 'technic' (a nil value)
13:07:43: ERROR[main]: stack traceback:
13:07:43: ERROR[main]: .....\games\dwarves\mods\specialties/externalmodify.lua:9: in main chunk
13:07:43: ERROR[main]: [C]: in function 'dofile'
13:07:43: ERROR[main]: ...win32\bin\..\games\dwarves\mods\specialties\init.lua:5: in main chunk
13:07:43: ERROR[main]: =======END OF ERROR FROM LUA ========