MultiLoc not working

HELP!

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
;

MultiLoc, Enterable -> deepChasm ‘rope bridge’ ‘rope bridge’
desc()
{
//cls();
//"";
}
locationList = [northEdge, southEdge]
;

deepChasm : FloorlessRoom ‘deep chasm’
desc()
{
//cls();
//"";
if(me.isIn(deepChasm)) me.moveIntoForTravel(dummyBridge);
}
north = northEdge
south = southEdge
;

  • dummyBridge : Platform ‘rope bridge’ ‘bridge’
    ;[/code]

What do you need dummyBridge for?

Edit:
You probably can do this with MultiFaceted:

[code]northOfChasm: Room {
‘North of Chasm’
}

roomB: MultiFaceted {
locationList = [northOfChasm, southOfChasm];
instanceObject: Platform {
‘rope bridge’ ‘rope bridge’
north = northOfChasm;
south = southOfChasm;
}
}

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”.

I get a runtime error - invalid type for intrinsic function argument

deepChasm.addInstance(northEdge)+ 20
{anonfn:2fdc}(northEdge)+ 19

deepChasm.initializeLocation()+ 23
{anonfn:2fde}(deepChasm)+ 18
forEachInstance(MultiInstance, obj#2fde (AnonFuncPtr))+ 1c
adv3LibPreinit.execute()+ 92
adv3LibPreinit._execute()+ 54
{anonfn:1151}(adv3LibPreinit)+ 18
forEachInstance(PreinitObject, obj#1151 (AnonFuncPtr))+ 1c
PreinitObject.classExec()+ 55
_preinit()+ 2a
initAfterLoad()+ 25
_mainCommon([‘tin_dbg.t3’], nil)+ 10
_main[‘tin_dbg.t3’]

[code]northEdge : Room ‘north edge of chasm’
desc()
{
cls();
”;
}
south = deepChasm
;

  • me: Actor
    ;

southEdge : Room ‘south edge of chasm’
desc()
{
cls();
”;
}
north = deepChasm
;

deepChasm : MultiFaceted
desc()
{
cls();
”;
}
locationList = [northEdge, southEdge];
ropeBridge : Platform
{
‘rope bridge’ ‘rope bridge’
north = northEdge;
south = southEdge;
}
;[/code]

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.

It would be:

deepChasm : MultiFaceted
    desc()
    {
        cls();
        "<center><img src='chasm2.png'></center>";
    }                                                                                                                         
    locationList = [northEdge, southEdge]
    instanceObject: Platform
    {
        'rope bridge' 'rope bridge'
        north = northEdge;
        south = southEdge;
    }
;

This would produce transcript as follows:

  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.

>

I thought what you wanted is that the player should not be able to go south unless standing on the bridge first.

If not, you don’t need any of that stuff; you’re over-thinking the problem. Simply use a normal room like for everything else.

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;
}
;

  • dummyChasm : Fixture ‘deep chasm’ ‘chasm’
    desc()
    {
    cls();
    ”;
    }
    ;[/code]