Post Wed Jan 05, 2011 2:39 pm

Old Sage By Jonathan Holmes (crait)

This program didn't take me long to construct and if you want to use it as a template for your own text-based RPG made in Ore, be my guest! The program is really just used as an example program because it has variable manipulation, use of directors, containers, strings, and a lot of other fun stuff! Just check it out! (:L)

  Code:
# Old Sage By Jonathan Holmes (crait)
# This program is an example program that allows you to have a sort of conversation
# with an old sage that knows magical spells. See if he will tell you the secret of
# his ways!
# Actually, this program is just an example program that includes a lot of different
# elements such as many directors, use of strings, variables, containers, etc. It's
# a great learning tool! Sorry, no comments are in here. Like I said, it's a learning
# tool. ;) Enjoy!
# January 3rd, 2011
exe:3.1.n.OldSage
%var i = 0
%var j = 0
ore:clear
echo:This game is a game where you interact with an old mage.
echo:What secrets will he tell you? Ready to find out?
ore:pause
ore:clear
env:speed 1
echo:Hello, traveller! What is your name?
%lbl 1
%str a inp
%if a = nil then
echo:What was that? I didn't hear you.
%goto 1
%end
echo: Ahhh... Yes, your name is...
%str a out
echo: What brings you here, today?
%lbl 2
echo:   1) I want to learn about killing the dragon!
echo:   2) I want to learn about magic!
echo:   3) Nothing... Just checking how your day was...
%var h inp
var h + 2
%if h > 5 then
echo:Excuse me, what was that? I'm hard of hearing.
%goto 2
%end
%if h < 3 then
echo:Excuse me, what was that? I'm hard of hearing.
%goto 2
%end
%goto h
%lbl 3
echo:So, you'd like to learn about the dragon, eh?
echo:He's a huge monster that lives on the top of the mountain
echo:to the north! Sometimes he comes down and eats our sheep!
echo:I would stop him, but I'm much to old...
echo:What else would you like to talk about?
%lbl 31
echo:  1) How would you be able to kill the dragon?
echo:  2) Something else.
%var h inp
%if h > 2 then
echo:Excuse me, I'm sorry. I didn't understand that...
%goto 31
%end
%if h < 2 then
echo:Excuse me, I'm sorry. I didn't understand that...
%goto 31
%end
%if h = 2 then
echo:Well, then... What would you like to hear about?
%goto 2
%end
echo:Well, all dragons have have a mystical veil around their
echo:bodies that make them strong and feather-light... I
echo:know of a great spell to remove that veil to make the
echo:dragon fall out of the sky to his death!
echo:Unfortunately, I'm too old to get out of this chair...
echo:Now... What else would you like to hear about?
%var j = 20
%goto 2
%lbl 4
echo:Magic? Magic is complex, actually. You need to not only
echo:be smart when using it, but you must also be wise. For
echo:beginners, some people may make a simple object like
echo:an apple levitate.
echo:With more practice, and the right heart, people can do
echo:some amazing things!
%lbl 41
echo:Would you like to know more about magic?
echo:   1) Yes!
echo:   2) No, thanks.
%if j = 20 then
echo:   3) Tell me more about that spell to kill dragons!
%end
%var h inp
%if h > 2 then
echo:I can barely hear you... Speak up!
%goto 41
%end
%if h < 2 then
echo:I can barely hear you! Speak up!
%goto 41
%end
%if h = 2 then
echo:Oh, then what were you wanting to hear about?
%goto 2
%end
%if j=20 then
%if h = 3 then
echo:Ah, yes... The ma'lraha enchantment... It is an ancient
echo:spell that one must train for a lifetime to perfect...
echo:I just so happen to be five lifetimes old and am in very
echo:bad shape. Perhaps you can learn it... Of course, you do
echo:not have to train for as long as I have. Whenever I die,
echo:I can pass it along to you. Would you like this ability?
%lbl 42
echo:   1) Yes, please!!
echo:   2) No, that is too intense. Let's change the subject!
%var h inp
%if h = 1 then
echo:Wait a minute! How do you expect me to just hand it
echo:over to you?! Do you want me to die or something? when
echo:my time comes, it'll come. Perhaps it will be in another
echo:lifetime or so.
%var i = 20
echo:Now, kiddo, what else would you like to learn about
echo:today?
%goto 2
%end
%if h = 2 then
%goto 2
%end
I'm sorry, but I don't understand...
%goto 42
%end
%end
%lbl 5
%if i = 0 then
echo:Actually, my day is a very cold and bitter kind of day.
echo:I'm glad that you've stopped by. Gives me someone to talk
echo:to. Now, anything else you wanted to talk about?
echo:   1) Yes, please!
echo:   2) No, thank you.
%var h inp
%if h = 1 then
echo:Alright, young wanderer. What would you like to talk about?
%goto 2
%end
%if h = 2 then
echo:Alright, then. I guess you must be going, then! Just watch
echo:out for that dragon!
ore:pause
exe:end
%end
%end
%if i = 20 then
%end
exe:end