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

Post Reply
sapier
Developer
Posts: 763
Joined: Tue Aug 16, 2011 18:17

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

by sapier » Post

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
Last edited by sapier on Sun Sep 01, 2013 12:15, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

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)
Last edited by kaeza on Fri May 10, 2013 06:04, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

sapier
Developer
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Post

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
DON'T mention coding style!
(c) sapier all rights reserved

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

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
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

sapier
Developer
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Post

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.
Last edited by sapier on Fri May 10, 2013 08:16, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved

sapier
Developer
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Post

spawnpoint is a little bit difficult to add as you can be member in multiple factions. Which spawnpoint should be the one taking effect?
DON'T mention coding style!
(c) sapier all rights reserved

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

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...
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

The first spawnpoint registered. Or give the user a choice for default.

User avatar
Traxie21
Member
Posts: 753
Joined: Mon Dec 31, 2012 10:48
Location: McKinney, Texas U.S.A.
Contact:

by Traxie21 » Post

Could you add faction land claiming/selling?

sapier
Developer
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Post

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 ;-)
Last edited by sapier on Fri May 10, 2013 23:54, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved

keyxmakerx
Member
Posts: 104
Joined: Mon Apr 08, 2013 23:53

by keyxmakerx » Post

What do you add for the <value> part of the command?

sapier
Developer
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Post

value is true or false I updated main post
DON'T mention coding style!
(c) sapier all rights reserved

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

by jojoa1997 » Post

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.
Coding;
1X coding
3X debugging
12X tweaking to be just right

keyxmakerx
Member
Posts: 104
Joined: Mon Apr 08, 2013 23:53

by keyxmakerx » Post

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.

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

by jojoa1997 » Post

Post the error here
Coding;
1X coding
3X debugging
12X tweaking to be just right

keyxmakerx
Member
Posts: 104
Joined: Mon Apr 08, 2013 23:53

by keyxmakerx » Post

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.

sapier
Developer
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Post

@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.
Last edited by sapier on Thu May 16, 2013 17:51, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved

sapier
Developer
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Post

Updated factions mod for usage with mobf
DON'T mention coding style!
(c) sapier all rights reserved

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

by BrunoMine » Post

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?
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com

sapier
Developer
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Post

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 ;-)
DON'T mention coding style!
(c) sapier all rights reserved

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

by twoelk » Post

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?

User avatar
LuxAtheris
Member
Posts: 169
Joined: Fri Oct 25, 2013 00:54
Location: Aether

by LuxAtheris » Post

A little suggestion:
Hud please? or even better when your in a guild,your guild name will be above your name.
Believe you can and you’re halfway there.

Iqualfragile
Member
Posts: 160
Joined: Tue Sep 18, 2012 22:11

by Iqualfragile » Post

/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
Gr8 b8, m8. I rel8, str8 appreci8, and congratul8. I r8 this b8 an 8/8. Plz no h8, I'm str8 ir8. Cr8 more, can't w8. We should convers8, I won't ber8, my number is 8888888, ask for N8. No calls l8 or out of st8. If on a d8, ask K8 to loc8. Even with a full pl8, I always have time to communic8 so don't hesit8.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 25 guests