Roguelike plugin - C2 rot.js interface

Post your completed addons to share with the community

Post » Sat Nov 01, 2014 2:57 pm

For all Roguelike fans, here is a C2 interface to an excellent rot.js javascript roguelike library.

"Generate map" action generates the map data and stores it in the plugin internal dictionary (the plugin is based on the Dictionary plugin): the key represents map coordinates and is of the format "x,y" (e.g. "12,34"); the value is a text character - "." for floors/passable tiles and "#" for walls/solids.

Image

Image

Image



Plugin can compute a discrete (map cell based) FOV (Field of vision) from a given map coordinate:

Image



Plugin can compute a discrete (map cell based) path (Dijkstra algorithm) from a given map coordinate to a given map coordinate:

Image


Configurable room width & height and corridor length:

Image

Image

Image



Loop through all rooms and access room edges and center (useful for a map object placement):

Image


Added door hooks. You can get X & Y coords foor each room's door...

Image

Image
You do not have the required permissions to view the files attached to this post.
Last edited by Lunarovich on Sat Nov 01, 2014 4:04 pm, edited 1 time in total.
B
6
S
2
Posts: 64
Reputation: 576

Post » Sat Nov 01, 2014 3:51 pm

Finally! :P

Thank, great addition to community.

Is there a way in rot.js to get cell numbers for FOV, to gradually fade it out?
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Sat Nov 01, 2014 4:02 pm

You are welcome :)

Actually, there is a For each visible map cell condition.

Image

Does this answers your question?
B
6
S
2
Posts: 64
Reputation: 576

Post » Sat Nov 01, 2014 4:13 pm

wow youre fast! :)
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

Post » Sat Nov 01, 2014 4:22 pm

Really nice work. I'm still working on a few other projects at the moment, but if I do have a chance to test out your plugin, I will!
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,826

Post » Sat Nov 01, 2014 4:24 pm

@Lunarovich

I've been playing with this for a while, but i can't get something like this to work. Where FOV with distance 1 = tile 2 and FOV with distance 2 = tile 3.
You do not have the required permissions to view the files attached to this post.
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Sat Nov 01, 2014 6:03 pm

@shinkan
Can't you just use the tilemap's "set tile range"?
Image ImageImage
B
169
S
50
G
173
Posts: 8,315
Reputation: 110,274

Post » Sat Nov 01, 2014 6:45 pm

Since you have the map coordinates of the FOV tiles, you could test the tile distance with a Pythagorean theorem and than round the result to get an integer. Then you could set a tile frame as desired...
B
6
S
2
Posts: 64
Reputation: 576

Post » Sat Nov 01, 2014 7:28 pm

Lunarovich wrote:Since you have the map coordinates of the FOV tiles, you could test the tile distance with a Pythagorean theorem and than round the result to get an integer. Then you could set a tile frame as desired...


newt wrote:@shinkan
Can't you just use the tilemap's "set tile range"?


hehe yeah... I was looking at the "Roguelike" object in the events, and completely forgot that it's just a simple plain tilemap in the end :D
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Mon Nov 03, 2014 9:00 pm

Thanks for this fantastic plugin and also adding in my previous request! It's verrry handy indeed :) I was wondering - is it possible to have the pathfinding algorithm have a "do not allow diagonals" option? I've been trying to get a grid-based pathfinding without diagonals with the built-in A* behaviour, but it doesn't seem to want to play ball :(
B
4
S
1
Posts: 12
Reputation: 374

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests