Skip to content

Commit

Permalink
Merge pull request #34 from Panquesito7/use_mod_conf
Browse files Browse the repository at this point in the history
Create "mod.conf", improve "README.md", delete deprecated functions...
  • Loading branch information
thomasrudin committed Sep 1, 2019
2 parents 6e2c1f0 + dad4d37 commit 6c05cb9
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 38 deletions.
65 changes: 37 additions & 28 deletions readme.md → README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Minetest XP mod (xp_redo)
======
## Minetest XP mod (xp_redo)

Minetest mod for player experience management (xp)
It adds an xp counter per player and ranks according to your xp level.
Expand All @@ -10,42 +9,54 @@ There is also a xpgate block which, when placed under a wooden door will only al
* Forum-Topic: [https://forum.minetest.net/viewtopic.php?f=9&t=20124](https://forum.minetest.net/viewtopic.php?f=9&t=20124)
* With some ideas from: [https://forum.minetest.net/viewtopic.php?id=3291](https://forum.minetest.net/viewtopic.php?id=3291)

# Install
## Installation

* Unzip/Clone it to your worldmods folder
- Unzip the archive, rename the folder to xp_redo and
place it in ..minetest/mods/

# Privileges
- GNU/Linux: If you use a system-wide installation place
it in ~/.minetest/mods/.

* **givexp**: Manage xp of your users
- If you only want this to be used in a single world, place
the folder in ..worldmods/ in your world directory.

# Commands
For further information or help, see:
https://wiki.minetest.net/Installing_Mods

Add or remove (amount with negative sign) xp from a user:
## Privileges

* **givexp**: Manage XP of your users.

## Commands

Add or remove (amount with negative sign) XP from a user:
```
/givexp (username) (amount)
```

Example:

Give player somedude 200 xp points:
Give player somedude 200 XP points:
```
/givexp somedude 200
```

Remove 100 xp points from player somedude:
Remove 100 XP points from player somedude:
```
/givexp somedude -100
```

# Depends
## Dependencies

- default
### Optional dependencies

* default
* doors?
* mobs_redo?
* mobs_animal?
* mobs_monster?
- doors
- mobs_redo
- mobs_animal
- mobs_monster

# Builtin xp events
## Builtin XP events

## Digging

Expand All @@ -55,7 +66,7 @@ Every node dig gives you 1 xp point

Every mob punch gives you the amount of damage on the mob in xp

# Screenshots
## Screenshots

## Hud in action
![](screenshots/Minetest_2018-05-17-09-17-16.png?raw=true)
Expand All @@ -66,16 +77,15 @@ Note: **Android screenshot, ignore wrong spacing**

## XP Gate block (blocking)
![](screenshots/Minetest_2018-05-17-09-25-53.png?raw=true)
Note: **It will teleport you through if you have enough xp and try to open it**
Note: **It will teleport you through if you have enough xp and try to open it**.

## Player nametags (with rank-colors)
![](screenshots/Minetest_2018-05-17-09-35-30.png?raw=true)
![](screenshots/Minetest_2018-05-17-09-36-11.png?raw=true)

## Ranks

# Ranks

Some initial ranks are hardcoded in **ranks.lua**
Some initial ranks are hardcoded in **ranks.lua**.
(Swiss military ranks, but translated to english.... sorry :)

* Recruit (xp: 0) ![](textures/xp_rank_1_recruit.png?raw=true)
Expand All @@ -85,7 +95,7 @@ Some initial ranks are hardcoded in **ranks.lua**
* Corporal (xp: 10000) ![](textures/xp_rank_5_corporal.png?raw=true)
* Seargant (xp: 100000) ![](textures/xp_rank_6_seargant.png?raw=true)

# Lua api
## Lua api

## Ranks

Expand All @@ -101,7 +111,7 @@ rankDef = {
```


ranks are held in **xp_redo.ranks** as a table
ranks are held in **xp_redo.ranks** as a table.

### xp_redo.get_rank(xpAmount)

Expand All @@ -111,11 +121,11 @@ Returns the rankDef for given xp amount

### xp_redo.get_xp(playername)

Returns the xp level for given playername (always a number)
Returns the xp level for given playername (always a number).

### xp_redo.add_xp(playername, xp)

Adds the amount of xp to given playername (can be negative for xp removal)
Adds the amount of xp to given playername (can be negative for xp removal).

# License

Expand All @@ -125,7 +135,7 @@ See LICENSE.txt

# Pull requests / bugs

I'm happy for any bug reports or pull requests (code and textures)
I'm happy for any bug reports or pull requests (code and textures).

# TODO / Ideas

Expand All @@ -134,4 +144,3 @@ I'm happy for any bug reports or pull requests (code and textures)
* Door-teleport alternative
* XP Regions
* XP entities/items

7 changes: 0 additions & 7 deletions depends.txt

This file was deleted.

4 changes: 1 addition & 3 deletions entities.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


local get_entity_name = function(rank)
return minetest.get_current_modname() .. ":xp" .. rank.xp
end
Expand Down Expand Up @@ -59,7 +57,7 @@ xp_redo.update_rank_entity = function(player, rank)

-- TODO: check new rank
if not data then
local pos = player:getpos()
local pos = player:get_pos()

local entity = minetest.add_entity(pos, rank.entityname)

Expand Down
3 changes: 3 additions & 0 deletions mod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name = xp_redo
depends = default
optional_depends = protector, doors, mobs_redo, mobs_animal, mobs_monster, mesecons_mvps

0 comments on commit 6c05cb9

Please sign in to comment.