Skip to content

Commit

Permalink
fix(house): read notes
Browse files Browse the repository at this point in the history
- added some teleport portal examples that should be fully working (barrows, varrock/ge, lunar isle).

This might cause issues with the previous version of it if you had a layout saved. either reset it or reset manually your nexus and portal chamber rooms, sorry.
  • Loading branch information
Torwent committed Dec 22, 2024
1 parent 90f8182 commit 53d024f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 29 deletions.
7 changes: 4 additions & 3 deletions optional/handlers/house/house.simba
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function THouseHandler.Position(): TPoint; forward;

procedure THouseHandler._SetupTeleport(obj: EHouseObject; coordinate: TPoint; rotation: Int32; teleport: EHouseTeleport);
begin
WriteLn teleport;
if Self.Teleports[teleport].Coordinates <> [] then
begin
Self.Teleports[teleport].Coordinates += coordinate;
Expand Down Expand Up @@ -130,6 +131,7 @@ begin
coordinate := obj.RotateOffset(Self.Loader.SIZE, room.Rotation);
coordinate += idx * Self.Loader.SIZE;

WriteLn Self.Loader.TeleportRooms[idx.Y,idx.X];
case obj of
EHouseObject.LEFT_PORTAL, EHouseObject.LEFT_AMULET:
Self._SetupTeleport(obj, coordinate, room.Rotation,
Expand Down Expand Up @@ -858,10 +860,9 @@ begin
combobox.Create(panel, 'Left portal:', 'Does this room have a portal to the left of it''s entrance?', [0,0],[166,50], True);
teleports := [
'None', 'Arceuus Library', 'Draynor Manor', 'Battlefront', 'Varrock',
'Grand Exchange', 'Mind Altar', 'Lumbridge', 'Falador ',
'Salve Graveyard', 'Camelot', 'Seers'' Village',
'Mind Altar', 'Lumbridge', 'Falador ', 'Salve Graveyard', 'Camelot',
'Fenkenstrain''s Castle', 'Kourend Castle', 'East Ardougne',
'Civitas illa Fortis', 'Watchtower', 'Yanille', 'Senntisten (Digsite)',
'Civitas illa Fortis', 'Watchtower', 'Senntisten (Digsite)',
'West Ardougne', 'Marim (Ape Atoll)', 'Harmony Island ',
'Kharyrll (Canifis)', 'Moonclan', 'Cemetery', 'Waterbirth Island',
'Barrows', 'Carrallanger (Graveyard of Shadows)', 'Fishing Guild',
Expand Down
54 changes: 30 additions & 24 deletions optional/handlers/house/houseutils.simba
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ EHouseObject = (
## type EHouseTeleport
```pascal
EHouseTeleport = (
EMPTY, ARCEUUS_LIBRARY, DRAYNOR_MANOR, BATTLEFRONT, VARROCK, GRAND_EXCHANGE,
MIND_ALTAR, LUMBRIDGE, FALADOR, SALVE_GRAVEYARD, CAMELOT, SEERS_VILLAGE,
EMPTY, ARCEUUS_LIBRARY, DRAYNOR_MANOR, BATTLEFRONT, VARROCK,
MIND_ALTAR, LUMBRIDGE, FALADOR, SALVE_GRAVEYARD, CAMELOT,
FENKENSTRAINS_CASTLE, KOUREND_CASTLE, EAST_ARDOUGNE, CIVITAS_ILLA_FORTIS,
WATCHTOWER, YANILLE, SENNTISTEN, WEST_ARDOUGNE, MARIM, HARMONY_ISLAND,
WATCHTOWER, SENNTISTEN, WEST_ARDOUGNE, MARIM, HARMONY_ISLAND,
KHARYRLL, MOONCLAN, CEMETERY, WATERBIRTH_ISLAND, BARROWS, CARRALLANGER,
FISHING_GUILD, CATHERBY, ANNAKARL, APE_ATOLL_DUNGEON, GHORROCK,
TROLL_STRONGHOLD, WEISS,
Expand All @@ -112,10 +112,10 @@ EHouseTeleport = (
```
*)
EHouseTeleport = (
EMPTY, ARCEUUS_LIBRARY, DRAYNOR_MANOR, BATTLEFRONT, VARROCK, GRAND_EXCHANGE,
MIND_ALTAR, LUMBRIDGE, FALADOR, SALVE_GRAVEYARD, CAMELOT, SEERS_VILLAGE,
EMPTY, ARCEUUS_LIBRARY, DRAYNOR_MANOR, BATTLEFRONT, VARROCK,
MIND_ALTAR, LUMBRIDGE, FALADOR, SALVE_GRAVEYARD, CAMELOT,
FENKENSTRAINS_CASTLE, KOUREND_CASTLE, EAST_ARDOUGNE, CIVITAS_ILLA_FORTIS,
WATCHTOWER, YANILLE, SENNTISTEN, WEST_ARDOUGNE, MARIM, HARMONY_ISLAND,
WATCHTOWER, SENNTISTEN, WEST_ARDOUGNE, MARIM, HARMONY_ISLAND,
KHARYRLL, MOONCLAN, CEMETERY, WATERBIRTH_ISLAND, BARROWS, CARRALLANGER,
FISHING_GUILD, CATHERBY, ANNAKARL, APE_ATOLL_DUNGEON, GHORROCK,
TROLL_STRONGHOLD, WEISS,
Expand Down Expand Up @@ -164,10 +164,12 @@ begin
EHouseObject.EXIT: Result := [3,1,8];
EHouseObject.PRAYER_ALTAR: Result := [2,1,4];

EHouseObject.LEFT_PORTAL, EHouseObject.RIGHT_PORTAL: Result := [0.6,1.7,7];
EHouseObject.MIDDLE_PORTAL: Result := [1.7,0.6,7];

EHouseObject.FAIRY_RING: Result := [2,2,1];
EHouseObject.OBELISK: Result := [1,1,6];
EHouseObject.SPIRIT_TREE, EHouseObject.SPIRITUAL_FAIRY_TREE:
Result := [1.7,1.7,6];
EHouseObject.SPIRIT_TREE, EHouseObject.SPIRITUAL_FAIRY_TREE: Result := [1.7,1.7,6];

EHouseObject.ANCIENT_ALTAR..EHouseObject.OCCULT_ALTAR: Result := [2,3,5];

Expand Down Expand Up @@ -196,33 +198,33 @@ begin
//room box := [0,0,31,31]

//Feel free to contribute coordinates.
//Also these are quite deorganized atm. Sorry.
case Self of
EHouseObject.EXIT, EHouseObject.PRAYER_ALTAR:
Result := Point(16,16); //todo: aprox placeholder...
EHouseObject.EXIT, EHouseObject.PRAYER_ALTAR: Result := Point(16,16); //todo: aprox placeholder...

EHouseObject.SPIRIT_TREE..EHouseObject.SPIRITUAL_FAIRY_TREE: Result := Point(16, 14);

EHouseObject.NEXUS: Result := Point(14,16);

EHouseObject.ANCIENT_ALTAR..EHouseObject.OCCULT_ALTAR:
Result := Point(size - size div 8, size div 2); //todo: aprox placeholder...
EHouseObject.LEFT_PORTAL: Result := Point(0,16);
EHouseObject.MIDDLE_PORTAL: Result := Point(15,1);
EHouseObject.RIGHT_PORTAL: Result := Point(28,16);

EHouseObject.REPAIR_STAND: Result := Point(size-size div 8, size div 2); //todo: aprox placeholder...
EHouseObject.ANCIENT_ALTAR..EHouseObject.OCCULT_ALTAR: Result := Point(26, 16); //todo: aprox placeholder...

EHouseObject.SERVANT_BAG: Result := Point(size-size div 8, size-size div 8); //todo: aprox placeholder...
EHouseObject.REPAIR_STAND: Result := Point(28, 16); //todo: aprox placeholder...

EHouseObject.GLORY, EHouseObject.MYTH_CAPE:
Result := Point(8, size); //todo: aprox placeholder...
EHouseObject.SERVANT_BAG: Result := Point(24,24); //todo: aprox placeholder...

EHouseObject.OAK_LECTERN..EHouseObject.MARBLE_LECTERN:
Result := Point(size-8, size-8); //todo: aprox placeholder...
EHouseObject.GLORY, EHouseObject.MYTH_CAPE: Result := Point(8, size); //todo: aprox placeholder...

EHouseObject.RESTORATION_POOL..EHouseObject.ORNATE_POOL: Result := Point(size-6,4);
EHouseObject.OAK_LECTERN..EHouseObject.MARBLE_LECTERN: Result := Point(size-8, size-8); //todo: aprox placeholder...

EHouseObject.BASIC_JEWELLERY_BOX..EHouseObject.ORNATE_JEWELLERY_BOX:
Result := Point(size-8,size-6); //todo: aprox placeholder...
EHouseObject.RESTORATION_POOL..EHouseObject.ORNATE_POOL: Result := Point(26,4);

EHouseObject.BASIC_JEWELLERY_BOX..EHouseObject.ORNATE_JEWELLERY_BOX: Result := Point(24,24);

EHouseObject.CAPE_HANGER: Result := Point(size-8, 6); //todo: aprox placeholder...
EHouseObject.CAPE_HANGER: Result := Point(24, 6); //todo: aprox placeholder...
end;
end;

Expand Down Expand Up @@ -422,15 +424,19 @@ end;
function EHouseTeleport.GetUpText(): TStringArray;
begin
case Self of
EHouseTeleport.VARROCK: Result := ['Varrock'];
EHouseTeleport.VARROCK: Result := ['Varrock', 'Grand Exchange', 'Portal'];
EHouseTeleport.BARROWS: Result := ['Barrows', 'Portal'];
EHouseTeleport.MOONCLAN: Result := ['Lunar', 'Isle', 'Portal'];
//TODO... same as `EHouseObject.GetUpText()` but for each portal uptext lol
end;
end;

function EHouseTeleport.GetFinder(): TRSObjectFinder;
begin
case Self of
EHouseTeleport.VARROCK: Result.Colors += CTS2(0,0,0,0);
EHouseTeleport.VARROCK: Result.Colors += CTS2(5547482, 24, 0.05, 1.14);
EHouseTeleport.BARROWS: Result.Colors += CTS2(13658056, 34, 0.18, 1.28);
EHouseTeleport.MOONCLAN: Result.Colors += CTS2(12746685, 29, 0.23, 1.00);
//TODO... same as `EHouseObject.GetFinder()` but for each portal color lol
end;
end;
Expand Down
16 changes: 14 additions & 2 deletions templates/househandler_example.simba
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,22 @@ begin
//Do stuff with your house:
House.Objects[EHouseObject.ORNATE_POOL].WalkClick();
House.Objects[EHouseObject.NEXUS].WalkClick();
Debug(House.Objects[EHouseObject.SPIRITUAL_FAIRY_TREE]);

while True do
Debug(House.Objects[EHouseObject.SPIRITUAL_FAIRY_TREE]);

//Using teleports that can be in multiple positions (portals and nexus amulets)
House.Teleports[EHouseTeleport.BARROWS].WalkClick();
House.Teleports[EHouseTeleport.GRAND_EXCHANGE].WalkClick();
Debug(House.Teleports[EHouseTeleport.WATERBIRTH_ISLAND]);

while True do
Debug(House.Teleports[EHouseTeleport.WATERBIRTH_ISLAND]);

House.Teleports[EHouseTeleport.VARROCK].WalkSelectOption(['Grand', 'Exchange']);

while True do
Debug(House.Teleports[EHouseTeleport.BARROWS]);

while True do
Debug(House.Teleports[EHouseTeleport.MOONCLAN]);
end.

0 comments on commit 53d024f

Please sign in to comment.