[Modpack] CTF PvP Engine [1.0] [ctf_pvp_engine]

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

by rubenwardy » Post

It supports infinite teams in theory, however there is only three colors of flags given with the mod.
You could make your own flags.
Last edited by rubenwardy on Fri Mar 28, 2014 09:07, edited 1 time in total.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
pmpeetamellark
New member
Posts: 3
Joined: Mon Jul 21, 2014 15:03
In-game: Peeta Mellark

Re: [Game] Capture the Flag / City VS City combat [0.2][capt

by pmpeetamellark » Post

How Do I Shoot?! Guns are not functioning even with ammo in the item selector!
Peeta Mellark
District 12 Tribute, Victor, and Mentor
May The Odds Be Ever In Your Favor! :)

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Game] Capture the Flag / City VS City combat [0.2][capt

by Krock » Post

Try to reload the guns
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
maier.nathan
Member
Posts: 40
Joined: Wed Dec 04, 2013 02:07
GitHub: npmaier
In-game: Bikemare EdgarLinton
Location: Myrtle Beach, South Carolina
Contact:

Re: [Game] Capture the Flag / City VS City combat [0.2]

by maier.nathan » Post

Hi,
I am trying to add a player to a default team when a new player join. Any ideas how?
there's minetest.register_on_newplayer. This is for a subgame.
Thanks very much,
Bikemare

CreeperLord700
New member
Posts: 7
Joined: Sun Dec 14, 2014 00:52

Re: [Game] Capture the Flag / City VS City combat [0.2]

by CreeperLord700 » Post

ruben, i cant seem to be on a team, i do /join team singleplayer CR and team fails, i place flag and pops up " you are not part of a team!"

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

Re: [Game] Capture the Flag / City VS City combat [0.2]

by rubenwardy » Post

CreeperLord700 wrote:ruben, i cant seem to be on a team, i do /join team singleplayer CR and team fails, i place flag and pops up " you are not part of a team!"
It is /join team_name. Create a team using /team add team_name.
maier.nathan wrote:Hi,
I am trying to add a player to a default team when a new player join. Any ideas how?
there's minetest.register_on_newplayer. This is for a subgame.
Thanks very much,
Bikemare
Auto allocating teams is a planned feature.

Code: Select all

ctf.join(player_name, "team_name", true)
Only do it on their first join, otherwise they will change team everytime they join.

(^ You need the latest version of the source code, uploaded today 27/12/2014)
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

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

Re: [Game] Capture the Flag / City VS City combat [0.2]

by rubenwardy » Post

Added automatic allocation of players to teams.

https://github.com/rubenwardy/captureth ... 975c5960a9
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

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

Re: [Game] Capture the Flag / City VS City combat [0.3]

by rubenwardy » Post

0.3 Released!

New Features
  • Auto allocation to teams
  • Start of HUD
Logistical Changes
  • Now licensed under LGPL 2.1 or later for code, CC BY-SA 3.0 or later for textures.
  • Use vector helpers from the lua_api, rather than v3 from commonlib.
  • Change namespace from cf to ctf
  • Rename main mod to ctf and move into modpack. Also turret -> ctf_turret and protect -> ctf_protect
  • Move code around to be cleaner. Init.lua now only contains dofiles()
  • ctf.register_on_load and ctf.register_on_save for adding things to ctf.txt
  • Removed firearms
  • Cleaned lots of code styles
Bug Fixes
  • /ctf crash
  • Fix assignment to unassigned global
  • Many smaller changes
To Do
  • Fix settings data types. (all settings are strings if from minetest.conf, so are always true)
  • Skins for players
  • More colours
  • Get flag taking working better:
    • player can be seen holding the flag
    • safer flag taking (bulletproof)
    • Timers (only certain amount of time to return it.
    • How the player is stopped - add tag, drop on death and return on death options
    • Allow flags to be passed between players
  • Items:
    • Deco flags
  • Flag finder / some way for a player to locate a flag
  • Awards
  • Add more settings etc
  • Opening and closing teams to new members
  • Use privileges for team_owners
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
sirken
Member
Posts: 16
Joined: Thu Oct 09, 2014 15:18
GitHub: sirken

Re: [Game] Capture the Flag / City v City [0.3] - Team Alloc

by sirken » Post

Looking forward to trying this!

How do you place flags?

I'm guessing it's under the Flags button in the /team GUI, but I couldn't get it to work. I added teams (red/blue), then had players choose teams. Team owners were chosen. I opened menu with /team, and clicked the Flags button and server crashed:

Code: Select all

16:09:09: ERROR[main]: ServerError: ...ames/capturetheflag/mods/capturetheflag/ctf/core.lua:269: attempt to compare number with string
16:09:09: ERROR[main]: stack traceback:
16:09:09: ERROR[main]: 	...ames/capturetheflag/mods/capturetheflag/ctf/core.lua:269: in function '?'
16:09:09: ERROR[main]: 	.../builtin/game/register.lua:348: in function <.../builtin/game/register.lua:336>
Using Minetest 0.4.10-71-g9e4e707

Thanks.

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

Re: [Game] Capture the Flag / City v City [0.3] - Team Alloc

by rubenwardy » Post

You place the ctf:flag node. I'll look into that bug, ot is probably a settings data type thing.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

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

Re: [Game] Capture the Flag / City v City [0.3] - Team Alloc

by rubenwardy » Post

Fixed that bug, and possibly many others. It was a settings data type thing.

30633 (Fix setting data type issues)
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
sirken
Member
Posts: 16
Joined: Thu Oct 09, 2014 15:18
GitHub: sirken

Re: [Game] City v City / Capture the Flag [0.3] - Team Alloc

by sirken » Post

rubenwardy wrote:Fixed that bug, and possibly many others. It was a settings data type thing.

30633 (Fix setting data type issues)
It is working for me now, thanks for the fix.

Gerald
Member
Posts: 93
Joined: Sun Dec 28, 2014 10:35
In-game: gerald7
Location: Germany

Re: [Game] City v City / Capture the Flag [0.3] - Team Alloc

by Gerald » Post

I found a little bug. If TNT explodes near a flag, the flag does not disappear but if a mine explodes the flag disappears being still spawnpoint and in the list of flags.

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

Re: [Game] City v City / Capture the Flag [0.3] - Team Alloc

by rubenwardy » Post

I didn't anticipate that. I will update the traps mod to use the TNT code.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

Gerald
Member
Posts: 93
Joined: Sun Dec 28, 2014 10:35
In-game: gerald7
Location: Germany

Re: [Game] City v City / Capture the Flag [0.3] - Team Alloc

by Gerald » Post

Maybe i just not found the right commands:
Is it possible to leave a team or to change team or to delete a team? If i try join another team there is the message 'joining <> to team <>' but nothing happens.

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

Re: [Game] City v City / Capture the Flag [0.3] - Team Alloc

by rubenwardy » Post

Try /join team-name

I haven't tested /team join playername teamname in a while.

Deleting is planned, I noticed that you couldn't do that recently. You currently can't just leave a team and not be on a team.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

Gerald
Member
Posts: 93
Joined: Sun Dec 28, 2014 10:35
In-game: gerald7
Location: Germany

Re: [Game] City v City / Capture the Flag [0.3] - Team Alloc

by Gerald » Post

Thanks for the fast answer.

I wanted to construct short events like 3 vs 3 capture the flag or something like bedwars on a map, which resets after the event and the players are teleported back to spawn able to start a new event dividing different into two new teams.

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [Modpack] CTF PvP Engine [1.0] [ctf_pvp_engine]

by ABJ » Post

How about duels between two separate challenging team members?

Xudo
Member
Posts: 162
Joined: Wed Nov 09, 2016 16:43
GitHub: akryukov92
In-game: Xudo

Re: [Modpack] CTF PvP Engine [1.0] [ctf_pvp_engine]

by Xudo » Post

I'm trying to setup my local server for this game and getting a problem.
Teams and its members doesn't persist if I restart server.
I have made 5 players: admin, RedKing, RedSlave, BlueKing, BlueSlave and then:
admin: /team add blue
admin: /team add red
RedKing: /join red
BlueKing: /join blue
admin: /shutdown

If I run server after this and use "/t hi all" from RedKing, I would get message "You're not in a team, so you have no team to talk to".

Are they supposed to persist at all?

Xudo
Member
Posts: 162
Joined: Wed Nov 09, 2016 16:43
GitHub: akryukov92
In-game: Xudo

Re: [Modpack] CTF PvP Engine [1.0] [ctf_pvp_engine]

by Xudo » Post

I have found source of the problem. When players join to team, ctf state is not being marked as "need save". Thats why it wasn't saved.

I assume this might be an option for games with short sessions. I have added config parameter to persist team membership.
I have failed to push it to your repository and to attach a patch, though.

Code: Select all

---
 ctf/core.lua  | 1 +
 ctf/teams.lua | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/ctf/core.lua b/ctf/core.lua
index fe69334..29452b1 100644
--- a/ctf/core.lua
+++ b/ctf/core.lua
@@ -146,6 +146,7 @@ function ctf.init()
 	ctf._set("hud",                        true)
 	ctf._set("autoalloc_on_joinplayer",    true)
 	ctf._set("friendly_fire",              true)
+	ctf._set("persist_team_membership",    true)
 
 
 	for i = 1, #ctf.registered_on_init do
diff --git a/ctf/teams.lua b/ctf/teams.lua
index 57ff274..bb3756c 100644
--- a/ctf/teams.lua
+++ b/ctf/teams.lua
@@ -200,6 +200,9 @@ function ctf.join(name, team, force, by)
 	for i = 1, #ctf.registered_on_join_team do
 		ctf.registered_on_join_team[i](name, team)
 	end
+	if ctf.setting("persist_team_membership") then
+		ctf.needs_save = true
+	end
 	return true
 end
 

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

Re: [Modpack] CTF PvP Engine [1.0] [ctf_pvp_engine]

by rubenwardy » Post

there's no need for an option, I just forgot to add it there

https://github.com/rubenwardy/ctf_pvp_e ... 58f0799d50
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

Xudo
Member
Posts: 162
Joined: Wed Nov 09, 2016 16:43
GitHub: akryukov92
In-game: Xudo

Re: [Modpack] CTF PvP Engine [1.0] [ctf_pvp_engine]

by Xudo » Post

I have implemented few things in your mod.
What should I do to merge them to master?
What are your requrements for testing?

Things are:
  • "/apply <team>" console command. Players can ask to join. Team managers can decide whether they should be in team or not.
  • "Petitions" tab in team interface. You can see there a list of players wanted to join and accept or reject their applications.

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

Re: [Modpack] CTF PvP Engine [1.0] [ctf_pvp_engine]

by rubenwardy » Post

Preferably, you should fork my repo, create a new branch there and commit your changes, then click "create pull request"
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

Xudo
Member
Posts: 162
Joined: Wed Nov 09, 2016 16:43
GitHub: akryukov92
In-game: Xudo

Re: [Modpack] CTF PvP Engine [1.0] [ctf_pvp_engine]

by Xudo » Post

Looks like I have figured out how to do this.

I feel really uncomfortable with changing this mod without any tests. Thats why I'm going to increase production quality of this mod.
Do you have any familiar unit-testing framework?
If not, I'll use lunatest.

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

Re: [Modpack] CTF PvP Engine [1.0] [ctf_pvp_engine]

by rubenwardy » Post

Yeah, tests are definitely needed

I'd buy you a coffee if you could add tests to this modpack :D
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests