Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Tips for making shooting NPC's?


DrNova
 Share

Recommended Posts

I'm going to take a whack at making npc's shoot, since none of the real coders seem to want to touch it (not a dis, simply stating none of the real coders want to take the time to do and post it)

Anyone have any tips on where to begin?
I've found the various section in client and server, the "arrow hit", "check arror"(not sure this ones purpose), the npc attack AI, ect. but as I really know little to nothing about VB besides whats visually comprehendable, I'm clueless where to start.

It looks to me like some copying of various part of other subs, as well as a few data additions would be needed, but I have no idea where to start.
Any tips?

(Keep in mind I dont want to make any sort of AI for it at the moment, simply they just start shooting as they move towards you in the normal fashion they hunt down a player)
Link to comment
Share on other sites

I'm doing this for Kreator and Japez's Zelda game.

I'll basically just be doing an area check of the player's position vs. the npc's position + it's range variable. I'll then position it in a place where it can 'shoot' the player.

Of course, you'd need a classic Zelda-style maze where you _need_ to go down a straight line to fight them, otherwise they'll be as dangerous as a small piece of cellotape.
Link to comment
Share on other sites

I want something a little more cheesy.

Basically, I want them to just continue firing arrows while they are moving as normal towards the player.

I dont need checks for location, because as soon as the "attack" stuff is initiated, it should just start shooting.  This will make it a little wild, but I think make for some interesting firefights.
Not fancy, I know, but I cant do fancy(much less crappy)
But this also makes the ease of dodging a straight shopt harder, as if they are turning here and there as they come towards you they are still firing, makes more to dodge.

If someone cant tell me how, I'd pay to have this added
Link to comment
Share on other sites

@robinsafaggot:

> Robin - lol your a 15 year old fag, who looks like a really fugly version of a veronica sister… yeah thats you... black emo hair, lol you look like a chick and sound like one on my forum.

Awww. I never knew you cared <3
Link to comment
Share on other sites

In Aphelion Online i have NPC that shooting spells, but i dunno if this idea you like. I use something like Robin says, and it work good for me (when you add spellanim its looks good).
Just make script when NPCX = GetPlayerX - n (n will be example from 1 to 5) and NPCY, then damage player and use spellanim in that n locations so this will be looking like ship fire to other. That can be looking very nice :)
Link to comment
Share on other sites

@dg1423:

> Well, if I find time, I can add it in for you. Basically you just need to add a sub to the npc move routine and a new bltarrow for npc usage. Not hard, really.

Not recommended if you can't ajust the delay time, if DrNova's game is similar to my game related to time. But very good for games that doesn't require precis timer :)

Here is a tip (mine uses just sadscript and is similar to this):
@Fred:

> Just make script when NPCX = GetPlayerX - n (n will be example from 1 to 5) and NPCY, then damage player and use spellanim in that n locations

-Each single NPC has it's own mana (ammo)
-Each single NPC has it's own 'regen' time (timed/no regen/infinite)
-Each NPC number has it's own shooting delay
-Each NPC number has it's own 'max distance'
-Each single NPC: (kill gets: + mana) |or| (kill gets: + max_mana) |or| nothing

Edit:Oh and for the anim, just use a 'do while' to send an anim per tile until it reaches the target.

Hope this helps,
From: Zananok
Link to comment
Share on other sites

the way nova wants it is very simple Zananok, I know how complicated it can be to develop an actual system for this (I've done it before) but Nova pretty much just wants see and shoot thing. It's extremely easy to add firing rates and arrow types and power gen. The server stuff takes maybe 10 minutes to complete. The harder part is adjusting the clients blting system to show the arrow when it fires, which is still extremely easy. The whole system might take 20-30 minutes to implement or up to 45 for more complex systems. But all in all, it's very simple to do. Hell if I wanted I could throw in an NPC battle scripting system like the one in RPG Maker. (I'll have to take note of that as it's a good idea)
Link to comment
Share on other sites

@DrNova:

> I think splashing animations around would be a resource drain wouldnt it

Maybe, but for me it works fine ;)
@dg1423:

> the way nova wants it is very simple Zananok

Oh,sorry :S
@dg1423:

> Hell if I wanted I could throw in an NPC battle scripting system like the one in RPG Maker. (I'll have to take note of that as it's a good idea)

Nice idea!

Comments,
From: Zananok
Link to comment
Share on other sites

@Zananok:

> -Each single NPC has it's own 'regen' time (timed/no regen/infinite)
> -Each NPC number has it's own shooting delay
> -Each NPC number has it's own 'max distance'
> -Each single NPC: (kill gets: + mana) |or| (kill gets: + max_mana) |or| nothing

Sure, by scripting you can do even more statistics like evasion or random firepower. But if this must be arrow… let it be.
Link to comment
Share on other sites

Problem with scripted nc's, they dont activate unless you make them via interaction.  They cant just automatically run the script.

I'm still going to see if he will implement the arrows for me though, would be much more efficient and more along my desires
Link to comment
Share on other sites

@DrNova:

> Problem with scripted nc's, they dont activate unless you make them via interaction.  They cant just automatically

No… you dont understood. Its not scripted npc.
You can script if there is normal npc in your range then he can fire. Just you must use timers.
Link to comment
Share on other sites

bleh, to messy.
Check if its an NPC that would attack, check for range, check for line of fire, run multiple animations along a direction, check for position and damage if your there….
To messy, I'd rather either get arrows into npc's via source, or if that fails use the source snippet of spell casting npc's
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...