co op color question

Mods, guides how to use and install mods go right in here.
Post Reply
User avatar
Gramanaitor
Posts: 174
Joined: 24 May 2013, 14:34
Contact:

Post » 14 Jul 2013, 21:34

(This question is for modders)In some mods, instead of the normal portal colors it has the co op colors. Which lua in the mod changes that?

User avatar
zorua7551
Posts: 193
Joined: 10 Jul 2013, 04:23

Post » 14 Jul 2013, 21:44

i dont see what is wrong with the portal colors here

User avatar
HugoBDesigner
Posts: 2189
Joined: 19 Sep 2012, 02:23
Contact:

Post » 14 Jul 2013, 22:26

Gramanaitor wrote:(This question is for modders)In some mods, instead of the normal portal colors it has the co op colors. Which lua in the mod changes that?
I was just thinking about it today too. I would like to add this feature to a mod I'm making, but I don't know where to change it...

User avatar
TripleXero
Posts: 892
Joined: 08 Aug 2012, 00:23
Contact:

Post » 14 Jul 2013, 23:00

in mario.lua, line 111, change the following

Code: Select all

	if players == 1 then
		self.portal1color = {60, 188, 252}
		self.portal2color = {232, 130, 30}
	else
		self.portal1color = portalcolor[self.playernumber][1]
		self.portal2color = portalcolor[self.playernumber][2]
	end
to

Code: Select all

	if players == 1 then
		self.portal1color = portalcolor[self.playernumber][1]
		self.portal2color = portalcolor[self.playernumber][2]
	else
		self.portal1color = portalcolor[self.playernumber][1]
		self.portal2color = portalcolor[self.playernumber][2]
	end

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

Post » 14 Jul 2013, 23:18

You only need:

Code: Select all

self.portal1color = portalcolor[self.playernumber][1]
self.portal2color = portalcolor[self.playernumber][2]
Change the whole thing to that and it should work.
TripleXero's code works, but it is a waste of code

User avatar
Kexaihami
Posts: 348
Joined: 10 Jun 2013, 10:09

Post » 14 Jul 2013, 23:26

Yes, Bob. His is crazy verbose.

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

Post » 14 Jul 2013, 23:41

6 lines, when you need 2, is kind of unnecessary.

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

Post » 15 Jul 2013, 00:01

...

Post Reply