how do you program gun fights?

Started by andwii, Tue 01/08/2006 00:50:12

Previous topic - Next topic

andwii

 hi just wondering how do you program gun fights and have a chance of you dieing. also how do you program blood???

Akumayo

Be more specific please.  Are you looking to program a shooter game?  Simple bullets flying across the screen?  We cannot help you if we can't address your problem directly.
"Power is not a means - it is an end."

andwii

I mean yes a shooter game. with lazers. I just dont know how to program it...

R4L

Animations and objects. Seriously. All you have to do really, is make an object with a bullet sprite. Then have it move to the character.

(not sure if usable with newer AGS, im a oldie  :P)

MoveObjectDirect (int object, int x, int y, int speed) -blocking command
AnimateCharacter (CHARID, int loop, int delay, int repeat)

After the bullet moves to the coordinates (which would be the character who is getting shot's coordinates) you play an animation, which would be your guy falling and blood coming from his body.



Dan_N

#4
Hello.
I don't know if this will help, but I have an ideea on how you could pull this off.

First you make a button that will change the cursor to Usermode1 which you might name lets say... Shoot. Then in each of the enemies' interaction window you'll have the condition Usermode1 (Shoot) where you can add more conditions and actions. You might also need a variable like HaveGun and an Ammo variable as well. If HaveGun=0 then your character doesn't have a gun thus it won't shoot. However, if HaveGun=1 then your character will shoot and Ammo=Ammo-1. Of course, you could extend this and if HaveGun is larger than 0 (HaveGun>=0) then you can program damage and make different weapon types. Ammo is quite easy, just add (interaction window) a "run script" action and write there if (ammo>=0) then ..., where ... is what you want to do (ammo=ammo-1, enemy.die, player.shoutYeeehawww, I don't know). Or, to make it simpler, don't add HaveGun and make the player have infinite ammo. Explore all possiblities. I myself will try to implement this because I want to make my adventure games more interesting.

As for lasers... I don't know, maybe there is a DrawLine or something command in AGS, but I haven't yet found it. Could of swarn I saw it though... ??? ... Oh well...

I hope this helps you, if not, doesn't hurt to input, does it? Oh, and if I'm wrong anywere, please correct.

Khris

andwii:
Is this going to be a 1st person game? Or a platformer? Top-down view?
Realtime? Turn-based?
Using characters? Objects? RawDraw commands?

BE MORE SPECIFIC.

andwii

it is going to be a Top-down view

R4L

You could definately use RawDraw functions to achieve a Laser Beam effect.

Khris

Quote from: andwii on Tue 01/08/2006 00:50:12just wondering how do you program gun fights
This is probably the main problem you have.
There's a game idea in your head, but you don't have any idea about how to even start.
And you want to do it with an adventure game engine.

Explaining how to do a top-down shooter with AGS isn't a matter of two or three sentences, and you seem to be a beginner when it comes to AGS and/or programming.
I doubt that it would be helpful to post some kind of tutorial, aside from the fact that it would be pretty lenghty and not much use to a beginner anyway.

Experiment with AGS, get a basic grasp of how the engine works and what can be done using characters, objects and RawDraw functions.

Start simple.

monkey0506

Quote from: KhrisMUC on Fri 04/08/2006 05:39:00Start simple.

It's my experience that "start[ing] simple" simply isn't the way to go. When I started my first project with AGS I had never done any computer programming ever. Now more than two years later I have yet to release a playable demo of a proper game. I consider it a huge success though because I have learned a lot about programming and AGS.

I started off with Proskrito's MI template back with AGS 2.62 and decided it simply wasn't what I was looking for. So I decided to program it myself. I didn't know where to start, so I started copying Proskrito's code, reading the manual, and posting in the forum a lot. I got a pretty decent working MI system after the first six months, but then I decided to work on the dialog system. That's been a long time under development, but it has just made me have to work harder to come up with new ways to try and make it work the way I want.

Anyway, my suggestion for you andwii is to read the manual entries, and then just screw around with AGS. Type the functions in to the script. Find out where you can and can't put it. Find out what happens when you put it here, and what doesn't happen when you put it there. And you'll be a programmer in "no time" :=.

And asking questions like "how do you program a gun fight" isn't the best way to go about things. First you should read the manual and check the forums. After you've done that try to think how you're going to use AGS to make it all come together. Will you use objects, characters, dynamic sprites, or perhaps the raw draw functions? Once you have a basic idea of the direction you want to go, take a whack at programming it. After you've tried to do it yourself, if it works, then great, but chances are you're likely to encounter some errors.

If you can't make heads or tails of the errors, read the manual to make sure you are using the functions correctly, and search the forum for similar problems. If you still can't find what you're looking for, then start a thread on the forum and explain what you've done to try and work through the problem. Because what you've done here is asked for someone else to do all the work for you. Sorry andwii, but the "Make my game" feature of AGS is really just a joke.

Oh, and if all else fails, READ THE MANUAL!  ;)

Khris

monkey:
I figured if somebody asks how to "program blood???", advising him to start simple would be the best thing. (Mainly because a question like this clearly indicates the absence of programming experiene (no offense))
And IMO, your suggestions are simply the long version of "Experiment with AGS, get a basic grasp of how the engine works..."
What else would one mean by "start simple?"

But let's not dwelve into a discussion about how to word things. :)

andwii: To make a long story short, implemeting any kind of fight engine requires advanced programming/scripting skills.
Once you've learned the basics, you'll find that you won't be as stumped as you are now.

Dan_N

Quote from: KhrisMUC on Fri 04/08/2006 08:51:26
andwii: To make a long story short, implemeting any kind of fight engine requires advanced programming/scripting skills.
Now, krismuc, no offense, but i feel compelled to disagree.
All andwii needs to do is to look up a few basic commands in the manual and he might get it. The rest is just some simple scripting and graphics. I explained early a rough way of doing this.
And what's the "program blood" stuff about?
i believe that what i sugested earlier can be applied to either first person view, top-down view or platform view (from the side).
Or, andwii, if you intend on making it JUST a shooter, take out the buttons (except for maybe save,load,quit and about) and try to find one of those "Left mouse click, right mouse click" plug-ins, although they may be to advanced for you. On this notion i agree with krismuc and second the motion for andwii to learn more about AGS and maybe make an adventure game first to get the ropes. Perhaps enter the MAGS (that's what they're there for).
All those in favor say "aye".

monkey0506

Well the blood would really require no programming. That's all spriting. Get a graphics editing program, i.e., M$ P4int, draw the sprite, draw the sprite with blood on it, continue drawing all the frames, import them into AGS, and put them in a view.

From there you would have to call AnimateCharacter but that is a pretty general function and doesn't actually have anything to do with "making the blood" rather just telling the engine to use that animation.

And khris I just like to take the long way around to try and make everyone but myself look wrong! :D

"Opinions are just immunity to being told you're wrong." - Relient K

The Book

 Creating games in AGS isn't done via programming, it's done via scripting. Don't mistake the two. Programming requires you to create your game from the ground up, taking care of every single detail. Interfacing a game engine through scripting language is a piece of cake when compared to that.

  Andwii: I'd suggest you to use data structures to describe positions of bullets and/or enemies, and - as others said - raw draw functions for rendering. You'd have to create a custom rendering loop using the script commands. In the "Player enters screen (after fadein)" method add RawSaveScreen() command, then use RawRestoreScreen() in the "Repeteadly execute" function to clear the screen after each rendering cycle. The rest is up to you.

  Scripting in AGS is a piece of cake, believe me. Once you overcome the initial anxiety it becomes a walk in the park.

Khris

Right, I mean, why don't you send CJ a PM and tell him this forum just became obsolete...
He really should replace the link with "Overcome your initial anxiety already!!1" ;)

