Enemies

Started by Bad Voo-doo man, Wed 23/02/2005 01:52:01

Previous topic - Next topic

Bad Voo-doo man

Ok, I've figured out how to have health going with an npc, and main char. just using global ints and stuff, but for actually having the enemy attack I used the FollowCharacter and FollowCharacterEx, but all that really does it just move the "enemy" (i.e. NPC) to the the main character, and then I have it check to see if they are colliding, and if they are i subtract health from the main char.  To see if you are attacking the character, for all the anis used i just set an int to 1 and if your not "attacking" to 0.  if your attacking and your colliding then subtract from npc not you...is there a better way to script out the enimies so they behave more like the ones in real games (zelda, etc.)?

Thanks in advance
<img>Image Comming Soon!</img>
The Fall of Reach (A Halo fan game)
STORY: 100%
GRAPHICS: 2%
CODE: .56%

Ishmael

That seems a good enough way for starts...

Of cource, you can set up checks for character distances (having a "bounding box" inside which standing enemies inflict damage) using the character[CHARID].x and character[CHARID].y variables, and the character[CHARID].loop variable to see what direction that characters are facing while attacking, and if there is an enemy (for the player) or the player (for the enemies) in their area of effect...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Ashen

You might find these functions handy:
AreCharactersColliding (char1, char2);
AreThingsOverlapping (thing1, thing2);


AreThingsOverlapping might be better, as it allows you slightly more control over how close they are before it's triggered. AreCharactersColliding uses baselines, and the results are sometimes a little odd (check the manual for more details).
I know what you're thinking ... Don't think that.

Bad Voo-doo man

Thanks you guys, i'll try out both of your ideas, and then get back to you
<img>Image Comming Soon!</img>
The Fall of Reach (A Halo fan game)
STORY: 100%
GRAPHICS: 2%
CODE: .56%

Kinoko

It's one of those tough things because typically enemies in games like Zelda, etc all move in different ways. A really good way to get ideas is simply to play one of those games and watch the way enemies behave. Certainly, using bounding box collision to detect when you're near an enemy then having him come at you is a good one.  One of my enemies is simply on completely random movement so it never zeroes in on you, as such (it's a mouse though, so it makes sense).

Everything you came up with about attacking is exactly what I have, pretty much, so if you find a better way, I'd like to know it ^_^

Bad Voo-doo man

I was thinking...have the enemies walking on a "path" and then when the player steps on a certain region they "see" him and then go after him..using a bounding box like you guys said for the detection part of the attack
<img>Image Comming Soon!</img>
The Fall of Reach (A Halo fan game)
STORY: 100%
GRAPHICS: 2%
CODE: .56%

Nexic

I think you are better off using a different program if you are trying to make a real time combat game. Turn Base RPGs can work with AGS, but something that intense isnt really. At least, it will be a lot of work and you probably still won't have anything that great.

DoorKnobHandle

:) Hey, I am working on a real time strategy game... it is possible to do this real time stuff in ags but it requires a really high scripting skill...

Bad Voo-doo man

having it stay as an RPG..where they always walk around..not turn based :)


i.e.
---------------------------------
                       O
- - \                 
     - - - - - X   

--------------------------------
If the player was walkin on the path ( - - - ) when they step on region x, enemy "O" will 'see' them and run over to them and follow them around
<img>Image Comming Soon!</img>
The Fall of Reach (A Halo fan game)
STORY: 100%
GRAPHICS: 2%
CODE: .56%

SMF spam blocked by CleanTalk