Author Topic: [Resource] Rot.js Digger Dungeon Generator  (Read 1922 times)

So I ported the Rot.js Digger Dungeon generator over to Torquescript.
Use it however you like, but if you do please gimme credit for the port.

Execute map.cs to load all scripts.

To initialize RotMap for generating call
Code: [Select],height);Then call
Code: [Select]
RotMap.create();For a pretty dungeon to be outputted to your console.

The map is stored via
Code: [Select][x,y]so if you want to access them use that syntax

The doors between features are stored in each room's data.
So you can basically get to them by going through
Code: [Select]
RotMap.rooms.r[room number].doors.getObject(door number);(I'm too lazy to convert rooms to a simgroup so get the count of rooms by using rooms.count)
Rooms start at 1 and go up, e.g. r1, r2, r3 . . .
The door coords are stored via .x and .y
Code: [Select]
%x = RotMap.rooms.r[1].doors.getObject(0).x;
You can stop it from echoing the map to console by deleting line #82 in digger.cs
Code: [Select]
Btw all the map data is deleted by the end of the .create(); function, so get all the data you wanted by then.

If you need any further explanation on anything, please ask.

Also yes I know somethings could probably have been done in a better way.
Feel free to fix it up if you want.