Page 1 of 1

[Mod] Factions (sapier's) [0.1.5] [factions]

Posted: Thu May 09, 2013 19:10
by sapier
Description:
This mod provides a api to handle factions as well as reputation of players in different factions.
It supports temporary faction members to allow mobs joining a faction.
This mod is inspired by old faction mod sadly providing a chat interface only. If you currently used old faction mod you can use this one with very few changes.

Notes:
-Factions are world specific.
-data storage is not compatible with old faction mod (sorry)
-formspec gui is missing

License: WTFPL
Dependencies: -

Download:
Version 0.1.5

API Documentation:
Doxygen Doc

Chatcommand Documentation:
User commands:
/factions -> info on your current factions
/factions info <factionname> -> show description of faction
/factions list -> show list of factions
/factions leave <factionname> -> leave specified faction
/factions join <factionname> -> join specified faction

Admin commands:
/factions create <factionname> -> create a new faction
/factions delete <factionname> -> delete a faction
/factions leave <factionname> <playername> -> remove player from faction
/factions invite <factionname> <playername> -> invite player to faction
/factions set_free <factionname> <true/false> -> set faction free to join
/factions admin <factionname> <playername> <true/false> -> make player admin of faction
/factions description <factionname> <text> -> set description for faction

Changelog:

0.1.5
-add default group players

0.1.4
-fix various issues becoming obvious on integration to mobf

0.1.3
-fix crash on adding first member

0.1.2
-fix crash on specifying invalid faction to chathandler

0.1.1
-fixed bug in chathandlers
-fixed invalid help text

0.1.0
-Initial version

Posted: Thu May 09, 2013 21:57
by kaeza
Cool!
Can you add a command to set a per-faction spawn point (like for example, a base)?

EDIT:
Tried to execute:

Code: Select all

/factions create
(note: no faction name given, this was intentional)
This came up:

Code: Select all

03:01:32: ERROR[main]: ServerError: LuaError: error: .../bin/../games/testing/mods/factions/chatcommands.lua:385: attempt to call global 'get_player_by_name' (a nil value)

Posted: Fri May 10, 2013 08:05
by sapier
are you sure you didn't do a /f actions create? this bug is in "/f" command handler ...
does minetest subsequently call all matching chat handlers?

e.g. if following ones are registred

/1234
/123
/12
/1

Posted: Fri May 10, 2013 08:07
by kaeza
sapier wrote:are you sure you didn't do a /f actions create? this bug is in "/f" command handler ...
does minetest subsequently call all matching chat handlers?

e.g. if following ones are registred

/1234
/123
/12
/1
Scratch that... it seems to work now O.o

Posted: Fri May 10, 2013 08:15
by sapier
You most likely downloaded fixed version just this moment, there was a bug in those handlers. Still if minetest calles all handlers I need to recheck some error cases.

Posted: Fri May 10, 2013 08:20
by sapier
spawnpoint is a little bit difficult to add as you can be member in multiple factions. Which spawnpoint should be the one taking effect?

Posted: Fri May 10, 2013 08:45
by kaeza
sapier wrote:spawnpoint is a little bit difficult to add as you can be member in multiple factions. Which spawnpoint should be the one taking effect?
hmm... good point...

Posted: Fri May 10, 2013 15:43
by Jordach
The first spawnpoint registered. Or give the user a choice for default.

Posted: Fri May 10, 2013 17:11
by Traxie21
Could you add faction land claiming/selling?

Posted: Fri May 10, 2013 23:54
by sapier
if someone provides claiming/selling I gladly merge it but for the moment I don't plan to add new features on my own.

EDIT1:
this mod is just bywork for mobf ... and I haven't even done the mobf part by now ;-)

Posted: Mon May 13, 2013 23:08
by keyxmakerx
What do you add for the <value> part of the command?

Posted: Mon May 13, 2013 23:30
by sapier
value is true or false I updated main post

Posted: Tue May 14, 2013 03:07
by jojoa1997
I am debating whether to add this to MiniTest since it is a single mod unlike the other one. Would this be a good one guys? I haven't played any on multiplayer so I couldn't test it.

Posted: Tue May 14, 2013 05:33
by keyxmakerx
I had one more issue, it kept crashing meh server and I could not figure out what was causing it. It just said nil value.

Posted: Tue May 14, 2013 11:10
by jojoa1997
Post the error here

Posted: Wed May 15, 2013 22:55
by keyxmakerx
jojoa1997 wrote:Post the error here
17:51:31: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error: ...t/games/minetest_game/mods/factions/chatcommands.lua:417: attempt to concatenate global 'faction' (a nil value)
17:51:31: ERROR[main]: stack traceback:

In thread 7f81b43ac740:
/build/buildd/minetestc55-201305101947/src/main.cpp:2088: int main(int, char**): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD 7f81b43ac740:
#0 int main(int, char**)
(Leftover data: #1 Dedicated server branch)
(Leftover data: #2 virtual void ServerMap::save(ModifiedState))
(Leftover data: #3 virtual void ServerMap::saveBlock(MapBlock*))

This was a test to see it /factions sethome worked... it did not to say the least.

This is one. The other problem i think is when someone without faction privs tries to use the mod. I am not sure how to give everyone factions priv to start with.

Posted: Thu May 16, 2013 17:45
by sapier
@keyxmakerx thanks for your bugreport plz test 0.1.2 containing fix for your problem

Edit1:
initial privs have to be given by server admin, there are 2 privs for factions:

factions_admin:
Can do everything with any faction including creating a faction.

factions_user:
players allowed to use factions in general.


Further there can be faction admins, those can invite/remove any player having factions_user right to the faction they are admin for, as well as give other users admin right for their faction too.

Posted: Sun Sep 01, 2013 12:16
by sapier
Updated factions mod for usage with mobf

Posted: Mon Sep 02, 2013 01:26
by BrunoMine
is possible to place a limit of members in each faction?
If the leader of the faction does not want a player between he can banish?

Posted: Sat Nov 09, 2013 23:01
by sapier
there's no limit but as you have to invite ppl to a faction you're free to stop inviting others ;-)

and yes a admin can "leave" any player ;-)

Posted: Sun Nov 10, 2013 12:37
by twoelk
sapier said:
this mod is just bywork for mobf ... and I haven't even done the mobf part by now ;-)
does this mean you want to add some sort of group behavior to mobf? Like herds fleeing if one is attacked or packs attacking if one member is hurt?
- or does mobf allready have something like that?

Posted: Wed Jan 01, 2014 02:17
by LuxAtheris
A little suggestion:
Hud please? or even better when your in a guild,your guild name will be above your name.

Posted: Fri Jan 17, 2014 02:43
by Iqualfragile
/r/ing faction-private chat, best would be 2 commands, one to send one message to the faction, one to change chatmode to faction-private