Giving light to the actor. - TADS3.1

I am doing some testing with my actor concerning giving light directly to the actor. Also, this relates to eventually making him a wizard who can ‘glow’. I have been unable to get the code working that is in the TADS manuals. Does anyone have some ideas on how to do this?

RonG

Can you elaborate on what you’re trying to do? Possibly post a short transcript of the effect in action?

You can set the brightness property on an actor to achieve a “glow” effect.

me: Person
	vocabWords = 'self'
	location = bedroom
	brightness = 10
;

But this effect is extremely subtle without support from the text - if that actor is in a DarkRoom, it will appear as though he is in an ordinary room.

This is a carryover from previous games I have written. Sometime in this story, I haven’t decided yet where or how this will happen, the actor will be given the opportunity to become a ‘wizard’. He will receive numerous powers that will make him immune to various hazards (but not all of them). One of the powers he will receive is his ability to provide light in any location by making himself ‘glow’. So, he must have control over this ‘glowing power’

I can’t tell you more right now because the flow of my story hasn’t been finalized. I hope this helps.

RonG

btw: You’re right about text messages to support this concept.

Here is some sample code that implements an unlockable glow ability.

[rant][code]
#charset “us-ascii”
#include <adv3.h>
#include <en_us.h>

versionInfo: GameID
name = ‘The Wizard's Bedroom’
byline = ‘by Ben Cressey’
version = ‘1’
;

gameMain: GameMainDef
initialPlayerChar = me
;

enum wizard, normal;

me: Person
vocabWords = ‘self’
location = bedroom
powerLevel = normal

makeWizard() {
	powerLevel = wizard;
}

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

;

bathroom: DarkRoom ‘bathroom’ ‘bathroom’
"Just another bathroom. "
west = bedroom
;

bedroom: Room ‘bedroom’ ‘bedroom’
"Just another bedroom. "
east = bathroom
;

  • ring: Wearable ‘wizard's ring’ ‘wizard's ring’
    "Faint runes are inscribed on the steel band. "

    dobjFor(Wear) {
    action() {
    inherited();
    "You feel magic coursing through your veins!
    You recall the words of the GLOW spell you learned as a child. ";
    gActor.makeWizard();
    }
    }

    dobjFor(Doff) {
    action() {
    "You shudder as the magic leaks from your body.
    The words of the GLOW spell fade from your mind. ";
    gActor.makeNormal();
    }
    }
    ;

DefineIAction(Glow);

VerbRule(Glow)
‘glow’
: GlowAction
verbPhrase = ‘glow/glowing’
;

modify GlowAction
execAction() {
if (gActor.powerLevel != wizard)
reportFailure('The magic no longer obeys you. ');
else {
"You shriek the words of the GLOW spell!
Your body begins to glow with a fiery red light! ";
gActor.brightness = 10;
}
}
;
[/code][/rant]

Transcript:

[rant]

[/rant]

Thanks once again for all of the help that all of you have given me in learning how to use TADS. I read a short time ago that TADS is a piece of ‘power’ software. I feel that is perfectly true. But, I am learning it and I’m beginning to understand what pieces of its code do what task. At any rate, There’s no intention on my part to give it up.

All of you will be hearing from me again.

RonG

I added all this code to my game and got no compile errors until I added the last ‘Modify GlowAction’ section. I checked everything numerous times but can’t find the problem. It’s another mystery to me. I can post the errors if you like. I also included the ‘enum’ code into the the main game section.

RonG

+ring: Wearable 'platinum ring' 'platinum ring'
 "Faint cryptic runes are inscribed around the band of the platinum ring."  
 
 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 the Wizard.');
    else{
     "You chant the GLOW spell!
      Your body begins to glow with a bright, radiating blue light!";  
      gActor.brightness=10;
      }
     }
; 

It’s “modify”, not “Modify”.

Thanks another million for the help.This undertaking has turned out to be quite an undertaking :exclamation: I’m slowly learning when and when not to use upper case or lower case letters. Also, I’m figuring out where and how to search for information in the TADS manuals. Success, no matter how minor can be quite stimulating.

RonG