PDA

View Full Version : This is hard



Zurc
04-03-07, 10:10 PM
Hurrah I always wanted to make a Dizzy game :v2_dizzy_clapping:

So I got this program, but I am so clueless. The tutorials seem to assume that I know how to program. It took forever just to work out how to click things onto the screen :cry:

The map editor is ok, but to program stuff do I use something like notepad? I opened object.gs and pasted stuff into it, but it seems kinda clunky. I have to read everything very carefully and still am not sure what the commands mean.

Any tips? I don't even know how to set where Dizzy starts in the game.

delta
05-03-07, 11:02 PM
it is very difficult to learn how to use it, even for someone who has programmed in other languages.

i would strongly suggest that you download the tutorials from the DizzyAGE site, and run through them. they will show you how to do a lot.

also have a look at some of the threads on here, as there are some that explain things that aren't immediately obvious.

to be honest, a lot of it is trial and error, and you will tear your hair out at times, but if you have any problems, ask on here.

you can also un-pak the .PAK file on any of the dizzyAGE games using the PAK.exe application. then you can look through it all and see how stuff has been done. be warned though that some of the games have VERY complex bits of coding in them...

as for your question about where dizzy starts, that is normally set in the Intro.gs file using 'PlayerSetPos' but if you're using a tutorial, it's set in the tutorial.gs file using 'PlayerSet'

and yeah i've used notepad for Diamond Mine Dizzy, it's not too bad tbh.

Zurc
06-03-07, 10:52 AM
Thanks for the advice, good stuff. I went through the first tutorial and was following it okay. Then it ends off saying as an excersize make it so Denzil does not comment about the leafs. I then realised I didn't have a clue how to do that.

Looking at the code of an existing game would help loads I would imagine. Didn't realise I could do that with the released games. Will check it out and see how it goes.

I'll stick at it. Who cares if I pull my hair out - I'll just resemble Dizzy!

delta
06-03-07, 07:53 PM
don't worry about it, i had serious problems trying to do some of the stuff it suggests you try and do in the tutorials...

i found out stuff mostly by trial and error, cutting and pasting different bits of code and altering it to try and get stuff to work.

good luck!

xelanoimis
07-03-07, 02:27 PM
Hi Zurc!

Non't be alarmed if you find it difficult at the beginning.
It takes a while to get it, but I think that when you understand it,
you'll be happy to have a script to change it as you want.
Also the community is growing and me and others can always help you.

DizzyAGE v2.0 is in development and it will be free source, meaning it can
be portable on any future platform or operating system.
So your games will have a very long life.

And as you guys get more familiar with it, maybe you will help me create a better documentation,
containing better tips for beginners, with things that aren't so obvious as I thought.

Also, as a beginner if you bump into a problem and finaly solve it,
it will be nice to explain it on the forum, for other beginners to read about it and save time (and hair :) )

xelanoimis
07-03-07, 02:46 PM
Oh,
and as for the Denzil exercise, you will need to change his status to 2 (for exmple), when Dora recives the leafs. Then in the Denzil's function you must do nothing if his status is 2.
See that now Denzil say a thing if his status is 0 and then set his status to 1, so next time he will say something else.

To set Denzil's status to 2 means to find the dynamic object (that have Denzil's tile) and set it's
O_STATUS property to 2. You find objects using their unique ids with ObjFind, because most functions are refering to objects use their indexes, not the ids you set yourself in the editor.

Objects are stored in an ordered list and indexes are positions in this list.
The object ID is a property that helps you find a specific object in that list.

It is good to understand it, before you go to the next tutorials.
Copying and pasting the tutorial code without knowing what it does, will not help you much.
It does give a level of confidence that the thing does work, though :)

If you need more help with this exercise, or other one, let me know.

Zurc
07-03-07, 03:58 PM
Cool the programing expert is here. His skillz equal those of a Mortal Kombat ninja :v2_dizzy_happy:

From my limited knowledge of programing (typins in BASIC hehe) I did figure that I had to change the status number, but wasn't too sure how from interacting with Dora. I also messed about and tried to have him say a third line if you click on him a third time. Something like "go away!"

I messed up though cos when I click on him the second time he would say

"Dora needs leafs"
"Go away!"

at the same time. Is there something like ENDIF in this language?

Well I'm not gonna make a game any time soon, but I will keep messing about with the program. Thanks for the help.

xelanoimis
07-03-07, 04:44 PM
The GS9 scripting language is similar to C and instead of endif you use }
There is a chapter about it in the manual (not very detailed, because
the similarity with the popular C language)

