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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Alex2539

Pages: [1]
1
Coding / GM Tutorial: How to solve most problems encountered by newbies!
« on: December 07, 2006, 03:51:24 am »
Most problems can be solved in a very simple, but somehow not so obvious, step: RTFM. In short, RTFM stands for "Read the Freaking Manual". Vulgar, yes, but true. It's a little known fact, but GameMaker has its own built-in help file which covers pretty much every aspect of the program and defines pretty much every command in the GML language. Too often I see a question asked by someone trying to find a snippet of code or a function which is clearly defined this manual.

Rather than wasting both your time and others' by creating such a topic, the first thing you should do is push that little "F1" key or click the button that looks like blue circle with a question mark on the toolbar. Scan through or search the manual for what you need. Sometimes being vague helps.

If you cannot find what you are looking for in the manual, stop and think about what you're trying to do. Think logically about the problem. What is it you want to do? How could it work? Break it down as much as possible. For example, on of the most common request I've seen in the past is a rupee engine. If you take a couple of minutes, you'll realize exactly how obscenely simple such an engine is in any language. Let's break it down now:
What needs to happen? - Numbers need to appear on the screen that show how many rupees we have.
How do you show something on the screen? - You need to draw it.
  - What do you need to draw? - Numbers
    - What are numbers? - Text
      - What have we learned? We need to find a command that draws text on the screen. The text we need to draw consists of numbers.
Now we go into our manual and do a bit of a search. We need to find something to draw some text. So we make a vague search for "draw text". Since everything in the manual is described, odds are a function that draws text will have those words in its description. Looking at the results, we have different possible categories. "Drawing actions" looks promising! We can see there that it's descripting a drag and drop function that draws text on the screen. That could work, but we want to make a complicated engine so we'll want the code for it. Let's keep going. Look through the section until you find a GML function that draws text. It's there, and you ought to find it along with how to use it. Let's keep going:

We can draw numbers now! But how do we get the numbers we want? - We need to record how many rupees we have.
How do we record numbers? - Variables.
  - What kind of variable do we need? - It needs to work with the object drawing the number of rupees as well as the object collecting the ruppees. More than one object means a global variable.
    - Should we use "global.rupees"? - Why not ;)

Alright, so now we need to make two objects. One to get the rupees and one to show the numbers. The one that gets the rupees can be the character if you already have one. The one that draws the number should be one that handles other HUD things like that. Let's continue with the questions:
  - How is the object going to draw the numbers? - With the drawing function we found
    - Where do drawing functions go? - In the draw step.
There we go! Now we know where we have to put our code. So make a new piece of code and put up our draw function.

Assuming you found the same draw code as I did, it's draw_text(x,y,string). Let's ask some more questions.
  - What are those things in the parenthesis? - Parameters. They tell the function what to do.
  - What do they mean?
    - What is x? The horizontal position.
    - What is y? The vertical position.
    - What is "string"? The text we want to show
      - What do the parameters do? They set where and what to draw! Whodathunkit?
Shall we try to make it work now? We've found where to put the code and how to make it work. So do it. One thing you have to be sure is that the the variable exists so make sure that it's set in the collector object at the start.

Does a number show? Is it a zero? If so that means that it's working but you have no rupees.
 - How do you get rupees? - You collect them!
   - How do you collect rupees? - Link touches them.
     - What does "touching" mean in GM? - A collision between two objects.
So we need a collision between the collector and the rupees. It should be simple enough to do. Collisions are so easy that they're their own event.
 - What needs to happen on the collision? - We need to get rupees and the rupees need to disappear so you can't get them twice.
   - Disappear? - Destroy
     - Destroy? - Look in the manual ;)
   - What about adding rupees? - That needs to happen too?
     - What records the rupees? - The variable we set up before.
       - How do you add to a variable? - Simple: variable += amount to add

It's all pretty much laid out and a very basic rupee system should be in place. Try it out and see if it works. If not, we get to have more fun. You get to debug! Debugging is pretty much the same process, except a lot of the time you get an error to go with it. Pay attention to the errors. They will tell you exactly where it's running into the problem. It will give you the object, the event and the line number in the code. Then it'll tell you the problem. Remember that the place it gives isn't necessarily the place that causes the problem, but rather the place that it affects. First, go straight to that line. Using what the error told you, look for the problem. Sometimes there's just a typo or a missing bracket. Sometimes it's more complicated.

Whether you get an error or it's just not working right, you need to ask yourself certain queations, "what is the problem?", "Why is it happening?", "What other objects/scripts affect this?", "Is the problem somewhere else?", "What should happen?", "What isn't happening?", and go through a similar process of questioning and searching to find the answers.

If you looked through the manual and are still totally oblivious to why something doesn't work or how to do anything, leave it alone for a couple hours, or better yet sleep on it. Then, try it again. Sometimes leaving it and trying it again with a fresh mind actually does work wonders.

