Fate of atlantis style fight

Started by MacGyver12345, Thu 27/08/2009 15:30:38

Previous topic - Next topic

MacGyver12345

how can i make a fight scene in the game like in fate of atlantis when you fight the nazis with health and energy and stuff like that?
I GOT A FEVER, AND THE ONLY PRESCRIPTION, IS MORE COWBELL!!

Khris

Three easy steps:

-Learn how to program
-realize the engine using AGS's script language
-Done!

Seriously, either ask someone to do the coding for your game (there's an existing thread to do exactly that) or sit down and start with a basic Java or C++ (or even BASIC) tutorial.

Helping you with a specific, advanced scripting problem is what this forum's for, and that's not the same as doing all the work for you, which is the only thing you want, as far as I can see.

You seem to want to create an Indy clone without any knowledge of scripting or even some basic initiative to figure shit out yourself.
Why don't you start simple, create a basic game using the default interface and learn basic scripting first?
Most of us did.

MacGyver12345

actually its a macgyver game,   and i have been trying to figure this out for a while.
I GOT A FEVER, AND THE ONLY PRESCRIPTION, IS MORE COWBELL!!

Khris

Alright, what have you tried so far? What did work and what didn't work?

MacGyver12345

i ment that i looked all over tring to learn how. once i learn that and guis i should be able to do the rest with out much help.
I GOT A FEVER, AND THE ONLY PRESCRIPTION, IS MORE COWBELL!!

Shane 'ProgZmax' Stevens

Fate of Atlantis style combat is incredibly easy to script once you get over the 'it seems difficult' hurdle and just start on it.

In fact, depending on how much effort you want to put into the enemy AI, you can get a basic system up and running with basic scripting (and a couple functions).  Basically, what you'll need to look into in the AGS documentation is:

1.  Keyboard control.  You'll either need a custom function or use the on_key_press default function (with perhaps a boolean variable wrapped around your fight keys so they only trigger when fighting) that checks for certain keys pressed and reacts.  This will allow you to setup the punching.

2.  Basic health management.  Two variables (four if you want to store the maximum values of each) for the player and two for the opponent.  You'll initialize these before the fight and then handle their values like so:

     A.  For the player, when he punches you'll check your section of code (in on_key_press or elsewhere) to see if he hit the enemy.  A quick way to do this would be to use SSH's pixelperfectcollisions module, though you can also just compare character distances.  Note that I'm not factoring blocking or anything, so if you swing at an enemy and they're in range you'll hit them.  You'll basically have a non-blocking animation play here.  Very basic.

     B.  For the enemy you'll need a block of code that's run from repeatedly_execute (or repeatedly_execute_always) during a fight so the enemy can react to the player.  This can be as simple as a random number that has the enemy punch high, medium, or low.   Again, we're keeping things simple.  The player health is subtracted here when they are in range and the enemy throws a punch.  Another non-blocking animation.


Outside of this you'll need at least one more code block in repeatedly_execute (or repeatedly_execute_always) that is checking for a player or enemy 0 health situation.  This is where you end the fight and turn off the fight variable so all of your fight code isn't running constantly. 

Fate of Atlantis also has a stamina variable for limiting how often the player can punch, but for simplicity (and to keep from annoying the player) you can omit it.


If none of this makes sense then you probably need to practice doing simpler things with the engine until you gain some proficiency.

MacGyver12345

I GOT A FEVER, AND THE ONLY PRESCRIPTION, IS MORE COWBELL!!

subspark

Hey ProgZmax - your avatar looks like Mr Button from The Curious Case of Benjamin Button!
Thats cool shit man! :D

Sparky.

Gilbert


subspark


SMF spam blocked by CleanTalk