[QUESTION] GETTING SHOT AT - WHEN IN ENEMIES LINE OF FIRE

Posts

Pages: 1
I've recently put to work my own take on kdb424's Shooting Engine for RM2k3 for a new project I've started to re-create the Original 'Halo' in RM2k3. So far - everything is working out fine and I haven't needed much help.

I tweaked the engine to allow the following actions:

# can Pickup weapons on the floor with a full clip of ammo.
# If he already has the weapon he picks up just the ammo - unless he is Max'd out on ammo.
# can Swap his current weapon with one on the floor.
# can Switch between 2 held weapons.

The actual shooting part of the engine is thankfully easy enough for me to understand - This is actually my first step into tracking event Positions and the like...

--> The enemies die with a 1-hit-shot... So I suppose I just need to go in and develop a sort of - Hit Number, before running the code to destroy the enemy... I'll do that later.

-----> What I'm trying to decide upon, is how to go about allowing the ENEMIES to shoot back at the player... I can understand perhaps drawing an invisible line of fire on the floor that forces an animation and lowers my health mabey? But then the enemy needs to be standing still...

The other way, I would believe - involves using the Hero and Enemy's tracked X/Y positions to check if the Hero is in the enemy's current facing line of fire - and a specific distance...
-> But, I don't quite know how to do that...

Can anyone offer some help or advice?
Doh, just answered this on Gaming World...

author=Melch
well, for my (lame) shooting game, I had the mobs event call Move Event, and set the move to Move Towards Hero. So as to give the hero time, I put a Wait event after the move, to give the Hero time to run around without the mobs being completely on his toes. The longer the wait, the slower the mob is. I tried slowing the events move speed, but that didn't give me time to "shoot" at the mob since he was always moving. (maybe that will work better for you then it did for me though.)

To go into your game, first you'd need to add a Face Hero to the Move Event also. I'd add the Condition Branch's to check for matching X or Y before the Wait. That Wait would also make it so there is time between shots, allowing the Hero to get out of the line of sight. Maybe put a Switch to ON if X or Y matches, and then have a second page for the shooting, so you can put a longer Wait in there then the Move Event. Just make sure to turn OFF that Switch if the X or Y doesn't match anymore.

Also, I was thinking about "proximity" to the mob. You know, the mob doesn't "see" the hero until he's closer. You could do a check within the X, Y branch that if the hero is + or - 10/15/20 of X and Y, that he's within range to pull the mobs attention. Just a thought
Pages: 1