Dev:SDK/Core - House Exploration

From Slavemaker Wiki
Jump to: navigation, search
<<first <prev SDK/Core - House Exploration next> last>>


SlaveMaker 3 SDK House Exploration

To explore a house or other place

Visiting Homes[edit]

Core functions[edit]

ShowCustomHouse
Show the custom house and set the text on the Take A Walk screen
function ShowCustomHouse(clabel:String, xpos:Number, ypos:Number,

hint:String)

clabel - the label of the button that appears on the screen
the text is left aligned, green with a black border, and is bold. The

bold is always applied as is the black border. You can change the colour or other attributes using html tags

xpos, ypos - the position on the take a walk screen that the label is to

be shown, 0,0 is the upper left, 448,336 is the bottom right.

hint - text shown when the place is moused over
eg
_root.ShowCustomHouse("Arena", 100, 150, "Martial arts arena");
HideCustomHouse
Hide the custom house
function HideCustomHouse()

Slave Girl Override function[edit]

DoWalkHouse
Called when you click on a house in the Take a Walk screen.
function DoWalkHouse(house:Number) : Boolean
house - the house visited.
-1 = custom house, see Home.HouseType for other values (Core -

Variables.rtf)

return true to handle the walk, false to let the game do the default.

There is no default for the custom house -1

Exploring Homes Functions[edit]

All the following functions are present in a root MovieClip HouseEvents

eg

_root.HouseEvents.ShowCurrentFloor();
InitialiseExploration
Call this function to start an exploration
function InitialiseExploration(desc:String, desc2:String)
desc - Short description of the house
desc2 - a short description of the initial room you start in
both parameters are optional
AddRoomAndPosition
This function adds a room to the map
function AddRoomAndPosition(type:Number, desc:String, eventno:Number,

xpos:Number, ypos:Number, rwidth:Number, rheight:Number, rrotate:Number, explored:Boolean)

type - type of room
0 = plain room
1 = corridor. no ends
1.1 = corridor, dead end at top
1.2 = corridor, dead end at bottom
2 = room, rough walls
3 = corridor, rough walls
3.1 = corridor, rough walls, dead end at top
3.2 = corridor, rough walls, dead end at bottom
Note more are coming, stairs, trap doors...
desc - short description of the area
eventno - event via DoNextEvent called when you enter the room
xpos - x position the room is drawn on screen
ypos - y position of room
rwidth - width of room
rheight - hright of room
rrotate - rotation of the room, careful positions are awkward, but game

automatically handles 90 properly

explored - true and it is visible
AddDoorAndPosition
Position a door on the map, generally use the next function, but use this

to placve a door at an arbitrary location or add hidden doors, just to connect rooms logically. Note room1 and room2 do not have to be adjacent

function AddDoorAndPosition(room1:Number, room2:Number, hidden:Boolean,

xpos:Number, ypos:Number, rwidth:Number, rheight:Number, rrotate:Number, locked:Boolean, eventno:Number)

room1 - room the door connects from
room2 - room the door connects to
hidden - true and the door is invisible
xpos - x position of the door
ypos - y position of the door
rwidth - width of the door (default 25)
rheight - hieght of the door (default 14)
rrotate - rotation of the door, 90 is handled well, others can cause

strange positioning

locked - the door is locked preventing passage
eventno - event called when you pass through the door
AddDoorToRoom
Position a door, automatically places on the map, connecting to room 1

and room 2. Note room1 and room2 do not have to be adjacent

function AddDoorToRoom(room1:Number, room2:Number, dpos:Number,

rwidth:Number, rheight:Number, eventno:Number, locked:Boolean)

room1 - room the door connects from
room2 - room the door connects to
dpos - where to door is on the wall
  1. top left of room
  2. top center
  3. top right
  4. top of rightmost wall
  5. center of right wall
  6. bottom of right wall
  7. right of bottom wall
  8. center of botton wall
  9. left of bottom wall
  10. bottom of left wall
  11. center of left wall
  12. top of left wall
xpos - x position of the door
ypos - y position of the door
rwidth - width of the door (default 25)
rheight - hieght of the door (default 14)
locked - the door is locked preventing passage
eventno - event called when you pass through the door
ShowCurrentFloor
Show the exploration map and shows the map/view button
function ShowCurrentFloor()
HideCurrentFloor
Hide the map only
function HideCurrentFloor()
HideCurrentFloorMap
Completely hide the map and button
function HideCurrentFloorMap()
GetCurrentRoomDescription
Get the description of the current room
function GetCurrentRoomDescription() : String

returns the description of the current room

IsCurrentRoomExplored
function IsCurrentRoomExplored() : Boolean
returns true if you have not been in the current room before
IsRoomExplored
function IsRoomExplored(room:Number) : Boolean
return true if the specified room has been explored
SetRoomExplored
function SetRoomExplored(room:Number)
Makes the specified room explored
EnterRoom
function EnterRoom(room:Number)
enters the room, only use this in unusual situations, say it you want to

teleport...

LockDoor
function LockDoor(room1:Number, room2:Number)
Lock the door from room1 to room2
UnlockDoor
function UnlockDoor(room1:Number, room2:Number)
Unlock the door from room1 to room2
GetCurrentRoomType
function GetCurrentRoomType() : Number
returns the type of the room, see AddDoorAndPosition for values
SetCurrentRoom
function SetCurrentRoom(room:Number)
Sets the starting room, or teleports you to the specified room
eg
        _root.HouseEvents.InitialiseExploration("Expensive Apartment", "Hallway");
        _root.HouseEvents.AddRoomAndPosition(0, "Living Area", 423, 90, 180, 200,
150);
        _root.HouseEvents.AddRoomAndPosition(0, "Kitchen", 424, 90, 80, 150, 100);
        _root.HouseEvents.AddRoomAndPosition(0, "Bath Room", 0, 240, 80, 50, 100);
        _root.HouseEvents.AddRoomAndPosition(0, "Bed Room", 436, 290, 205, 100,
125,0);
        _root.HouseEvents.AddRoomAndPosition(0, "Bed Room", 0, 290, 80, 100, 125);
        _root.HouseEvents.AddDoorToRoom(0, 1, 2);
        _root.HouseEvents.AddDoorToRoom(1, 2, 5);
        _root.HouseEvents.AddDoorToRoom(2, 4, 5);
        _root.HouseEvents.AddDoorToRoom(0, 3, 5);
        _root.HouseEvents.AddDoorToRoom(0, 4, 4, undefined, undefined, undefined,
true);
        _root.HouseEvents.AddDoorToRoom(0, -1, 8, 50);
        _root.HouseEvents.ShowCurrentFloor();
Note room numbers are sequential numbers 0 for the first room added, 1

for the next.

Exploring[edit]

To start initialise as above then show the map

_root.HouseEvents.ShowCurrentFloor();

When you handle a room events do something like

eg

if (_root.HouseEvents.IsCurrentRoomExplored()) _root.SetText("The master
bedroom is dark and filled with passion."
);
else _root.SetText(SlaveName + " walks into the master bedroom and is
almost shocked by the intense feelings of passion, and she almost
staggers. She is reluctant to looks any closer, but feels an obsessive
passion radiating from the room."
);

Remember the hide/show functions to suppress the map if desired.

Finishing[edit]

To finish exploring, do event 6999

eg

_root.DoEvent(6999);


<<first <prev SDK/Core - House Exploration next> last>>