I have a bruise on my forehead from causing serious damage to my keyboard.
3 rooms, A, B, C, A and C are two ends of room B which is a chasm/gap, defining B as a MultiLoc room is fine but trying to create a way to cross from A to C ie: a bridge, is proving difficult.
The conditions should be that if the pc goes south from room A he steps into the chasm, same with room C, the pc must first stand on the bridge and then go south/north, then get off the bridge in the other room.
The code below works after a fashion but is hardly ideal.
[code]northEdge : Room ‘north edge of chasm’
desc()
{
//cls();
//"";
}
south = deepChasm
;
me: Actor
;
southEdge : Room ‘south edge of chasm’
desc()
{
//cls();
//"";
}
north = deepChasm
;
southOfChasm: Room {
‘South of Chasm’
}[/code]
See adv3/objects.t for more information.
Of course, in your game, it would be a good idea to define verb handlers so that the player can “cross the bridge”, “enter the bridge” and “climb the bridge”.
That is not the code I posted. MultiFaceted doesn’t need a desc property. All of that goes into the instanceObject, which you removed. It is a property containing the object that will appear in-game. desc and everything else, including verb handlers, goes into that.
You should really read the documentation in adv3/objects.t.
North edge of chasm
You see a rope bridge here.
>stand on bridge
Okay, you're now standing on the rope bridge.
>s
South edge of chasm
You see a rope bridge here.
>
I’m not sure, if this is the intention - you couldn’t go south until standing on the bridge explicitly. I would probably do something like that (no MultiLoc/MultiFaceted and it’s only one end and center of the bridge, other end would be similar.):
northEdge: Room 'north edge of chasm'
"You are standing on the north edge of the chasm"
south = northBridgeCon
;
+ me: Actor
;
+ northBridgeEnd: Platform 'north bridge end' 'north bridge end'
;
++ northBridgeCon: Passage -> deepChasmBridgeCon
connectorStagingLocation = northBridgeEnd
;
deepChasm: FloorlessRoom 'deep chasm'
"You are on the bridge over the deep chasm."
north = deepChasmBridgeCon
;
+deepChasmBridge: Platform 'rope bridge' 'rope bridge'
out = nil
exitDestination = nil
;
++ deepChasmBridgeCon: Passage -> northBridgeCon
;
North edge of chasm
You are standing on the north edge of the chasm
You see a north bridge end here.
>s
(first standing on the north bridge end)
Deep chasm (standing on the rope bridge)
You are on the bridge over the deep chasm.
You see a rope bridge here.
>n
North edge of chasm (standing on the north bridge end)
You are standing on the north edge of the chasm
You see a north bridge end here.
>out
(off of the north bridge end)
Okay, you're no longer on the north bridge end.
>
Thank you tomasb, you pointed me in the right direction. The code now works as it should.
[code]northEdge : Room ‘north edge of chasm’
desc()
{
cls();
“”;
}
south = deepChasm
;
me: Actor
;
southEdge : Room ‘south edge of chasm’
desc()
{
cls();
“”;
}
north = deepChasm
;
deepChasm : Room ‘deep chasm’ ‘deep chasm’
desc()
{
cls();
"
\bYou take a short step forward and proceed to plummet several thousand feet downward into the depths of the chasm. ";
finishGameMsg(ftDeath,’ ');
}
;
middleChasm : MultiFaceted
locationList = [northEdge, southEdge]
instanceObject: Platform
{
‘rope bridge’ ‘rope bridge’
desc()
{
cls();
“”;
}
north = northEdge;
south = southEdge;
east = deepChasm;
west = deepChasm;
}
;