[Mod] Arena_lib for minigames, updated [arena_lib]

Post Reply
User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

[Mod] Arena_lib for minigames, updated [arena_lib]

by MisterE » Post

So, I am maintaining Zughy's excellent arena_lib
it is an extensive library for making minigames.
The originals :
Spoiler
the new and improved (well just bugfixed for now):
git: https://gitlab.com/arcadeemulationserver/arena_lib
download: https://gitlab.com/arcadeemulationserve ... master.zip
issues: https://gitlab.com/arcadeemulationserve ... b/-/issues
Documentation( api ):https://gitlab.com/arcadeemulationserve ... er/DOCS.md

I have found a few bugs and fixed them. This version is required for my and debiankaios's Gems minigame, which required a nil crash bugfix. Feel free to submit bug reports and especially well tested PRs to this repo.

We will be adding features and extending the api as I feel the need or as others submit reasonably bug-free PRs

License: GPL 3
Mod dependencies: default, signs_lib, (optional) hub manager
Known conflicts: anything overriding the default respawn behaviour, such as Beds

Minigames you can use with it:

Gems - a bedwars or eggwars clone (with a twist all its own)
Sumo - knock players off the platform
Tntrun! - Spleef clone
Wormball - 3d snake
Quikbild - Pictionary quick draw (quick build and guess)
Skywars - last man standing
BlockLeague - Arena Shooter , Soccer with guns
Murder - like clue, catch the murderer, dont be killed.


For making your own minigames, check out the sample minigame:
viewtopic.php?f=9&t=27287&p=400327#p400327
Last edited by MisterE on Tue Sep 14, 2021 04:22, edited 3 times in total.

ronoaldo
Member
Posts: 177
Joined: Mon Dec 07, 2020 01:04
GitHub: ronoaldo
IRC: ronoaldo
In-game: RonoaldoKakashi
Location: São Paulo, Brasil
Contact:

Re: [Mod] Arena_lib for minigames, updated [arena_lib]

by ronoaldo » Post

I have a survival server and I would like to create an arena area for PvP (server pvp is disabled). Can I use this mod for that purpose?
Servers: Mercurio | Tools: ContentDB CLI | Mods: minenews

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Arena_lib for minigames, updated [arena_lib]

by MisterE » Post

You can, quite easily. If your pvp game is "die and eliminate" then you can use arena_lib out of the box. If your minigame has respawning in the minigame after death, you will have to edit the beds mod to move players to their bed or static spawnpoint only if they are not in a minigame

Code: Select all

if not(arena_lib.is_player_in_arena(<p_name>,<minigame_mod_name>)) then
      --send player to bed or static spawnpoint here
end

ronoaldo
Member
Posts: 177
Joined: Mon Dec 07, 2020 01:04
GitHub: ronoaldo
IRC: ronoaldo
In-game: RonoaldoKakashi
Location: São Paulo, Brasil
Contact:

Re: [Mod] Arena_lib for minigames, updated [arena_lib]

by ronoaldo » Post

Amazing thanks!
Servers: Mercurio | Tools: ContentDB CLI | Mods: minenews

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Arena_lib for minigames, updated [arena_lib]

by MisterE » Post

also, my minigame sumo will work on survival servers without editing beds because it implements its own death replacement. Players never get the death formspec, instead they get an hud announcement

you can examine its code to see how to do the same.

ronoaldo
Member
Posts: 177
Joined: Mon Dec 07, 2020 01:04
GitHub: ronoaldo
IRC: ronoaldo
In-game: RonoaldoKakashi
Location: São Paulo, Brasil
Contact:

Re: [Mod] Arena_lib for minigames, updated [arena_lib]

by ronoaldo » Post

Hi! Do you happen to have a sample where I can define a PvP area in my survival server, but keep PvP disabled elsewhere? I saw your sumo game but I don't know how it defined the bouding box for the game.
Servers: Mercurio | Tools: ContentDB CLI | Mods: minenews

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Arena_lib for minigames, updated [arena_lib]

by MisterE » Post

arena_lib does not define a bounding box. It defines spawn positions for the minigame. Its up to you to build an arena that is in-escapable, with the spawn positions inside.

Im not sure how you would enable pvp for a specific player. If you give me 2 code sample functions that take p_name and disables or enables pvp for that player, then I can make you an example arena_lib minigame registration.

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Arena_lib for minigames, updated [arena_lib]

by MisterE » Post

I updated with a new feature: now punching a sign is a function that is not hardcoded into the sign node definition, making it possible for other mods (like my autoplay mod) to punch the arena sign for a player to queue them into a game automatically or remove them from the queue. Its fairly low level stuff, so if you want to see how to do it, examine the code of the autoplay mod: https://gitlab.com/arcadeemulationserver/autoplay

I have not posted autoplay on the forums because it is specific to aes_game, which itself isnt "published" on the forums yet. But It will be sometime in the future, and for now, andyone that wants to make a minigame server can download the game from https://gitlab.com/arcadeemulationserver

Code: Select all

git clone https://gitlab.com/arcadeemulationserver/aes_game --recursive

will clone the game into the working directory and pull all the submodule mods

ronoaldo
Member
Posts: 177
Joined: Mon Dec 07, 2020 01:04
GitHub: ronoaldo
IRC: ronoaldo
In-game: RonoaldoKakashi
Location: São Paulo, Brasil
Contact:

Re: [Mod] Arena_lib for minigames, updated [arena_lib]

by ronoaldo » Post

Hi, I ended up starting with just a pvp enabled area while the server is still pacific. I'll study how to embed the minigames using arenalib in the delimited area. It's a floatland so it's inescapable.

This is how I ended up implementing it:
https://github.com/ronoaldo/mercurio/co ... 6f26c7dc97
Servers: Mercurio | Tools: ContentDB CLI | Mods: minenews

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Arena_lib for minigames, updated [arena_lib]

by MisterE » Post

here is a sample minigame for you to play with. Its also a template for making any minigame... pick and choose and change what you need. It contains extensive explanations in the code
viewtopic.php?f=9&t=27287&p=400327#p400327

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 12 guests