intfiction.org

The Interactive Fiction Community Forum
It is currently Wed Dec 19, 2018 7:46 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Aug 13, 2018 11:47 am 
Offline

Joined: Wed Jul 25, 2018 8:55 am
Posts: 18
Edit: I figured it out. The original post below has the error. It was on the VerbRule of the TIAction line. Instead of:

VerbRule(TickleWith)('tickle' | 'stroke') dobjList ('with') singleDobj : TickleWithAction

I had to change it to

VerbRule(TickleWith)('tickle' | 'stroke') dobjList ('with') singleIobj : TickleWithAction

<sigh>

I've defined the following verbs:

Code:
DefineTAction(Tickle);
VerbRule(Tickle)('tickle' | 'stroke') dobjList : TickleAction
    verbPhrase = 'tickle/tickling (what)'
;

DefineTIAction(TickleWith);
VerbRule(TickleWith)('tickle' | 'stroke') dobjList ('with') singleDobj : TickleWithAction
    verbPhrase = 'tickle/tickling (what) (with what)'
;

modify Thing
    dobjFor(Tickle){
        preCond = [objHeld]
        verify(){ illogical(cannotTickleMsg); }
    }
    dobjFor(TickleWith){
        preCond = [objHeld]
        verify() { illogical(cannotTickleMsg); }
    }
    iobjFor(TickleWith){
        preCond = [objHeld]         
        verify(){ illogical(cannotTickleWithMsg); }
    }
    cannotTickleMsg = '{You/he} cannot tickle {that dobj/him}. '
    cannotTickleWithMsg = '{You/he} cannot tickle anything with {that iobj/him}. '
    defaultTickleMsg = 'Nothing obvious happens. '
    defaultTickleWithMsg = 'Nothing obvious happens. '
;


Next, I've defined a skeletal game where I'm just using the verb as is

Code:
startRoom: Room 'start room' 'start room' "Start room. ";
+me: Actor;
++feather: Thing 'feather' 'feather' "A large feather. ";
+npc: Actor 'npc' 'npc' "Npc ";


When I run the game and invoke the tickle verb, it works fine:

Start room
Start room.

The npc is standing here.

>tickle npc
You cannot tickle that.

>

However, if I try to 'tickle with' (i.e., >tickle npc with feather) the code crashes in file action.t

Code:
    //method called on line 4145
    resolveNouns(issuingActor, targetActor, results)
    {
        [...]
       
        //error is here on line 4246. objMatch1 is nil (error: 'nil object reference)
        self.(objList1) = objMatch1.resolveNouns(
            self.(getResolver1)(issuingActor, targetActor, true), results);


What am I missing?

Thanks


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group