Author Topic: ProgramControl(), PlayerControl() and gProgramControl values  (Read 2915 times)

0 Members and 1 Guest are viewing this topic.

Offline gumby

ProgramControl(), PlayerControl() and gProgramControl values
« on: December 22, 2012, 09:25:27 AM »
Does anyone know why the ProgramControl() and PlayerControl() procedures in Main.sc do not set the value of gProgramControl?  I don't get it, shouldn't they look like this:

Code: [Select]
(procedure public (ProgramControl)
(User:
canControl(FALSE)
canInput(FALSE)
)
(send gEgo:setMotion(NULL))
       = gProgramControl TRUE          // shouldn't this line be added here?
)

(procedure public (PlayerControl)
(User:
canControl(TRUE)
canInput(TRUE)
)
(send gEgo:setMotion(NULL))
        = gProgramControl FALSE        //   and this here too?
)

* Bug fixed as of template v1.1 found on the tools page.
« Last Edit: December 22, 2012, 02:32:00 PM by Cloudee1 »


In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Cloudee1

Re: ProgramControl(), PlayerControl() and gProgramControl values
« Reply #1 on: December 22, 2012, 12:31:17 PM »
Yes, I have noticed that before also. Even worse, if you look into it a little further, in the doit method of the main script, program control is actually checked and controlled by the gProgramControl variable. So in essence as it is written, playercontrol() in a roomscript doesn't do anything because the mains doit method only checks the gProgramControl variable. I can't remember though what the results were when I tried removing the bit about the doit method and just using the procedures to set and reset the variables.

I added a couple of extra variables in there too when I wrote black cauldron. Pausing the timers and whatnot to prevent death from dehydration and starvation or warnings during cut scenes. Likewise to prevent opening inventory during certain times too. But I concur, those procedures need to change the gProgramControl variable, here is the code straight out of BC. You may notice that I also removed the call to ego that stops his motion any time one of these two procedures are called. I wanted to control that in each instance of using the procedure, not just halt him automatically, sometimes I may not want him to stop walking.

Code: [Select]
(procedure public (ProgramControl)
(User:canControl(FALSE) canInput(FALSE))
(send gEgo:setMotion(NULL))
= gProgramControl TRUE
= canTab FALSE
= pauseTimers TRUE
)
(procedure public (PlayerControl)
(User:canControl(TRUE) canInput(FALSE)) // point and click, no text parsing
(send gEgo:setMotion(NULL))
= gProgramControl FALSE
= canTab TRUE
= pauseTimers FALSE
)
« Last Edit: December 22, 2012, 01:06:39 PM by Cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: ProgramControl(), PlayerControl() and gProgramControl values
« Reply #2 on: December 22, 2012, 01:16:51 PM »
That's what I figured.  I'm okay with games manually setting the gProgramControl variable (like in the doit() in the main script), but it sure seems like if you are going to call one of those procedures it should definitely set it for you.

I think this probably should be classified as a template bug. 
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: ProgramControl(), PlayerControl() and gProgramControl values
« Reply #3 on: December 22, 2012, 01:18:41 PM »
Do we have a list of the template bugs that have not been fixed?
KQII Remake Pic

Offline Cloudee1

Re: ProgramControl(), PlayerControl() and gProgramControl values
« Reply #4 on: December 22, 2012, 01:23:21 PM »
Nothing has yet been fixed in the templates. I'm not sure why I haven't done that since I have a category just for templates in the tools page. I guess I should go ahead and make a fresh template.



Edit: Ok, there is a new Parser Template on the tools page. I think I have fixed all the bugs I currently know about, including this one. I have also gone ahead and updated the point and click template on  the tools page. Current updated versions are now 1.1
« Last Edit: December 22, 2012, 07:51:30 PM by Cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.125 seconds with 23 queries.