Gamemode Request + other Mods

Mods, guides how to use and install mods go right in here.
Post Reply
HAPPYFACES
Posts: 524
Joined: 02 Jun 2012, 03:40

Post » 16 Jan 2013, 00:52

So one day, after playing Mar0 for a few months, I decide to show the game to my brother.

He thought it was kinda cool, except he's a little Call of Duty freak and finds no fun in playing platformers. So while I played, he decided to take the mouse from me and start shooting the portals for me. So I'd be playing normal Super Mario Bros., and he'd be screwing me up.

Usually he'd fire one off early in the level, then make me fall into the other next to the flag that had me going all the way back.

And then I thought, 'Hey, this would be a pretty cool gamemode.' Now, I've watched this place for a long time, and I know Maurice and Saso have a lot on their plate with all the suggestions, demands, updates, little kids to ban, and whatnot... And I am absolutely clueless about lua, LOVE and all this, so I thought it'd be nice to bring it up in a subforum where the smarter people can possibly handle this.
/end cool story.

Suggestion part.
Anyways, the gamemode is basically, take a few steps, and a set of portals is opened near your position. They could be helpful, in your way, or lead only a few blocks ahead of you. the "R" button and shooting your own portals are disabled, and all you can really do is play through like normal Mario Bros. or whatever map pack you're on, except with the portals inhibiting or helping your progress.

Editz:
I also saw someone suggest something that's been on my mind since I got 0'Brothers.

A mod loader. Something that takes the core files from other Mari0 LOVE files and puts them together to create a massive single mod on startup. Anybody see that topic?

Another edit

I was also wondering if I could have the code and all anchoring/related codes to the dynamic splitscreen. Unless it's already written into the game and just disabled?
Last edited by HAPPYFACES on 21 Jan 2013, 06:35, edited 2 times in total.

User avatar
TurretBot
Posts: 4412
Joined: 15 Mar 2012, 23:18
Contact:

Post » 16 Jan 2013, 05:12

Okay I'm no coder but I think that's impossible,
You'd have to make an AI for the portals and that might require some sort of rewrite and that whatnot.

User avatar
Mr.Q.Marx?
Posts: 849
Joined: 15 May 2012, 18:35

Post » 16 Jan 2013, 14:00

Turret Opera wrote: You'd have to make an AI for the portals.
AI which I would write. Psudocode.

randomTime = new int 0,60

if randomTime = 0
{
randomAngle = new int 0, 360
blue.createPortal.randomAngle
randomAngle = new int 0, 360
orange.createPortal.randomAngle
randomTime = new int 0,60
}
randomTime --

I know this is messy but the AI could be simple like this.

HAPPYFACES
Posts: 524
Joined: 02 Jun 2012, 03:40

Post » 19 Jan 2013, 00:13

Kinda got distracted for a bit, sorry.

And this is why I envy people with more knowledge of coding than me. Mr.Q.Marx? hit this on the head as far as I know.

Also, has anyone ever thought about creating idle animations for characters, and animations for other blocks besides ? blocks?

User avatar
BobTheLawyer
Posts: 2232
Joined: 01 May 2012, 21:00

Post » 19 Jan 2013, 01:24

Mr.Q.Marx? wrote: {
randomAngle = new int 0, 360
blue.createPortal.randomAngle
randomAngle = new int 0, 360
orange.createPortal.randomAngle
randomTime = new int 0,60
}
Pretty sure Mari0 doesn't use 360 for angles. I think it is clock based...

User avatar
Turtle95
Posts: 1246
Joined: 21 Mar 2012, 21:48
Contact:

Post » 19 Jan 2013, 01:35

BobTheLawyer wrote:
Mr.Q.Marx? wrote: {
randomAngle = new int 0, 360
blue.createPortal.randomAngle
randomAngle = new int 0, 360
orange.createPortal.randomAngle
randomTime = new int 0,60
}
Pretty sure Mari0 doesn't use 360 for angles. I think it is clock based...
Wrong sir, wrong! It's used in pi radians. If you don't know that stuff, you can't do much. (I know pi radians, and I'm sure other people on the forums do as well).