The if syntax is like:

if( condition )
single command code

or

if( condition )
{
code run if true
}

or

if( condition )
{
code run if true
}
else
{
code run if false
}


About the exercise, here is how it should look like:


// Denzil ID is 1000 and this function is called automated
// when hitting action while in front of Denzil object
// and those lines are comments :)
func ActionObject_1000()
{
idx = ObjFind(1000);
if(ObjGet(idx,O_STATUS)==0)
{
Message1(2,2,"\"DORA SEEMS \nTO NEED SOMETHING.\"");
MessagePop();
ObjSet(idx,O_STATUS,1);
}
else
if(ObjGet(idx,O_STATUS)==1)
{
Message1(2,2,"\"DORA NEEDS SOME LEAFS.\"");
MessagePop();
}
else
if(ObjGet(idx,O_STATUS)==2)
{
Message1(2,2,"\"GO AWAY.\"");
MessagePop();
}
}

// This function is called when using the object with the index idx
// when in front of object with the id 1001 (Dora)
func UseObject_1001( idx )
{
if(ObjGet(idx,O_ID)==2000)
{
Message1(6,4,"\"THANKS DIZZY!\nEXACTLY WHAT I NEEDED.\"");
MessagePop();
InventorySub(idx);
ObjSet(ObjFind(1000),O_STATUS,2); // set Denzil status to 2
}
else
{
Message1(6,4,"\"NO DIZZY,\nSOMETHING ELSE...\"");
MessagePop();
// can call DropObject(idx) to drop it
}
}

delta
07-03-07, 08:50 PM
I hope you don't mind Alex, but i'm gonna add some notes to the code example you gave to try and help Zurc understand the code better.

I hope it helps Zurc, and that i'm not showing you things that you've already worked out.....


// Denzil ID is 1000 and this function is called automated -------the '//' start comment lines that the program ignores-------
// when hitting action while in front of Denzil object
// and those lines are comments :)
func ActionObject_1000() -------if the class of dynamic object 1000 is 'action', this tells it what to do if you press 'Enter' when infront of the object-------
{
idx = ObjFind(1000); -------this tells it to find dynamic object 1000, and make 'idx' equal it.-------
if(ObjGet(idx,O_STATUS)==0) -------'ObjGet' gets the status of dynamic object 'idx' (which is object 1000) and checks if it is 0. if it is, it executes the following code:-------
{
Message1(2,2,"\"DORA SEEMS \nTO NEED SOMETHING.\""); -------'Message' creates a pop-up message, the '1' after it tells it that it's a character speaking. '0' tells it that it's a game narrative and '2' tells it that dizzy is speaking(it does all these by changing the colours).-------
MessagePop(); -------this removes all messages displayed on the screen.-------
ObjSet(idx,O_STATUS,1); -------this sets the status of object 'idx' to 1-------
}
else -------if the object status is not 0, it executes the following code:-------
if(ObjGet(idx,O_STATUS)==1)
{
Message1(2,2,"\"DORA NEEDS SOME LEAFS.\"");
MessagePop();
}
else -------if the object status is not 0 or 1, it executes the following code:-------
if(ObjGet(idx,O_STATUS)==2)
{
Message1(2,2,"\"GO AWAY.\"");
MessagePop();
}
}

// This function is called when using the object with the index idx
// when in front of object with the id 1001 (Dora)
func UseObject_1001( idx ) -------this tells the game to open the inventory box if you press 'Enter' when infront of object 1001-------
{
if(ObjGet(idx,O_ID)==2000) -------if you use object 2000, it will make 'idx' equal to that object ID (2000) and execute the following code:-------
{
Message1(6,4,"\"THANKS DIZZY!\nEXACTLY WHAT I NEEDED.\"");
MessagePop();
InventorySub(idx); -------this removes the item 'idx' from the inventory.-------
ObjSet(ObjFind(1000),O_STATUS,2); // set Denzil status to 2
}
else
{
Message1(6,4,"\"NO DIZZY,\nSOMETHING ELSE...\"");
MessagePop();
// can call DropObject(idx) to drop it -------if you use 'DropObject(idx)' then item 'idx' will be dropped, if not, it will stay in the inventory.-------
}
}

xelanoimis
07-03-07, 10:41 PM
Any help from anyone is appreciated.
You may use the forum highlight. It's really cool, indeed :)
See about it here: http://yolkfolkserver.co.uk/bb/showthread.php?t=17