[Include] FCNPC A.I.
#1

FCNPC A.I.
Previously know as "FCNPC Boss like World of Warcraft", but this include is capable of much more than just that. Which is why I decided to change the name.
Introduction:
This include extends on the FCNPC plugin by adding an artificial intelligence system to the NPCs. It provides a wide range of functions and callbacks which allows you to customize nearly anything about the state or the behaviour of the NPC. One of the most notable features is allowing the NPC to have more than just the standard 100 health, say for example 1 million. If however you simply want a plug and play solution, there are also default settings present which makes creating an intelligent NPC as easy as using 1 line of code. Once you get the hang of it though, you can create some pretty impressive NPC systems.

Easy plug and play example:
You can customize a lot if you want to, but you certainly don't have to utilize every function. The simplest use consists of just creating the NPC, spawning it and letting the include handle everything else. The following example filterscript shows how to do exactly that.
Code:
#define FILTERSCRIPT

#include <a_samp>
#include <FCNPC>
#include <FAI>

#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
	FAI_UseDestroyNPCsOnExit();

	new npcid = FCNPC_Create("BigSmoke");
	FCNPC_Spawn(npcid, 149, 1086.9752, 1074.7021, 10.8382);
	return 1;
}
#endif
The FAI_CreateBoss and FAI_GetBossNPCID functions are provided by this include. The FCNPC_Spawn function is provided by the FCNPC plugin. This shows that you can still use the FCNPC functions as normal.

As you can see, every function of this include is prefixed with FAI_. An NPC created with this include is called a Boss, which is just a remnant from the first implementation (see below). It doesn't mean that you can only create bosses with this include! Normal NPCs without the extra health or abilities work just as well. So don't be put off by the naming scheme.

More advanced examples:
This include provides more than just a simple A.I. system. You can do a lot more than what it looks like at first. The following examples show that it is capable of much more.

MMORPG-like bossfight

Description:
This example was the first script I made with this include. In fact, it was written before I decided to hide the complexity in an include so it would become much easier to use and release it on the forums. This script had the goal to create a bossfight like in the popular MMORPG, World of Warcraft (WOW). It uses most of the features this include provides, including casting spells, showing the healthbar, ...

Video:
A demonstration can be seen here. Demonstrations of earlier versions are present as well.

Download:
If you would like to play this yourself, you can download it here. It uses Incognito's streamer for objects and pickups.

Leatherface/Jason Voorhees/Michael Myers

Description:
This second example script shows that you don't have to use every feature that is provided to add a nice boss-like script to your server. It had the goal to create a horror-like bossfight like you see in many of those 'Leatherface in GTA:SA' videos in which a strong NPC with a lot of health attacks you when you approach it. It is a bit of a mix of The Texas Chain Saw Massacre, Friday the 13th and Halloween.

Video:
A demonstration can be seen here.

Download:
If you would like to play this yourself, you can download it here. It uses Incognito's streamer for objects.

Single-player-like co-op mission

Description:
This script shows that with creativity, you can create something very impressive. It had the goal to create a mission in the style of Rockstar and GTA SA, but one that you can play with more than just 1 person.

Video:
A demonstration can be seen here. Demonstrations of earlier versions are present as well.

Download:
The script is still being worked on. It will be released when it is finished.

Other scripts:
Have an impressive script you want to share? Don't hesitate and post a reply on this thread! I really want to know what people can come up with by using this include.

Documentation:
The workings of every define, function, callback or feature is extensively explained on the wiki.

Download:
The latest version can be found on the releases page.

Bugs:
Please report any bug with detailed steps on how to reproduce it.

Suggestions:
If you have any constructive criticism or suggestions, please share your opinion.

Possible upcoming changes/features:
Planned upcoming changes can be found on the issues page.
There are some other things left that I want to implement, but I always get new ideas, so the list keeps growing. The following list items will be implemented someday, but I can't give a specific date or priority.
  • Spell mana.
  • Spell range.
  • Spell cooldown.
  • Status effects (buffs and debuffs).
  • Status effects stacks.
  • Party/raid-like system.
Changelog:
See changelog.

License:
See license.

Credits:
Many people have (indirectly) contributed to make this system possible. See credits to see who.
Reply
#2

That's really creative, I really love the idea of making custom Quests on the game where you do have to be in group to complete, +8reps
Reply
#3

Quote:
Originally Posted by n0minal
View Post
That's really creative, I really love the idea of making custom Quests on the game where you do have to be in group to complete, +8reps
Thank you very much . With the tools I gave, you could even script a whole Dungeon or Raid.
Reply
#4

The spells dude! +rep
Reply
#5

