Page 1 of 1

[Mod] Soccer [0.1.0] [soccer]

PostPosted: Mon May 27, 2013 00:15
by kaeza
Play soccer on Minetest!

This currently only provides the ball; the actual logic for implementing a match will be implemented in the future. For now, you can use Mesecons Wooden Pressure Plates along with some logic to at least handle scoring. Goals are also provided but have no functionality.

You can push the ball by standing near it, and kick it by holding the "sneak" key (by default "Shift"). The ball will get pushed/kicked in the direction the player is facing (you can center-on the ball by looking up).

License:
Code: BSD 2 Clause (see here).
Media: CC-BY-SA (see here).

Dependencies:
default, wool (for textures)

Links:
Download - ZIP Archive, Tarball
Browse code on Github

REMEMBER to RENAME the directory to just 'soccer'!

Please post bugs, suggestions, or compliments (!) here!

Screenshot:
Image

Also, here's a demo video (older version): http://www.youtube.com/watch?v=LczR71gc6TY

Items:
Image Soccer Ball (soccer:ball_item)
Alias: ball
A roundy thing you can kick.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
+------------+-------------------+------------+
|            | wool:white        |            |
+------------+-------------------+------------+
| wool:white | default:coal_lump | wool:white |
+------------+-------------------+------------+
|            | wool:white        |            |
+------------+-------------------+------------+


Image Straight Line (soccer:line_i)
Used for marking the field. (Note: line_i, lowercase I)
(uncraftable)

Image L Line (soccer:line_l)
Used for marking the field. (Note: line_l, lowercase L)
(uncraftable)

Image T Line (soccer:line_t)
Used for marking the field.
(uncraftable)

Image + Line (soccer:line_p)
Used for marking the field.
(uncraftable)

Image Diagonal Line (soccer:line_d)
Used for marking the field.
(uncraftable)

Image Point (soccer:line_point)
Used for marking the field.
(uncraftable)

Image Corner (soccer:line_corner)
Used for marking the field.
(uncraftable)

Image Soccer Goal (soccer:goal)
Used for decoration (non functional, collision is buggy).
(uncraftable)

Image Soccer Goal Mark (soccer:goal_mark)
Detects balls on it, and activates adjacent Mesecons. Not functional currently.
(uncraftable)

PostPosted: Mon May 27, 2013 00:25
by ecube
+1

PostPosted: Mon May 27, 2013 00:27
by PilzAdam
Noooooooooooooooooo!
No soccer!

PostPosted: Mon May 27, 2013 00:32
by ecube
Yes, you're not the only one who's afraid of balls (points at self)

Image
https://dl.dropboxusercontent.com/u/54794973/soccer_ball.png
^ Whipped up a (very horrible) texture for the ball, you could use it for now

PostPosted: Mon May 27, 2013 01:30
by Evergreen
I got a mod error when I placed the ball. Debug:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
21:29:06: ERROR[main]: ServerError: LuaError: error running function 'on_step': ...Evergreen/Desktop/Minetest/bin/../mods/soccer/init.lua:30: attempt to call field 'get_objects_inside_radius' (a nil value)
21:29:06: ERROR[main]: stack traceback:

PostPosted: Mon May 27, 2013 01:35
by kaeza
Evergreen wrote:I got a mod error when I placed the ball. Debug:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
21:29:06: ERROR[main]: ServerError: LuaError: error running function 'on_step': ...Evergreen/Desktop/Minetest/bin/../mods/soccer/init.lua:30: attempt to call field 'get_objects_inside_radius' (a nil value)
21:29:06: ERROR[main]: stack traceback:

I didn't see that error because I use latest git (it should be minetest.env:get_objects_inside_radius instead of the new minetest.get_objects_inside_radius).
Fixed in git. Please download again.
Thanks for reporting.

PostPosted: Mon May 27, 2013 07:19
by cornellius
damn it this mod!!!! really freakin awesome!!!

PostPosted: Mon May 27, 2013 11:51
by 12Me21
Cool mod, the crafting recipe could be:
c = coal lump
w = white wool
x = empty

xwx
wcw
xwx

