Page 1 of 3

My ideas for a game.. Will this work?

PostPosted: Thu Sep 03, 2009 4:45 pm
by KingKong
Hi there,

I have a few questions about this game editor, since I have to know these things before I start making my game. I´m new to all this so I have no idea how to use variables and such... All I know is the very basics of the game editor. Okay, so here´s my idea of how the game will be... The game is supposed to be in style with Castlevania, your character will get experience points from killing enemies, doing quests etc, and eventually level up, just as in Castlevania. There will be different events in the game, for example, entering a house, talking to the person inside the house who will give you a task to complete etc... Picking up items dropped from enemies, equipping different items on the character, really just about the same as Castlevania. The Save/Load options is a must, it has to save all your progress, experience points, items etc.

Would this be very complicated to do in this editor? I guess it requires alot of programming codes which I´m not familiar with, at all.

Any help is greatly appreciated,
Best regards,
Joel

Re: My ideas for a game.. Will this work?

PostPosted: Thu Sep 03, 2009 5:01 pm
by Hblade
If you'd like to learn game Editor and C code, then visit my website :D

Re: My ideas for a game.. Will this work?

PostPosted: Thu Sep 03, 2009 5:13 pm
by Kalladdolf
Creating a game of that kind requires less programming skills than one thinks.
Although the basic use of variables is essential, it doesn't require that much effort to get into.
Let me just fill you in on variables (because they control games, you hardly will find a game without variables).
I think you already know that a variable stores values (such as points, health, level etc).
So it will come in handy for your progress stuff.
To create a variable, enter the Game Editor Script Editor and click the "variables" panel. You can create a new variable there.
Now there are certain properties which will determine the type of variable.
First off, you have to give it a name.
Name it "health" for instance.
Then, you can decide which type of variable it should be.
An Integer represents a number (like 1;2;3;456;1,000,000;etc.) You might want to select this for your "health" variable.
A String represents letters, words or sentences. Anything, basically. (e.g. "Hello World!").
A Real also represents numbers like an Integer, but it's more specific. It also can use numbers smaller than 1. (0.5; 4.982; etc.).

Next, you can tell Game Editor whether the variable should be an "Actor" or "Global" variable.
A "Global" variable applies to all actors and can be used by all actors (so, level, daytime, setting variables may be appropriate in most cases).
An "Actor" variable exists for every actor individually. So if one actor changes its "health" variable, it won't affect the other actor.
In my next post I'll tell you how to change variables.
Right now I gotta go.

Re: My ideas for a game.. Will this work?

PostPosted: Thu Sep 03, 2009 5:38 pm
by KingKong
Thank you so much, that was great information!

But variables require scripting codes, do they not?

Right now I´m trying to figure out how to make one animation collision event, so when I push space, he attacks with his sword animation then if that attack animation collides with the enemy, the enemy will be destroyed. How do I do that? I have no clue, I have to set some kind of region fillers on the sword animation perhaps? But how? Problem is that just as I get close to him, player collides with him, I just want the attack animation to be able to destroy the actor.

And if I wanted to make health on the enemy, so lets say he dies in 2 hits from the attack animation with the sword, no health bar required, how would I do that?

I really appreciate your help,
best regards,
joel

Re: My ideas for a game.. Will this work?

PostPosted: Thu Sep 03, 2009 5:52 pm
by Hblade
Use this code when space is pressed
Code: Select all
attacking = 1;

Now use this code when collision with the enemy
Code: Select all
if (attacking == 1)
{
    EnemyHP = 0;
}

Of course your going to need to make the variable attacking, a global integer.
Make the EnemyHP an Actor Integer.

Re: My ideas for a game.. Will this work?

PostPosted: Thu Sep 03, 2009 9:45 pm
by Kalladdolf
Somehow my following post got deleted, but what I meant was that variables can be changed and controlled just like mathematical problems.
You can add, subtract, multiply, divide and do lots of different mathematical other stuff (like square root, sin, cos, tan etc.).
Hblade just showed you how to make certain actions depend on a specific value, using the most common statement, namely IF.
As to your second question, one the Create Actor event, you set the enemyHP variable to 2. (He should die from two hits, right?)
You do that by entering this into the script editor:
Code: Select all
EnemyHP = 2;