Finally, when all else fails, come here and ask for help. You should only go to others for the answer as a last resort. At first it might seem like there's just too much you don't know, which is discouraging. But you should let it get to you since it's normal. And true for that matter. At first you don't know much. However, all it takes is the manual as some actual thought. Slowly but surely the questions diminish until the only ones left are because something is so terribly complicated that you need a master to help. Doing is the best way to learn, learn makes you better, being better means making games is easier.

2
Feedback / That message used as the main page...
« on: October 15, 2006, 05:49:10 pm »
Isn't it about time that was eliminated? It's kind of annoying to have to click that every time instead of going directly to the forum.

3
Entertainment / Prey - My thoughts on the Demo
« on: June 26, 2006, 07:43:20 pm »
Up until recently I hadn't heard anything about this game. Then I was told the story (which is sort od ridiculous), got intrigued and downloaded the demo. In case you don't want to read the rest, I'll tell you here: it's AWESOME!

The story is basically about a Cherokee garage mechanic named Tommy, along with his grandfather, girlfriend and a bunch more random people who don't matter, are abducted by aliens known in Native American legends as the Dark Spirits. Aboard the ship, they see all sorts of weird and terrible !@#$%. Luckily, a saboteur causes an explosion which frees Tommy. He then has to search the ship and fight the aliens, along with awakening the spiritual powers of his ancestors within him, in order to save the world!

See? It's a bit of a ridiculous right? That's what I thought. The demo plays out the first bit of the game and really gives you a good feel for it. I must say that it all ties in well. The two coolest, and most unique parts of the game are the portals which are how you tend to get from one room to another and the wallwalking.

The portals are basically 2-dimensional windows into another place. You can only see them fro mthe side you would enter, but when you look through you see what's on the other side. And I don't mean there's a picture of something. It' as though the room actually is there! If you look from and angle, you'll see into the room at an angle. That's just awesome. A lot of the time they're one-way portals meaning that once you're through, you're through and that's that. Sometimes they're two-way. Sometimes the exit of one portal is in view of the portal itself and, here's the cool part, when you walk up to it and look through, you can see yourself doing everything in real-time. You can shoot through the portals as into the other room and, consequentially, shoot yourself. Trust me, I tried. It's not healthy. But it's damn cool! The only downside about the portals is that every now and then one will just appear, a guy will pop out and the portal will close leaving you with a shooting alien that appeared out of nowhere.

Then there's wall-walking. You first encounter it when you see aliens walking sideways and upside-down and stuff. Then you eventually get to these glowing ramps that you can walk on. The ramps curve upwards and sideways and upsidedown. Sas long as you're on the ramp though, you're able to walk and do everything normally. If you kill a guy that's on one of the ramps, it lets go and he falls. I thought that was sort of cool. There are also the sort of switches at one point where if you shoot them, the gravity within the room changes so that you fall towards them.

Another neat thing is that when you learn how to do the spiritual stuff, you're able to go into "Spirit Mode", which is basically you, but blue, walking around with a bow and arrow. While you're like that, your body is vulnerable, but your spirit guy is invisible and able to kill guys without them seeing you. You can also go through force-fields and stuff to get places. Sometimes wierd little invisible bridges will appear which will allow you to get places you couldn't normally. A final perk is that you also get a bird-guide named Talon who follows you around sometimes giving you hints and turns red and attacks when a bad guy pops up. The only downside is that the gravity things don't work when you're all blue spirit-y. Also, you have to keep your spirit charged in order to shoot arrows. You do that just by collecting the souls of dead guys.

Finally, there's death. When you die you go to this wierd death world where you have to shoot ghosts to regain health and spirit before you go back into the real world. When you go back, there's a hole in the ground where you can look down and see your body lying dead just where you left it. Once you're back you pop up with a certain amount of health and keep on fighting.

The multiplayer is also good though. It consists of playing in one of 2 levels in either team or normal deathmatches. That proved to be fun. Overall, the single-player demo was just under an hour of gameplay, but it was seriously fun. I'm probably going to buy it when it comes out.

WARNING: The game does have a lot of blood, and a hell of a lot of swearing. I noticed you're able to turn off the swearing in the opitions but I didn't notice anything about blood. I'm just putting that out there for people who don't like all that vulgarity.

4
Debates / Debating rules! -=Follow or die=-
« on: April 10, 2006, 01:56:02 am »
Alright, this section is sort of special and has some rules that don't necessarily apply elsewhere. While arguing debating, please keep these in mind. Using them will just make it more enjoyable for everyone.

1 - Ad Hominem: "Ad Hominem" arguments, derived from "Argumentum Ad Hominem" which means "argument to the man", is one of the most re-occuring problems in most debates that I've seen. Basically it is an argument that has no logic behind it and is just an attack on the opponent. Such an argument is NOT valid, and can/will be ignored or removed.

In depth, what an ad hominem argument usually consists of is that someone says something, but they have something questionable about them, therefore their argument is deemed invalid.