PostPosted: Mon May 27, 2013 13:35
by kaeza
Update!
  • Cleaned up code.
  • Ball now bounces on floor (still buggy).
  • Added new line decals to draw the field (not craftable ATM).
  • Added new texture for the ball (thanks ecube!).
  • Added crafting recipe for ball (thanks 12Me21!).

See first post for download links and a new screenshot!

PostPosted: Mon May 27, 2013 14:12
by Mossmanikin
While in general I don't like soccer at all... love this idea :D

PostPosted: Mon May 27, 2013 14:17
by kaeza
Mossmanikin wrote:While in general I don't like soccer at all... love this idea :D

Thanks!
I also don't like *real* soccer, but I'm trying to make new minigames for servers that want to adopt them.
Actually, this started as a silly test to implement friction in entities (the ball gradually stops while on ground).

PostPosted: Mon May 27, 2013 14:43
by Mossmanikin
Just tested it a bit;
surprised how well shooting/pushing the ball works.
No bugs found (minetest-0.4.6-ab43377-win32, creative).
Like it so far.
I think this could be really fun in multiplayer.

PostPosted: Mon May 27, 2013 14:57
by cornellius
Yep Me Too And This Mod Really Nice

PostPosted: Wed Jun 19, 2013 22:19
by Xmster4334
It will not work for me why???

PostPosted: Wed Jun 19, 2013 22:21
by kaeza
Xmster4334 wrote:It will not work for me why???

Try renaming the folder to just 'soccer'.

If that fails, follow these instructions: http://forum.minetest.net/viewtopic.php?id=5073
But instead of creating a new topic, post here.

PostPosted: Thu Jun 20, 2013 13:08
by rubenwardy
Americans :S

it is football!!

PostPosted: Thu Jun 20, 2013 13:41
by Evergreen
rubenwardy wrote:Americans :S

it is football!!
He can't rename it to football, because there is another sport called "Football" in the united states. It would cause confusion.

PostPosted: Thu Jun 20, 2013 16:51
by kaeza
Evergreen wrote:
rubenwardy wrote:Americans :S

it is football!!
He can't rename it to football, because there is another sport called "Football" in the united states. It would cause confusion.

We call it 'fĂștbol' here (sounds like "football"), but as Evergreen said, "football" means another sport in the US (which is kind of silly I should add; most of the game is played with the ball in hands).

PostPosted: Thu Jun 20, 2013 18:31
by rubenwardy
kaeza wrote:
Evergreen wrote:
rubenwardy wrote:Americans :S

it is football!!
He can't rename it to football, because there is another sport called "Football" in the united states. It would cause confusion.

We call it 'fĂștbol' here (sounds like "football"), but as Evergreen said, "football" means another sport in the US (which is kind of silly I should add; most of the game is played with the ball in hands).


That is what I was thinking :P

PostPosted: Sat Jun 22, 2013 04:39
by xavier108
I like this mod
I also like soccer!!
+10

PostPosted: Fri Aug 23, 2013 19:59
by xiug
I changed your mod
Each ball has its customization
I changed to the Francophone server steinheim
I use google translation
Screen:
Image

PostPosted: Fri Aug 23, 2013 20:00
by xiug

PostPosted: Thu Aug 29, 2013 00:57
by kaeza
xiug: Changed code a bit and merged it. Thanks for the contribution.

Re: [Mod] Soccer [0.1.0] [soccer]

PostPosted: Tue Feb 23, 2016 23:54
by HalloHallo
Nice mod !

Now I only need some players and a refree to play with me haha

Here is a video of this mod:
https://youtu.be/WdGzQqIhzFY

Re: [Mod] Soccer [0.1.0] [soccer]

PostPosted: Thu Aug 04, 2016 23:17
by danholli123
You should add recipes using white dye or wool

Re:

PostPosted: Fri Aug 05, 2016 13:52
by danholli123
Evergreen wrote:
rubenwardy wrote:Americans :S

it is football!!
He can't rename it to football, because there is another sport called "Football" in the united states. It would cause confusion.

I'm american and american football is stupid, what part do you see anyone use there feet on the ball except when punting it?