Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: I need some GM 6.1 help with an rpg.  (Read 1175 times)

0 Members and 1 Guest are viewing this topic.
I need some GM 6.1 help with an rpg.
« on: October 11, 2007, 09:34:01 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
I have been making my own engine in GM 6.1.  It is an rpg engine.  I know very little of GM, so this is my learning process as well.  So far, all I have is D&D events.  What can I do to set a health for an enemy?
I put the gm file in the attachments so you can see what I have done so far.  That all took me about an hour to come up with.  You use the arrow keys to move around in the overworld.  Touch a monster and you go to a battle screen.  In the battle, there is only one option to use...Attack.  You position your mouse over the word "Attack" and the hero does just that.  However, if you keep clicking, he keeps attacking even though I have yet to set up a turn base yet.  I guess I am looking for some tips and pointers to help put me in the right directions.
« Last Edit: December 25, 2007, 03:41:04 am by 4Sword »
Logged
  • Super Fan Gamers!
Re: I need some GM 6.1 help with an rpg.
« Reply #1 on: October 15, 2007, 01:04:11 am »
  • You're the yellow bird that I've been waiting for.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 242
Well, the first thing I'm going to suggest is... learn GML. Seriously. I learned purely from the GM help file, my only prior game making experience being that from RPG Maker 2000. It will take a while to get used to, but it is so much easier and fast in the long run than using the D&D system. But I'll try my best to help you with what you've got so far.

To set an enemy's health:
Open your enemy object [object4 in your project], and make sure the event tree for "Create is being shown. Then, from the D&D tabs, choose "Control". You should see the heading "Questions", "Other", "Code," and "Variables". What you want to do is define a variable to store the enemy's Maximum HP and its Current HP. So, under the [Variables] heading there are 3 icons, a square, an octogan, and a tan colored square. The first square defines a variable, so drag and drop it into your event.

Now you should see a window titled, "Set Variable." It is asking what to apply the variable to, the variable's name, the variable's value, and whether you are adding or subtracting from the variables current value (relative).

Leave the Applies to option checked on "Self." This means that the variable will forever be associated with this object and will be referred to as "object4.[variable]".  In the variable box, enter: "enemyMaxHP" (Important note! Variable names can only contain characters A-Z, a-z, 0-9, and underscores "_"). Set the value to whatever you want your enemy's max hp to be (we'll use 10 for now). Leave the [relative] box unchecked. Now click OK. Congratulations! You've created your first variable. It's name is "object4.enemyMaxHP" and it holds the value of 10.

Now create another variable. Leave the Applies to option on self, name it "enemyCurHP", and set the value to "enemy4.enemyMaxHP", and leave the relative box unchecked. So, now you see, the value does not have to be a set of numbers. You can set one variable equal to another. In this case we are giving the enemy is maximum starting HP.

Now the reason we created two variables is so that we have one we can change and one we can reference. We want to change the enemy's current hp, but what if he were healed and had no maximum HP? He could become infinitely strong and unbeatable to the player. So we make another varialble that we can compare it to. We make the statement, "If the enemy's current HP goes above his maximum HP, we should set it back to his maximum HP."

Variable are probably the most important aspect of any programming used in games and you should become really familiar with them. Their uses are not limited purely to what I described either. Then can store all sorts of information such as text, lists, colors, etc.

I hope this helped and wasn't too confusing. I tried to make it as easy to understand as I could, but I may not be the best at explaining things.

Logged
Re: I need some GM 6.1 help with an rpg.
« Reply #2 on: October 15, 2007, 02:19:47 pm »
  • 笑い男
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 2124
to add to learning from gml (or amny things i guess this goes for)
learning from examples (looking at them, editing them, replicating them with edits etc) really is one of the best ways to learn
Logged

この世に悪があるとすれば、それは人の心だ
  • .hack//The World
Re: I need some GM 6.1 help with an rpg.
« Reply #3 on: October 15, 2007, 09:53:47 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Thanks for the help.
In response to learning GML, I actually printed the whole GML part of the help guide.
ALL OF IT.  I did that about a month ago.

Yeah, I am learning the codes, but it never shows examples on where/when/how to put them to use.
Logged
  • Super Fan Gamers!
Re: I need some GM 6.1 help with an rpg.
« Reply #4 on: October 15, 2007, 10:45:14 pm »
  • You're the yellow bird that I've been waiting for.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 242
Yeah, it is a little annoying that there are no examples in the help file, but that why you programming forums :] I'm more than willing to help if you have more questions, but I can be pretty bad at explaining things sometimes :/
Logged

Mamoruanime

@Mamoruanime
Re: I need some GM 6.1 help with an rpg.
« Reply #5 on: October 16, 2007, 04:33:49 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
actually, the help file does have examples of code; but only "use of script" examples, and not really any practical example gmds or anything; My biggest issue with GML right now is trying to go back from VB to GML; its a pain (BAH I wanna do "do while not i = x" but noooooo I cant.)

I learned GML during my stint here; finding all of the examples I could and studying them and seeing how each function correlates to an action. My first GMD sucked balls, lol but eventually I started coming up with new, effective ways of doing things, and over the years its helped...

granted I havent touched GM since 2005... and I am so freakin rusty that I cant code my way outta a paper bag........ but still, point remains :p

Drag and Drop is good for like maze games, and stuff that doesnt really have much depth to it... but for an RPG, it'd be good to just sift through the help file for what ya need
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.188 seconds with 46 queries.

anything