Many
people email me for help in making adventure games using TGF,CNC
and MMF. So basically I've decided to adapt the emails into a
simple question-and-answer tutorial to help anyone! This section
will slowly grow larger over time.
Q1
: Dialogue Choices with
Question Objects.
Q2 :
Global Variables
Q3 : Object Flags
Q4 : Controlling character
movement
Q5 : Character walking
animation
Q6 : The
'full screen' look
Q7
: Timing branching Dialogue
Q8 :
Global Variables &
Flags - example file
Q9
:
Changing the look of
the mouse cursor
Q10:
How to setup a 'Save/Load
game' function
Q11:
Scrolling screen for
games (very useful)
Q12:
Hidden Commands and
Inventory (like in CMI)
Q
1. When
I want my main character to talk to someone, how is it possible
for each question that the main character asks will link to a
different answer? For example, in your TNB: ACT 1, when Roy goes
and talk to Walt of the Coffee House, every question that Roy
asks, Walt gives him a different answer!!
A:
This is easy to do. Firstly make a question object. Then in the
event editor, drag the QA object down to a line (e.g Make a new
condition). You will then get three options:
a) Is the question correct?
b) Is the question false?
c) Is the answer equal to a certain value?
Choose c. Then select a value. The values are simply the number
of answers you created.
e.g.: Answers 1) Who are you? 2) You smell 3) I'm leaving now.
So when answer equals one: Trigger the set response. And so on
for the rest of them.
Q
2.. When I want my main character to pick up an object, how can
I make the object appear in the inventory and throughout all the
other screens which the main character will go to but not if a
map, for example, of all the places the main character can go
to, appears?
A:
To make the game remember what you picked up, use Global Variables.
These can be found by clicking on the SPANNER icon in the event
editor. Then you can set global variables for each object. E.G..
a)Give
an object a G.V number. Such as Banana = Global variable 1 = 1
So to use it: When you pick up the banana, go to the spanner icon,
and set Global variable 1 to = 1 (or whatever number) This stores
it through out the entire game
b) Set the banana (objects) to be a global object by right clicking
on them and setting up their preferences.
c)
Put the object on every stage which it will appear
d) Now make an event line (in the event editor), saying:
When Global variable 1 = 1 THEN:
Set the position of the banana to X,Y Coordinates (in your inventory)
Now put this line in its own group. Right click on the group and
set it as being global. NOW the banana will appear in the inventory
the whole game. When you want to make it so its no longer in use,
simply change Global variable 1 to = something different. If you
don't want the object to appear in a map stage, don't put that
object in that level.
You
can download an example file of this code HERE
(6k). *Note: Only for CNC, MMF or MMF express.
(.cnc file)
Q
3.. Could you give me a detailed example of how I could make the
PICK UP, LOOK AT, USE and other interface commands to work in
my game?
Yes.
You must use object flags for this. Every object can be assigned
flags and You can do this in the event editor. Drag an object
on to a line choose values, then flags.
NOW, for each command, when you click on it, you set a flag on.
e.g.. When mouse clicks on "PICK UP", set "PICK UP" flag 1 on.
(*Note you can set any number). On this same line of code, then
also set all the other command flags off. (e.g. Talk flag 1 off,
Examine flag 1 off)
NOW, with the PICK UP flag 1 on + The mouse clicks on another
object (say a banana), THEN set the banana flag 3 on. (It can
be any number).
So
now the object you want to pick up has a flag which is on. SO
set this line of code up: When BANANA flag 3 is on + Character
collides with banana/(or the black thing in my movement engine)
THEN
- Change animation of character to picking up.
- Set banana GV1 to 1. (this will then put the object in your
inventory -refer to Q2) Then finally, you have to turn all the
flags off.
So on that same line, click under the banana and "Set Flag 3 off".
AND then Set "PICK UP" Flag 1 off.
The
same principles can be applied to all the other commands. And
yeah, it may sound confusing, but once you try experiment with
it - you will see its pretty straight forward.
Q4..
Imagine a scene in which my main character arrives at the edge
of a cliff, where ¾ of the screen is land, i.e. the cliff, and
¼ of the screen is the sky, i.e. a precipice. How could I make
my main character walk around on the land part and stops when
it arrives at the beginning of the precipice?
A:
This is a bit tricky. For this you will need my movement engine.
If you examine the engine code, you will see there's an area defined,
and if you click in it - that's where the character will move
to. Basically, you can make as many of these areas as you like
- and control where the mouse will click.
So
currently the area set is for the whole screen. Modify, the X
and Y positions in the "mouse clicks within zone" code to be 3/4
of the screen. *Note: this may be hard to follow without the
engine open in front of you. Now copy and paste that same
line of code, but this time, set the zone to the remaining 1/4
of the screen. Then modify where the "black thing" (movement stopper)
is created, to appear in the top 3/4 of the screen.
E.g.
One line of code(zone) to represent the land 3/4's. And another
zone for the sky. When both zones are clicked on, they create
the 'black thing' (the thing that tells the character where to
go), in the area of the land. You will have to use trial and error
to get it right though.
Q5:
How can I animate my character to walk?
I could talk you through this, though someone once emailed me
some walking templates. I haven't used them myself, but I'm sure
they will help. Download them here.
Thanks to Duke.
Q6:
How do you get the screen to look like it's in DOS or full screen
(like in TNB)? ?
Go to file > application setup. Then make sure the application
is set to "Maximised on bootup". Turn off the rest.
Though,
if you want a menu bar, click that option on too :-) Then to access
it during the game, press F8.
Q7:
I need help making 'branching dialogue' - and timing each sentence.
Have a look at this
tutorial (.gam
file) example. It's different to
the system I use, but was kindly donated and developed by Julien
Fenech. It basically uses text objects and counters.
Download
it here. (100k)
Q8:
Give me the code to use Global Variables and flags!!
This
very small file gives and demonstrates the power of global values
and flags.
If this all seems like mumbo-jumbo, basically the tutorial gives
you the code for picking up objects and storing them in an inventory.
->
Download Tutorial (6k) <-
*Note: This is for CNC/MMF only.
Q9:
How do you get the cursor to change like that in TGF/CNC/MFF?
I've tried, and I'm either stuck with standard windows rubbish,
or can't click anything if I assign an active object to the mouse.
Anyway, keep up the good work, and congratulations on your fine
game.
This
is quite easy to do :) You can download my movement engine from
my site which will demonstrate the code for this - plus give you
a basic engine if you are making an adventure game.
However,
to do it yourself, follow this procedure in the event editor:
Always = (Under Your-cursor object set this): Set X position to
Xmouse Set Y position to Ymouse.
Then
to actually make it work, you can use the conventional 'mouse
click on an object'. BUT I actually use the new cursor graphic
and make my own code.
eg: When YourCursor object overlaps banana + User clicks with
left button.
You will have to do this for whatever object you want to click
on. That should do the trick. Thanks
Q10: Hi, I was wondering
if you could tell me how to setup a save/load game system when
making a game with The Games Factory? (as in one where the player
presses a button and is asked to type in a filename to save during
the game.) Any help would be much appreciated.
The
save/load engine available in the download section of my site
is just what you need. The file is pretty self-explanatory, with
an example of how it's set up and how it functions. You will need
the latest version of TGF however and a couple of extra TGF file
add-ons which are listed with the readme file.
Q11:
How can i make the screen scroll like they do in other adventure
games? ( Useful for other games also)
Check out the scrolling tutorial developed by Skyler Hall.
It comes in a downloadable .gam form, so it's very practical.Recreate
the perfect scroll Download
it here.
Q12:
How do I get a hidden inventory/command system, like the coin
function in 'The Curse of Monkey Island'.
Check
out another playable tutorial developed by Skyler Hall. It comes
in a downloadable .gam form, and is fantastic. Perfect your game
and Download
it here.
Good
luck
Scurvyliver
Need help or a question answered?
Contact Scurvyliver Entertainment through a help
form here.