SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 12/07/2016, 01:51 PM   #1
Freaksken
Gangsta
 
Freaksken's Avatar
 
Join Date: Mar 2009
Location: Belgium
Posts: 618
Reputation: 287
Default FCNPC A.I.


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 <FAI>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
	new bossid = FAI_CreateBoss("BigSmoke");
	FCNPC_Spawn(FAI_GetBossNPCID(bossid), 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.
__________________
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.


[Include] FCNPC A.I. - [Tutorial] Speedometer - [WIP] Single-player-like co-op mission - [Other] List of all my work

Last edited by Freaksken; 28/09/2018 at 07:49 PM.
Freaksken is offline   Reply With Quote
Old 12/07/2016, 02:21 PM   #2
n0minal
High-roller
 
n0minal's Avatar
 
Join Date: Mar 2013
Location: Rio de Janeiro
Posts: 4,155
Reputation: 728
Default Re: FCNPC Boss like World of Warcraft

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
__________________
n0minal is offline   Reply With Quote
Old 12/07/2016, 02:26 PM   #3
Freaksken
Gangsta
 
Freaksken's Avatar
 
Join Date: Mar 2009
Location: Belgium
Posts: 618
Reputation: 287
Default Re: FCNPC Boss like World of Warcraft

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.
__________________
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.


[Include] FCNPC A.I. - [Tutorial] Speedometer - [WIP] Single-player-like co-op mission - [Other] List of all my work
Freaksken is offline   Reply With Quote
Old 12/07/2016, 02:34 PM   #4
Jpew
Big Clucker
 
Jpew's Avatar
 
Join Date: Jul 2015
Location: VE
Posts: 91
Reputation: 18
Default Re: FCNPC Boss like World of Warcraft

The spells dude! +rep
Jpew is offline   Reply With Quote
Old 12/07/2016, 02:42 PM   #5
Freaksken
Gangsta
 
Freaksken's Avatar
 
Join Date: Mar 2009
Location: Belgium
Posts: 618
Reputation: 287
Default Re: FCNPC Boss like World of Warcraft

Quote:
Originally Posted by Jpew View Post
The spells dude! +rep
Yeah . You can script a spell with pretty much any outcome you want.
__________________
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.


[Include] FCNPC A.I. - [Tutorial] Speedometer - [WIP] Single-player-like co-op mission - [Other] List of all my work
Freaksken is offline   Reply With Quote
Old 12/07/2016, 03:03 PM   #6
n0minal
High-roller
 
n0minal's Avatar
 
Join Date: Mar 2013
Location: Rio de Janeiro
Posts: 4,155
Reputation: 728
Default Re: FCNPC Boss like World of Warcraft

Would be cool if you give bosses New powers such as spell smokes and even blind the players
__________________
n0minal is offline   Reply With Quote
Old 12/07/2016, 03:16 PM   #7
Ritzy2K
High-roller
 
Ritzy2K's Avatar
 
Join Date: Jun 2014
Location: India
Posts: 1,681
Reputation: 168
Default Re: FCNPC Boss like World of Warcraft

Wow.
__________________
Ritzy2K is offline   Reply With Quote
Old 12/07/2016, 03:22 PM   #8
Freaksken
Gangsta
 
Freaksken's Avatar
 
Join Date: Mar 2009
Location: Belgium
Posts: 618
Reputation: 287
Default Re: FCNPC Boss like World of Warcraft

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.
__________________
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.


[Include] FCNPC A.I. - [Tutorial] Speedometer - [WIP] Single-player-like co-op mission - [Other] List of all my work
Freaksken is offline   Reply With Quote
Old 12/07/2016, 03:25 PM   #9
JustMe.77
Huge Clucker
 
JustMe.77's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 268
Reputation: 63
Default Re: FCNPC Boss like World of Warcraft

This is a great release, you've put much effort in it !
JustMe.77 is offline   Reply With Quote
Old 12/07/2016, 04:38 PM   #10
Whyd
Huge Clucker
 
Whyd's Avatar
 
Join Date: Sep 2012
Location: /
Posts: 438
Reputation: 30
Default Respuesta: FCNPC Boss like World of Warcraft

I was waiting this release, nice!
Whyd is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FCNPC GOD mod bug HELP :( peti784 Scripting Help 0 07/09/2016 04:57 PM
Need help with FCNPC valerastar Scripting Help 1 05/05/2016 07:54 AM
Help Me FCNPC Pagle Scripting Help 0 30/07/2015 06:11 AM
FCNPC help blackwave Scripting Help 1 20/04/2014 03:36 AM


All times are GMT. The time now is 02:31 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.