Same Olde Problem

For problems with creating games or for reporting bugs of the Tool.
Post Reply
StarLite
An Adventure Creator
Posts: 446
Joined: 02 Jul 2005, 18:32
Contact:

Same Olde Problem

Post: # 73667Post StarLite
29 May 2009, 02:06

Hey everyone, I'm back with an olde problem I had before. I can't understand what I do to this script to stop it from working. At one point it worked and now it won't. Could someone tell me what I am doing wrong please.

These three puzzles are stopping me from advancing in this game. If I can't get by these puzzles I'm seriously thinking of chucking the whole game. Ok here's the problem

I have this box with 7 buttons you have to push which scrolls through 3 letters. You have to spell out the word CROATAN. If you get the word wrong, a voice says "Try Again" and then all the letters reset to blank and you start over again. If you get it right, you are supposed go to the next room which is a keypad puzzle.

Well it won't let me go to the next room even when I get the word right. The problem seems to be with this script, but I can't figure out where.

I took this script from the safe script in the Basic Tutorial 2. What am I doing wrong here. Thank you

Code: Select all

setnum (codecorrect ; 0)
if_num (code1 ; 2)
 if_num (code2 ; 3)
  if_num (code3 ; 2)
   if_num (code4 ; 3)
    if_num (code5 ; 2)
     if_num (code6 ; 3)
      if_num (code7 ; 1)
       setnum (codecorrect ; 1)

if_num (codecorrect ; 1)
{
loadroom(box 2)
setfocus(none)
playsound (openingbox;50)
break()
}

if_num (codecorrect ; 0)
setobj(Letters1;0)
setobj(Letters2;0)
setobj(Letters3;0)
setobj(Letters4;0)
setobj(Letters5;0)
setobj(Letters6;0)
setobj(Letters7;0)
playsound(try again;50)
StarLite Moon's Creators Haven

http://starlite-moon.freeforums.net

japanhonk
PaC-DK God
Posts: 1716
Joined: 05 Feb 2009, 20:36
Location: NRW
Contact:

Post: # 73743Post japanhonk
08 Jun 2009, 19:39

Hi,

you want to set objects at the last part, right ?

if_num (codecorrect ; 0)
setobj(Letters1;0)
setobj(Letters2;0)
setobj(Letters3;0)
setobj(Letters4;0)
setobj(Letters5;0)
setobj(Letters6;0)
setobj(Letters7;0)
playsound(try again;50)


If you do like this, only the first setobj - line will be executed

Try this :

if_num (codecorrect ;0)
{
setobj(Letters1;0)
setobj(Letters2;0)
setobj(Letters3;0)
setobj(Letters4;0)
setobj(Letters5;0)
setobj(Letters6;0)
setobj(Letters7;0)
playsound(try again;50)

}

Now the first part :
if_num (code1 ; 2)
if_num (code2 ; 3)
if_num (code3 ; 2)
if_num (code4 ; 3)
if_num (code5 ; 2)
if_num (code6 ; 3)
if_num (code7 ; 1)
setnum (codecorrect ; 1)

if the first IF ist true, it continues at the second one.
BUT - what, if it is false ? Then it continues at the 3rd one.
Use clambs :

if_num (code2 ; 3)
{
if_num (code3 ; 2)
{
if_num (code4 ; 3)
{
if_num (code5 ; 2)
{
if_num (code6 ; 3)
{
if_num (code7 ; 1)
setnum (codecorrect ; 1)
}}}}}

So you avoid to continue the program with the next following command
if the IF-command is false.

I hope, it was helpful

Manni

StarLite
An Adventure Creator
Posts: 446
Joined: 02 Jul 2005, 18:32
Contact:

Post: # 73750Post StarLite
09 Jun 2009, 00:52

Hi japanhonk, congrats on the completion of your game. I played some of it last night. I loved the old StarTrek 25th I think I still have that old game. You are more than welcome to host it on my forum if you like. You can put it in the Finished Projects area.

Thank you very much for the reply. I will give your script a try. Thank you once again. :comp:
StarLite Moon's Creators Haven

http://starlite-moon.freeforums.net

japanhonk
PaC-DK God
Posts: 1716
Joined: 05 Feb 2009, 20:36
Location: NRW
Contact:

Post: # 73781Post japanhonk
12 Jun 2009, 20:07

Hi star lite,

Thank you for inviting my game to your forum. But at this time I would not say that it is a finished project. There are still too many small bugs
I have to fix before calling it "finished".

But if I had done this, I will do.

See ya

Manni

StarLite
An Adventure Creator
Posts: 446
Joined: 02 Jul 2005, 18:32
Contact:

Post: # 73795Post StarLite
15 Jun 2009, 02:48

Hey Manni

When you are ready just pop by, you are more than welcome. Good luck with your project. :banana:
StarLite Moon's Creators Haven

http://starlite-moon.freeforums.net

Post Reply