Dan_N_GameZ: By "advanced", I mean something more complex than "player.Walk(x,y); Display("Heh.");"
I've been programming (and scripting) for over ten years know, and believe me, nothing is that easy.
It happened to me more than once that a thing that looked easy at first turned into a scripting nightmare.
Programming e.g. a platformer might seem really easy, but have you ever done it? Or tried to? Then you know what I'm talking about.

Dan_N

Actually, Kris, yes i did try. The bloody thing is still on my hard drive somewhere, half finished...
The gameplay is finished, i just didn't get to finish all the levels... Graphics weren't the strong point, but it worked nicely. You could walk left-right, shoot (with different weapons, you would have ammo and reloading), jump, the problem was that there wasn't very animated, except for the only sprite of an object moving that is...
Program-wise, it was very easy, but it came out a VERY big program... So i abandoned it...

And andwii, if you really want to make a shooter, try finding another game design tool (for example Game Make on gamediscovery.com which is quite easy to use and i myself use it for side-projects).

Ashen

OK enough, guys.
Please focus on the actual question at hand - while most of this stuff is good general advice, this isn't really the place to be discussing it. Go to PMs, or start a thread in General Discussion (if there isn't one already).

andwii, to summarise:
Do you have anything coded yet (e.g. how are you handling movement - keyboard control, or the default mouse control)? Think about what you want to achieve, look up the commands people have already mentioned, read the rest of the manual, and see if you can make a start by yourself. If not, or if you've already tried, post back giving DETAILS about what you want, what you've tried, why that didn't work, etc. While a top-down shooter of a sort can be made in AGS, Khris and Dan raise good points - it's a bit complex for a first project (start simple), and you ultimately might be better using a different, dedicated, program to make it.
I know what you're thinking ... Don't think that.

Kirota

Ok can some one give me a simple answar how do u make a gun that can shoot plz explain cuz i just started and finished the tutorial and it didn't tell me.

Ashen

You've asked the exact same question in this thread - please stop crossposting like this. Just have a bit of patience and wait a reasonable amount of time before asking questions again.

To restate what I said in the post before yours: there really is no simple way to code gunfighting in AGS, it's not what the engine was designed for. It's possible, certanly, but you'll need to be quite familiar with AGS and its coding language to make it work. (Not to mention there are many diferent ways it could be done, which makes it even harder to give a single, simple answer.)  For now you can either work on some more basic stuff until you ARE comfortable enough and the code people have given makes sense to you, or you can find another program that's MEANT for the games you want to make.
I know what you're thinking ... Don't think that.

Kirota

#19
No!! Im not even in that thread!!!

All I'm asking is some one tell me what to click where how and what to type to make it so that there are people you can fight and that you can pick up a gun and wield it then shoot bye either hiting spacebar or clicking on what you want to shoot!

SMF spam blocked by CleanTalk