User avatar
BobTheLawyer
Posts: 2232
Joined: 01 May 2012, 21:00

Post » 19 Jan 2013, 01:52

I never really payed attention to it.
I dealt with it for a little bit in one mod.

HAPPYFACES
Posts: 524
Joined: 02 Jun 2012, 03:40

Post » 19 Jan 2013, 05:59

Turtle95 wrote:Wrong sir, wrong! It's used in pi radians. If you don't know that stuff, you can't do much. (I know pi radians, and I'm sure other people on the forums do as well).
Huh, I looked into the code... Saw pi symbol... didn't make the connection. Thank you, the more you know.

HAPPYFACES
Posts: 524
Joined: 02 Jun 2012, 03:40

Post » 02 Feb 2013, 07:29

Does the variable "i" for mario indicate the number of players in Mari0?

User avatar
Automatik
Posts: 1073
Joined: 20 Jul 2012, 17:54
Contact:

Post » 02 Feb 2013, 13:32

No, "i" is used when in a loop, it's usually the id of the current object.
To get the number of players, use #objects["player"] .
Also, 360 degrees = two*pi radians.
Turtle95 wrote:Wrong sir, wrong! It's used in pi radians. If you don't know that stuff, you can't do much. (I know pi radians, and I'm sure other people on the forums do as well).
Why "Pi" radians? There is only one type of radian.
also, with math.rad() & math.deg(), you don't need to know radians.(It respectively convert to radians and to degrees, and it's used in Not Pacman and Not Tetris.)

User avatar
Qcode
Posts: 1479
Joined: 05 Feb 2012, 18:00
Contact:

Post » 02 Feb 2013, 16:02

...
Last edited by Qcode on 21 Oct 2021, 09:02, edited 1 time in total.

User avatar
Automatik
Posts: 1073
Joined: 20 Jul 2012, 17:54
Contact:

Post » 02 Feb 2013, 16:53

I know, but "players" don't actually mean the number of marios on the screen.
What if you're playing multiplayer, and one of the marios die and don't have any life left? he will be deleted from "objects["player"]", but "players" will not be decreased. And then, mari0 try to make an non-existant mario shoot portals, and poof, "attempt to index field '?' (a nil value)".

HAPPYFACES
Posts: 524
Joined: 02 Jun 2012, 03:40

Post » 03 Feb 2013, 09:23

I want to call each player as a separate object, rather than a Mario.

User avatar
Automatik
Posts: 1073
Joined: 20 Jul 2012, 17:54
Contact:

Post » 03 Feb 2013, 12:40

Why?
Marios are objects, and you can't make them shoot portals if they don't exist.
And you can't make a player shoot portals since they don't have any position, and in 1.6, portals are part of marios.
mario.lua:131

Code: Select all

	self.portal1X = false
	self.portal1Y = false
	self.portal2X = false
	self.portal2Y = false
	self.portal1facing = nil
	self.portal2facing = nil

HAPPYFACES
Posts: 524
Joined: 02 Jun 2012, 03:40

Post » 04 Feb 2013, 07:18

The reason I'd like to call each player as a separate object is to modify the properties of each separate player to give them their own special properties, Ex.: Jump height, gravity, Fire Flower power. Customizable (Rather than the color and hat) Characters. Possibly also allow multiple gamemodes for separate players, Portal, Gelcannon, Minecraft. Hey maybe even guns 'n' 'nades.

User avatar
Qcode
Posts: 1479
Joined: 05 Feb 2012, 18:00
Contact:

Post » 04 Feb 2013, 14:35

...
Last edited by Qcode on 21 Oct 2021, 09:02, edited 1 time in total.

Maurice
Stabyourself.net
Posts: 2145
Joined: 01 Feb 2012, 20:19

Post » 04 Feb 2013, 15:57

Automatik wrote:Why?
Marios are objects, and you can't make them shoot portals if they don't exist.
And you can't make a player shoot portals since they don't have any position, and in 1.6, portals are part of marios.
mario.lua:131

Code: Select all

	self.portal1X = false
	self.portal1Y = false
	self.portal2X = false
	self.portal2Y = false
	self.portal1facing = nil
	self.portal2facing = nil
