intfiction.org

The Interactive Fiction Community Forum
It is currently Thu May 23, 2013 8:36 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Fri Mar 09, 2012 10:36 am 
Offline

Joined: Sun Nov 06, 2011 12:17 pm
Posts: 156
Location: Toledo, Ohio, USA
Some time back I started a post titled 'Giving light to the actor'. Bcressy furnished me with some code
for this and it worked great. It involved a magic ring which when worn by the actor turned him into a powerful wizard. I've since redone all of my game code and now this wizard code doesn't work. I've worked on it for a few days but can't find the answer to all the problems this piece of code is causing. I could use some help from anyone who'd care to give it.

RonG


Top
 Profile Send private message  
 
PostPosted: Fri Mar 09, 2012 11:32 am 
Offline

Joined: Tue Apr 27, 2010 1:02 pm
Posts: 797
Can you post the compiler error you're getting, and the code around the line numbers it refers to?


Top
 Profile Send private message  
 
PostPosted: Fri Mar 09, 2012 2:50 pm 
Offline

Joined: Sun Nov 06, 2011 12:17 pm
Posts: 156
Location: Toledo, Ohio, USA
I've removed some suspicious code from the end of my game. Next I'll re-insert all of the 'wizard' code.
Will give it a try then send you the results and the errors.

RonG


Top
 Profile Send private message  
 
PostPosted: Fri Mar 09, 2012 4:16 pm 
Offline

Joined: Sun Nov 06, 2011 12:17 pm
Posts: 156
Location: Toledo, Ohio, USA
Here is the entire section containing any wizard coding. The error I now get is under the 'modify glowAction if-else section'. The first 'if' statement about power level gives me the following error
'power level is undefined but appears to be a property name'


Code:
/*  Add wizard's ring to beach.  **********************************************/

ring: Wearable 'platinum ring' 'platinum ring'
"Faint cryptic runes are inscribed around the band of the platinum ring. "
   location=beach
   dobjFor(Wear){
      action(){
      inherited();
      "You feel a strange magical power coursing through your body! And, you
       hear the faint echo of the word GLOW surrounding you. ";
      gActor.makeWizard();
     }
    }

   dobjFor(Doff){
      action(){
      inherited();
      "You shudder as the power of the ring and the magic of the GLOW chant
       leave you. ";
      gActor.makeNormal();
     }
    }
;

   DefineIAction(Glow);
      VerbRule(Glow)
      'glow'
     :GlowAction
     VerbPhrase='glow/glowing'
;
   
   modify GlowAction
      execAction(){
      if(gActor.powerLevel!=wizard){
        reportFailure('At this time, you do not have the power of a wizard.');
     }
      else if(gActor.brightness!=0){
        "The blue, radiant light quickly fades from your body. ";
         gActor.brightness=0;
     }         
      else{
        "You chant the GLOW spell!
         Your body begins to glow with a bright, radiating blue light! ";
         gActor.brightness=10;     
     }
    }
;

/* Make 'wizard' constant.  ***************************************************/

enum wizard,normal;

/*  Show Actor/Player.  *******************************************************/

+me: BagOfHolding, Actor
    vocabWords = 'Tom Thomas Tom/Thomas/Leavens'   
    desc
   {
       "You are Thomas Leavens; also known as Dr. Tom by all your friends and
        associates. Your ex-wife calls you names that could never be repeated!
        Aside from your underwear an socks, you are wearing your normal field
        attire. ";
   }
   
bulk = 10

/*  Make/Unmake wizard.  ******************************************************/

 makeWizard(){
    powerLevel=wizard;
}
 makeNormal(){
    powerLevel=normal;
    brightness=0;
}


Top
 Profile Send private message  
 
PostPosted: Fri Mar 09, 2012 4:46 pm 
Offline

Joined: Tue Apr 27, 2010 1:02 pm
Posts: 797
You need to add the powerLevel property to the me Actor:

Code:
powerLevel = normal


Somewhere before the semicolon that ends the object definition.


Top
 Profile Send private message  
 
PostPosted: Fri Mar 09, 2012 6:41 pm 
Offline

Joined: Sun Nov 06, 2011 12:17 pm
Posts: 156
Location: Toledo, Ohio, USA
Thanks for the help. That did it. Don't know how I managed to miss that. Should have paid closer attention. I'm finally ready to start adding rooms and other objects.

RonG


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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