Community
SCI Programming => SCI Syntax Help => Topic started by: gumby 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:
(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.
-
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.
(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
)
-
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.
-
Do we have a list of the template bugs that have not been fixed?
-
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