I spent several hours separating players and portals in SE by the way.
So you can still use the "portal" entity with id 2 even if player 2 isn't playing.
http://i.imgur.com/FvZio.gif

This supports theoretically unlimited but only 8 GUI supported portals at the moment.
Combine this with region triggers and you can already do this.
(I just tried this and I need toggle gates because regions send an "off" signal and the portals close again)

HAPPYFACES
Posts: 524
Joined: 02 Jun 2012, 03:40

Post » 09 Feb 2013, 05:27

Okay, thank you Automatik and Qcode for steering me away from an impossible path.

Now, while I was disconnected from the net, I had some time to begin something that I think I won't be able to finish on my own. If no one is busy and would probably like to help me with this project, PM me. I'm gonna need all the help I can get...

User avatar
rokit
Posts: 2095
Joined: 03 Feb 2012, 00:47

Post » 10 Feb 2013, 15:11

Automatik wrote:No, "i" is used when in a loop, it's usually the id of the current object.
To get the number of players, use #objects["player"] .
Also, 360 degrees = two*pi radians.
Turtle95 wrote:Wrong sir, wrong! It's used in pi radians. If you don't know that stuff, you can't do much. (I know pi radians, and I'm sure other people on the forums do as well).
Why "Pi" radians? There is only one type of radian.
also, with math.rad() & math.deg(), you don't need to know radians.(It respectively convert to radians and to degrees, and it's used in Not Pacman and Not Tetris.)
Sorry for pointing it out but there is also Tau radians and Tau = 2pi (I doubt any prog. language uses it).

Maurice
Stabyourself.net
Posts: 2145
Joined: 01 Feb 2012, 20:19

Post » 11 Feb 2013, 16:38

rokit boy wrote:Sorry for pointing it out but there is also Tau radians and Tau = 2pi (I doubt any prog. language uses it).
Yes, there is tau. No, there is no such thing as tau radians.
A circle of r=1 has a circumference of ~6.2832, meaning a full 360° degree is ~6.2832 radians. This is either 2pi or 1tau, but radians are still radians. They have nothing directly to do with pi or tau.

HAPPYFACES
Posts: 524
Joined: 02 Jun 2012, 03:40

Post » 11 Feb 2013, 22:50

In essence there's four different units to measure a circle.

Kind of an update:
Would like to know if anyone's interested helping me make a character chooser for 1.6. I have some of the GUI elements figured out, but my main problem is having each player select a character, and tie that character's image to the player. Anybody interested?
Last edited by HAPPYFACES on 31 May 2013, 00:33, edited 1 time in total.

HAPPYFACES
Posts: 524
Joined: 02 Jun 2012, 03:40

Post » 31 May 2013, 00:15

Can someone explain to me this line? Line 1021-1024 in mario.lua:

Code: Select all

if self.playernumber == mouseowner then
		local scale = scale
		if shaders and shaders.scale then scale = shaders.scale end
		self.pointingangle = math.atan2(self.x+6/16-xscroll-(love.mouse.getX()/16/scale), (self.y+6/16-.5)-(love.mouse.getY()/16/scale))
I understand it's if the player is using the mouse, but I'm having a hard time picking it apart

Maurice
Stabyourself.net
Posts: 2145
Joined: 01 Feb 2012, 20:19

Post » 31 May 2013, 00:23

math.atan2 gives you the angle for a given y,x vector.
In line 4 I am calculating the vector from the middle of Mario to the mouse position so I can get the angle. At the time I was too stupid to realize it should be y,x and not x,y.

HAPPYFACES
Posts: 524
Joined: 02 Jun 2012, 03:40

Post » 31 May 2013, 00:43

Okay, so this should be left alone... And go to the setquad function at line 1508 to edit the angle quads, correct?

User avatar
Jackostar10000
Posts: 417
Joined: 17 Jun 2012, 12:06

Post » 01 Jun 2013, 14:23

yeah maybe it should be just a little 2p mode mod:

loose a point for each portal placed and 10 points for any level beat
gain a point if player one goes through a portal 2 points if a enemy goes through a portal 20 points if they die
also unlimited lives

possible mod idea rules ?

Post Reply