Quote:
Originally Posted by Jpew
View Post
The spells dude! +rep
Yeah . You can script a spell with pretty much any outcome you want.
Reply
#6

Would be cool if you give bosses New powers such as spell smokes and even blind the players
Reply
#7

Wow.
Reply
#8

Quote:
Originally Posted by n0minal
View Post
Would be cool if you give bosses New powers such as spell smokes and even blind the players
That is currently possible by creating a new spell with WOW_CreateSpell(Full) and when WOW_OnBossStopCasting gets called you create the smoke object at the XYZ coordinates you want. Take a look in the example script on how the spells shown in the video work. It's easy to adapt the behaviour to your needs or to create a new spell entirely.
Reply
#9

This is a great release, you've put much effort in it !
Reply
#10

I was waiting this release, nice!
Reply
#11

Good job!
Reply
#12

Amazing
Reply
#13

Leatherface/Jason Voorhees/Michael Myers

I have added a second example script which shows that you don't have to use every feature that is provided (such as: casting spells, showing the healthbar, ...) to add a nice boss-like script to your server.
It is a bit of a mix of The Texas Chain Saw Massacre, Friday the 13th and Halloween.

Video:
The script can be seen in action here.
Reply
#14

This is pretty badass, I love the work you put into it.

The function names could be more generalised. Less World of Warcraft. Less "Boss", more (a word for special, controllable player... but not "NPC", maybe "Bot"). Less "Spell", more "Ability". That's just how I would've did it.

That would help people understand what this include can do besides your WOW example. It is capable of much more than WOW.
Reply
#15

Quote:
Originally Posted by Crayder
View Post
This is pretty badass, I love the work you put into it.

The function names could be more generalised. Less World of Warcraft. Less "Boss", more (a word for special, controllable player... but not "NPC", maybe "Bot"). Less "Spell", more "Ability". That's just how I would've did it.

That would help people understand what this include can do besides your WOW example. It is capable of much more than WOW.
I have to agree with you there.
Unfortunately the naming part could've been done better. "World of Warcraft", "Boss" and "Spell" might be a bit off putting for some, even though you can do a lot more things with this include than what the title might encompass. The reason I first thought of WOW and Boss-like mechanics, is because, well that's where I got the idea from to make this include.

I decided to create this second example to show that indeed you can do a lot if you want to, but you don't have to utilize every function (getter/setter). In fact, you can create a "Boss" with just one line and let the inlcude handle everything else:
Code:
new npc = WOW_CreateBoss("BigSmoke");
I am working on a zombie-like script in which sometimes a special infected spawns (see L4D2). Could you do this by writing everything yourself? Yes, but using this include would reduce the code you would write to just a few lines.

I agree that the naming should be changed. Although I can't really come up with anything that would encompass everything this include is capable of, without generalizing too much. This include adds functionality to FCNPC, just using "Special NPC" is in my opinion a bit too vague, because that could mean anything.
Reply
#16

Quote:

This include adds functionality to FCNPC, just using "Special NPC" is in my opinion a bit too vague, because that could mean anything.

Yeah, I definitely see your point, I couldn't think of much either. I'm still going to try to think of names in the meantime.
Reply
#17

This is pretty awesome lol, I'm going to use this and variations of it on my server.

Great job + rep.
Reply
#18

THIS IS FUCKING AWESOME!

EDIT: I hope the aggro feature comes true!
Reply
#19

FCNPC Boss 1.0.1

Just some changes to be conform with FCNPC 1.1.0.

Changes:
  • Added check to see if MapAndreas was already initialized and don't initialize again when it is
  • Added default values for the WOW_SetBoss...Info methods
  • Added extra checks to prevent unnecessary FCNPC_GoToPlayer/FCNPC_AimAtPlayer/FCNP_MeleeAttack calls
  • Added some extra checks FCNPC_IsSpawned checks
  • Changed default speed to be eqaul to -1.0 (see FCNPC 1.1.0)
  • Changed default ranged attack delay to be eqaul to -1 (see FCNPC 1.1.0)
  • Fixed WOW_SpellToString spell name default color
Download: Download link.
Reply
#20

FCNPC Boss 1.0.2

Changes:
  • Changed default move speed to MOVE_SPEED_AUTO to be conform with FCNPC 1.1.1.
  • Added individual useMapAndreas setting.
  • WOW_USE_MAP_ANDREAS is now a global value that determines if MapAndreas is used by any boss.
  • Refer to these wiki pages for more info: click and click.
  • Updated example scripts to handle the changes.
  • Updated credits.
  • Removed colandreas upcoming feature, since it will be implemented in FCNPC 2.0.
Download: Download link.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)