2x2 world with some nice features

All about creating levels and level sets, custom elements and custom artwork.

Moderators: Flumminator, Zomis

Post Reply
Zomis
Posts: 1502
Joined: Mon Jun 21, 2004 1:27 pm
Location: Sweden
Contact:

2x2 world with some nice features

Post by Zomis »

http://www.zomis.net/rnd/download.php?id=614

This extension of the World Making Challenge includes the following features:
- Teleportation between rooms
- Room variables. 7 emeralds per room

And it also contains a couple of bugs which I decide not to fix since they can be used as features. Enter the teleport for room number 1 at the bottom right in room number 2, when the new room is created some extra room elements are placed since the teleporter is placed in the way of the arrows placing the room elements. When these extra room elements are placed it changes the layout of the room a little. This is not a needed thing to solve this level, but it can be used for other things in other levels.

Of course, with this world making technique it's possible to implement other CE techniques of interests as well. The only limitation is your own fantasy.

Let me know if you need a tape to solve it ;) I think all of you will be able to solve it after a few attempts. (I myself did some mistakes when I wanted to solve it for real).

In case anyone wants to edit it and maybe make your own world (the level is already made for a 6x6 world, here is the script I used with RND CE Scripter to edit the world. It will toggle the level between playmode and editmode. (You will see which mode is currently used by the size of the level field. Small field = Play mode, large field = edit mode)

Code: Select all

const
  roomsx = 6;
  roomsy = 6;
  sectorsx = 5;
  sectorsy = 5;
  startx = 17;
  starty = 0;
  startce = 360+15;

function RoomToCE(room: integer): integer;
begin
  Result:=startce-1+room;
end;

function PosToSector(x,y: integer): integer;
begin
  Result:=(y div 3)*sectorsy + (x div 3);
end;

procedure SetLevelFieldElementToCE(room,fieldx,fieldy: integer; toce: boolean);
var
  ce: integer;
  i, x, y: integer;
begin
  ce:=RoomToCE(room);
  i:=PosToSector((fieldx-startx) mod (sectorsx*3),(fieldy-starty) mod (sectorsy*3));
  x:=(fieldx-startx) mod 3;
  y:=(fieldy-starty) mod 3;
  if toce then
    element_info[ce].change_page[i].target_content.e[x][y]:=level.field[fieldx][fieldy]
  else
    level.field[fieldx][fieldy]:=element_info[ce].change_page[i].target_content.e[x][y];
end;

procedure CEsAndField(ToCEs: Boolean);
var
  x2, y2, i: integer;
begin
  if ToCEs then Messi('field to ce', [level.fieldx, level.fieldy])
  else Messi('ce to field', [level.fieldx, level.fieldy]);
  if ToCEs then level.fieldx:=sectorsx*3+2
  else level.fieldx:=(sectorsx*3)+2+(roomsx*sectorsx*3);
  if ToCEs then level.fieldy:=sectorsy*3+2+3
  else level.fieldy:=(roomsy*sectorsy*3);
  for x2:=startx to startx+((sectorsx*3)*roomsx)-1 do
  for y2:=starty to starty+((sectorsy*3)*roomsy)-1 do
  begin
    i:=((y2-starty) div (sectorsy*3)) * roomsx + ((x2-startx) div (sectorsx*3)) + 1;
    if (i >= 1) and (i <= roomsx*roomsy) then SetLevelFieldElementToCE(i, x2, y2, ToCEs)
    else Mess('Calculation Error, ' + IntToStr(x2) + ', ' + IntToStr(y2) + ' = ' + IntToStr(i));
  end;
end;

begin
  if level.fieldx > sectorsx*3+3 then CEsAndField(true)
  else CEsAndField(false);
end.
If I didn't have RND CE Scripter, I would've never done this... just the thought about editing all that manually... yikes :shock:
BrownSky
Posts: 27
Joined: Mon Sep 24, 2018 4:04 am

Re: 2x2 world with some nice features

Post by BrownSky »

Hi Zomis

Do you still have this, or any of the other things that used to be hosted on your website? I get the idea that there was some kind of data loss event in the past, so apologies if I'm bringing up painful memories :-)

John
Post Reply