intfiction.org

The Interactive Fiction Community Forum
It is currently Thu Oct 19, 2017 8:22 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Aug 20, 2017 9:15 pm 
Offline

Joined: Wed Mar 15, 2017 6:35 pm
Posts: 16
Didn't think I'd hit another impasse this soon, but here we are. This time my question involves having lists of objects. Specifically, lists of objects that are ment to be like states. Think buffs and rebuffs like poison. I was originally using actor state and curState, but because of their specific uses, I decided to go my own route. During this move to a different system, one of my functionalities broke. Particularly this piece of code which is meant to constrain the player to only interacting with the object causing the inhibition.

Code:
    restrainingObject = nil
    /*using this method*/
    assignRestrainingObject(newObject)
    {
        restrainingObject = newObject;
    }
    checkMoveViaPath(obj, dest, op)
    {
        /*
         *   determines if an item is in reach (i.e. only the restraining
         *   object) and restricts movement.
         */
        if (dest != restrainingObject)
        {
            return new CheckStatusFailure(
                'You cannot do that right now;
                you are restrained by <<isRestrained.restrainingObject.theName()>>.');
        }
        else return checkStatusSuccess;
    }
    beforeAction()
    {
        inherited;
        if (gDobj != restrainingObject && gActionIs(Examine)){
            "<<gDobj.notCloseToExamineMsg>>";
            exit;
        }
    }


I'm not really sure how to fix it. I understand this code must have worked only because of the functionality of curState, but I'm not sure what that functionality is, why it's used, and how to restore it. Could I get some help on this? note: my states still use the ActorState class if that helps any.


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