
-----------------------------------
cat8864
Sun Oct 05, 2008 5:54 pm

Procedure help needed
-----------------------------------
I'm trying to make a chose your own adventure by using procedures for each scenario. Its set up so each scenario is linked to two other scenario procedures, the restart and end procedures (unless its one of the endings) - I can't map it since everything is dependent on each other. 

My problem is that each time I try to run it I keep getting 'not declared' - is there anyway to get everything to run without having to create a file for each individual scenario then importing it into the file that starts everything?

-----------------------------------
Insectoid
Sun Oct 05, 2008 6:16 pm

RE:Procedure help needed
-----------------------------------
This is tricky. You have to organize your procedures so that if one relies on another, the one relied on it created first. This would mean putting your end procedures first. Turing is annoying like that.

-----------------------------------
The_Bean
Sun Oct 05, 2008 6:22 pm

Re: Procedure help needed
-----------------------------------
Try looking up 'forward' in the Turing help files.


forward procedure test
test
body procedure test
    put "test worked"
end test


-----------------------------------
gitoxa
Sun Oct 05, 2008 6:58 pm

Re: RE:Procedure help needed
-----------------------------------
This is tricky. You have to organize your procedures so that if one relies on another, the one relied on it created first. This would mean putting your end procedures first. Turing is annoying like that.
How's that annoying, it's scope made easy.

Cat, my idea would be to call each of the three scenarios through a "main menu" as opposed to linking them all to each other.

-----------------------------------
Insectoid
Sun Oct 05, 2008 7:04 pm

RE:Procedure help needed
-----------------------------------
That could work too. 

It's annoying because it doesn't recognize that the procedure is called further down the program. Dunno if other procedural languages are like this, but whatever. I find it annoying.

-----------------------------------
btiffin
Sun Oct 05, 2008 7:17 pm

RE:Procedure help needed
-----------------------------------
Old guy recommends; for further offtopic reading:

Inform7

http://www.inform-fiction.org/I7/Welcome.html

I7 is nice development system that accepts near english and produces interactive fiction games ala Zork and Adventure.

If you don't pick up any hints from some of the example source code, the concepts in the manual make for sound game designs.

Cheers

-----------------------------------
syntax_error
Mon Oct 06, 2008 12:36 am

Re: Procedure help needed
-----------------------------------
do something long the lines of :



proc gah
proc foo
proc bar
proc yougetthepoint
/* main menu */
loop

if x = a
gah

if x= b
foo


if x = c
bar

end loop



edit: tags...

-----------------------------------
S_Grimm
Mon Oct 06, 2008 8:36 am

RE:Procedure help needed
-----------------------------------
syntax_error has it right. have a variable (ie "thisvariable"), have it equals 0 (var thisvariable := 0) then in your main loop, have if statements (if thisvariable = 1 then procedure a, if thisvariable = 2 then procedure b, etc..)

-----------------------------------
cat8864
Mon Oct 06, 2008 9:13 am

Re: Procedure help needed
-----------------------------------
Thanks for the tips - everythings running smoothly now (and decently organized!)

-----------------------------------
Insectoid
Mon Oct 06, 2008 11:54 am

RE:Procedure help needed
-----------------------------------
hey, A/V, could you shrink your avatar a bit? I would PM you, but the '/' in 'A/V' screws up the board, meaning it won't let me!

-----------------------------------
S_Grimm
Tue Oct 07, 2008 10:15 am

RE:Procedure help needed
-----------------------------------
oh, sorry. yeah, ill replace it with something smaller.

-----------------------------------
isaiahk9
Wed Oct 08, 2008 3:09 pm

RE:Procedure help needed
-----------------------------------
I think the easiest way would be to have all seperate files, and then just in the main file click "Compress to executable" button on the top of the User Interface.  Unless there's something that you want that this cannot offer, this seems the simplest and best. . .

-----------------------------------
gitoxa
Wed Oct 08, 2008 10:15 pm

RE:Procedure help needed
-----------------------------------
I think we need a sage button on the forums.

That doesn't work, the program is compiled before it's run when you press the run button anyways.

-----------------------------------
Dan
Wed Oct 08, 2008 11:00 pm

RE:Procedure help needed
-----------------------------------
The_Bean has the best awnser.

Look up and use forward. It is like prototyping in C.