Then every time he gets hit, put:
Code: Select all
EnemyHP = EnemyHP - 1;

or
Code: Select all
EnemyHP -= 1;

Both expressions mean the same, the second one is just a little shorter.
So, the enemy's health decreases by one every time he gets hit.
Also, put the following code for the same event:
Code: Select all
if(EnemyHP <= 0)
{DestroyActor("Event Actor");

So, if the enemy's HP is less than or equals zero, it will vanish.

Re: My ideas for a game.. Will this work?

PostPosted: Thu Sep 03, 2009 9:52 pm
by Hblade
Hehe.. or you can go to the enemy and put this in draw actor
Code: Select all
unsigned int EnemyHP
if (EnemyHP == 0)
{
DestroyActor("Event Actor");
}

Then when colliding with the player...
Code: Select all
if (attacking == 1)
{
EnemyHP -=  1;
}

I assume this will make a variable EnemyHP that only applies to that actor.

The unsigned int will prevent it from going below 0, for an unsigned int's max and min numbers are 0 - 65,535

Re: My ideas for a game.. Will this work?

PostPosted: Thu Sep 03, 2009 11:25 pm
by KingKong
Thanks alot for all the response, but it wont work for me, I don´t know where to put the codes in, I tried going into Script, Global Code then creating the variables just as you said, but I don´t really understand this, the "attacking" is the name of the animation right? So in my case it would be "charattack" which is the name of my animation? A step by step guide would really help me out.

Also, only the sword should be able to destroy the other actor, not, in my case the long cape, or the players little feets touching the enemy, how would I do that?

Best regards,
joel

Re: My ideas for a game.. Will this work?

PostPosted: Thu Sep 03, 2009 11:26 pm
by Hblade
Go back and read carefully :D

Re: My ideas for a game.. Will this work?

PostPosted: Thu Sep 03, 2009 11:47 pm
by KingKong
I´m getting these error messages when trying to script in the editor... I select the enemy actor, which name is "enemy" and Add in Events, then I choose "Create Actor" in the list, and then Script Editor... I type the lines in from you guys, tried both, but they wont work, I get all sort of error messages, line 1, incompatible types "cannot convert const int to identifier", line 2, undeclared indentifier enemyhp, undefined type for relational operation etc. why?

this is how my code looks

EnemyHP = 2;
EnemyHP = EnemyHP - 1;
if(EnemyHP <= 0)
{DestroyActor("Event Actor");

Re: My ideas for a game.. Will this work?

PostPosted: Thu Sep 03, 2009 11:52 pm
by Hblade
Ok, lets start from the top... Put this in create actor of the enemy.
unsigned int EnemyHP = 2;
Then what ever you had.
Now, when space is pressed, use this command
attacking = 1;

Now open Global Code, and type this in
int attacking;

Note: Put int attacking; in global code before you put the space bar thing... If you need a video tutorial I'll make one.

Re: My ideas for a game.. Will this work?

PostPosted: Fri Sep 04, 2009 12:22 am
by KingKong
Tried everything I can think of, I don´t get error messages anymore though, but still it wont work. If you have time and feel like it, it would be really nice of you if you could make a vid tutorial as you mentioned. But I don´t want to waste your time on a stupid scripter like myself :roll:

Re: My ideas for a game.. Will this work?

PostPosted: Fri Sep 04, 2009 1:03 am
by Hblade
Dude, dont call yourself a stupid scripter, no one starts off good. If you'd like to learn more, keep updated with my website eventually I'll post more info ok? :D

Re: My ideas for a game.. Will this work?

PostPosted: Fri Sep 04, 2009 3:32 pm
by KingKong
Hi again,

I have made a .ged file with the stage, including enemy and player. I would be forever grateful if any of you perhaps could script the variables in and then upload it again so I can see what I have done wrong, the EnemyHP variable and the attacking animation one because I can´t figure this one out on my own.

Best regards,
Joel

Re: My ideas for a game.. Will this work?

PostPosted: Fri Sep 04, 2009 3:38 pm
by Hblade
I'll do it :D