About redirection cubes - requesting help

Mods, guides how to use and install mods go right in here.
Post Reply
User avatar
cavejohnson99
Posts: 185
Joined: 09 May 2012, 08:37

Post » 01 Sep 2012, 06:00

I've built a mod for redirection cubes.
So, these cubes do everything a normal cube would, except it doesn't do the thing it was designed to do: redirect lasers.
Download link: https://www.dropbox.com/s/ij1r8dtzjouws ... cubes.love
Laser.lua: http://pastebin.com/4z8JncSp
I'm pretty sure the problem is in laser.lua, where it doesn't properly check for collision with redirection cubes (called laserboxes in the .lua files).
Can anyone help me with making the cubes redirect lasers?
Thanks.

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

Post » 02 Sep 2012, 19:10

Midnight...
Anyways, what you want to do is check for collide with lasers. If it collides, it creates new laser in the direction it redirects it to.

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

Post » 02 Sep 2012, 20:48

BobTheLawyer wrote:Midnight...
Anyways, what you want to do is check for collide with lasers. If it collides, it creates new laser in the direction it redirects it to.
I tried that. No sure if it was me, but it would not draw the laser with it.

User avatar
cavejohnson99
Posts: 185
Joined: 09 May 2012, 08:37

Post » 03 Sep 2012, 12:54

Maurice said in IRC that you can't check for box:directioncollide with lasers. Thanks anyway.

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

Post » 03 Sep 2012, 13:56

cavejohnson99 wrote:Maurice said in IRC that you can't check for box:directioncollide with lasers. Thanks anyway.
I would need a new laser...

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

Post » 03 Sep 2012, 14:00

You could probably easily extend laser:update(dt) to call v:lasercollide. That actually sounds like a really good idea.

User avatar
cavejohnson99
Posts: 185
Joined: 09 May 2012, 08:37

Post » 03 Sep 2012, 14:32

That sounds like a really good idea, but I'm too dumb to do that. Also I have a lack of time right now, and my buggy computer doesn't help.
Edit: I know this probably won't work, but can I make a boolean in checkrect(x, y, width, height, {"player", "box", "goomba", "koopa"}) that checks if laserbox == true or false to check laser collision with laserbox?

Post Reply