Example:
"You're opinion on legalizing marijuana is invalid because you smoked pot".

This is not true. In the example, smoking pot may have given them a bias towards their cause, but all that means is that they think they're right. It doesn't make what they say wrong. There are also other forms which are more attack form than others, and really have nothing to do with the argument

Example:
"You're wrong because you're an idiot!"

While someone's low intelligence may lead to them saying something untrue, it does not mean everything they say is false.

2- Circular Logic: Basically, it's saying things like "Y is true because X is, and X is true because Y is." and other things along those lines. These aren't valid arguments, and really only prove that you can formulate complete sentences. Don't do it.

3 - Lack of proof: That's just not right. Saying things like "I am right because of an invisible, unobservable, unnamed force that makes everything I say true". I mean, come on! You don't really need to prove it, but you have to be able to back up your claims. Don't say "I'm right, you're wrong and that's the truth.". Quite frankly, that's NOT the truth. You should always be going along the lines of "I'm right because of blah blah blah". Be sure to avoid the previous two point while doing this though.

4 - Read everything: Don't just jump into an argument and throw your view in. Read the rest of the posts. I know, sometimes there can be some long ones, but it's just REALLY irritating when someone jumps in while the discussion is in full swing and simply restates something that's either been proven wrong or already stated. If you don't want to read everything, then you shouldn't post.

5 - Don't re-create topics: In this board, old topics CAN be picked up again if there are new points on one side. Before making a topic, check too see that it's not already there. If it is, just post there. If the old topic was locked, then don't start it again without permission from a mod or something. Odds are it was locked because it broke into a flame war, because one side was defeated beyond recovery, or because it shouldn't have been made in the first place.

6 - RELIGION: Alright, there are a couple of things here...
A) I want to see NO evangelism here. That means no religion is the "right" religion, no religion is better than another, and no one should try convert anyone to their religion. And never, under any circumstance, attack another person's religion.

B) Religious text is NOT a citable reference, and not to be used as fact. For example, if you are discussing murder, you cannot say that it is wrong because "God said so in His 10 Commandments!". That's all good for those of you who are christian/jewish and follow the Old Testament, but what about Atheists? Sure, they probably don't believe in murder, but they don't believe in your God either and to them, that's about as valid to them as saying "The purple polka-dotted elephants told me that a trampoline is a divine artifact.". It just doesn't work for everyone. So, if religion were to be used as a valid argument then I could make my own religion that proves my beliefs beause the Great and Mighty Cheese-Steak has proclaimed it so, and that's just not right.

C) Although religion is not to be used as an argument, it itself can be debated. For example, one could debate the interpretation of a certain passage in the Bible, or the validity of a certain story (the Noah's Ark story is always fun!). So long as you don't go against Rule 6A, then the topic will probably be allowed to continue.

7 - Politics: Alright, this is almost as touchy as religion, so I ask that you follow pretty much the same rules as #6, only replacing "Religion" with "Political Party". It's practically the same thing. People believe in their party. Their party has certain beliefs other parties don't, and they try to enforce these beliefs on other people. Face it, politics are practically today's religion, so again, be careful.

8 - Don't take it too seriously: We want this to be a place where people that enjoy debating can do so peacefully. So, even though you may feel strongly about a certain topic, don't take what people say to heart. Instead, just laugh it off and throw your opinion back into the ring. When you have a friendly debate where no one gets truly angry at the other side, it can be a lot of fun. Trust me, I've been in a couple. To help enforce this, I suggest doing things like commending the opposite sides on a job well done. If someone has just made a long post and proved his point beyond a shadow of a doubt or disproved most of yours, instead of saying "YOU !@#$%! YOU'RE WRONG!!!", say something like "Wow! Good job! I'll be back with more to shut you down though ;)". And yes, the smileys can make all the difference.

9. Please refrain from using senseless, offensive language.  IE. Swearwords.  If you can't show enough self-control to refrain from using these, then you may not be mature enough to handle this section.

10. Refrain from using straw man arguements.

Example: Person A: I think God is real. (X)
Person B: God is omnipotent. (Y)
Person B: If God is omnipotent, he could prove himself to us as being real but he doesn't so he isn't real.

Basically, it's taking someone's statement and using it against them in a completely irrelevant matter.

Example 2: Say you are debating 'abortion', and you group those against abortion as the same.  Thus when one person slips in their words, you credit the statement to the entire group.


So, all-in-all, keep it clean, nothing below the belt and wait in your corners until the bell.

5
Entertainment / V for Vendetta
« on: April 02, 2006, 06:01:22 am »
I saw it today... well... technically yesterday, but still :P. It was pretty good too! Definately not as action-oriented as the previews make it seem. The ideas behind it are very well displayed. Although, I would have liked it more if they had shown more of the detective. Even if it does mean making the movie longer.

Pages: [1]

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



Page created in 0.265 seconds with 34 queries.

anything