woutprovost / fcnpc-ai Goto Github PK
View Code? Open in Web Editor NEWA SA-MP library that adds a simple targeting and threat artificial intelligence system to the NPCs
License: MIT License
A SA-MP library that adds a simple targeting and threat artificial intelligence system to the NPCs
License: MIT License
Sir since am unable to compile please I need the amx file thats the only thing holding me back please sir it shows that most things are not defined when I tried to compile
Please sir just the amx that's all am asking for
There's not really any good reason to use custom boss ids. They also create a problem that multiple scripts can have the same ids for different bosses and therefore the callbacks can't distinguish between which script the boss id belongs to. When using npcids this is not a problem anymore. It also removes the need to use FAI_GetBossNPCID/FAI_GetBossPlayerID and FAI_GetBossIDFromNPCID/FAI_GetBossIDFromPlayerID when you want to use an FCNPC function on the boss, which is just an unneeded hassle.
Since FCNPC 2.0 we can use ColAndreas' CA_RayCastLine. Keep in mind situations when ColAndreas isn't included or when ColAndreas isn't inited.
When the NPC is idle, don't aggro when the player is not within LoS.
By default this feature should be disabled.
This stat should specifically be used only when the encounter hasn't been started yet.
native FCNPC_UseAggroLineOfSight(npcid, playerid, bool:use = true);
native bool:FCNPC_IsAggroLineOfSightUsed(npcid, playerid);
Hi sir please sorry to disturb am having errors while trying to compile this
Please help out or give me the amx files
I really need this
Threat, aggrorange and displayrange apply for all players. Some people might want to exclude some players.
When adding this feature, also keep in mind ALLOW_NPC_TARGETS.
Right now textdraws are created for every boss slot. That means also for empty slots. This is a waste and they should only be created when the npc is created and destroyed when the npc is destroyed.
Also, when a 'show only these textdraws' feature is added, only create the textdraws that are actually going to be shown. For example: don't create the castbar textdraws when the castbar will never be shown for a particular NPC.
Don't use a single timer for everything. The amount of used resources should increase with the amount of used NPCs. This means only creating a timer when the NPC is created and destroying it when the NPC is destroyed and don't create everything in advance.
If possible just hook FCNPC_OnUpdate.
~~There are 2 include file.
The release has one include file and the The Source has another include file.~~
Which one to use.
These are things that should be handled by the scripter, not the library
When the NPC is idle, don't aggro when the player is not within a certain viewing angle.
Default viewing angle should be 360.0 degrees.
This stat should specifically be used only when the encounter hasn't been started yet.
native FCNPC_SetAggroViewingAngle(npcid, playerid, Float:angle);
native Float:FCNPC_GetAggroViewingAngle(npcid, playerid);
When an NPC aggroes a player for the first time, alert other NPCs in range.
Alternatively, when the NPC has a target, it will alert any other NPCs in range, until the encounter ends.
Maybe both can be implemented using an enum in which 3 types are defined:
Also need functionality in which we can toggle responding to this alert on or off.
Choose a fitting license for this repository.
I put up this include and alot of error came up.. im on 0.3.7-r2 server. And i also have working FCPNC plugin.
Right now, there are only 2 (implied) states
Most simple A.I. also have these states:
Add main tests, demo tests, or unit tests.
Currently the boss will only switch to another player if his target becomes invalid. You can't for example overaggro right now. The only thing you can do right now is manually switch the target with FAI_SetBossTarget.
The custom create and destroy functions are stupid and should be replaced with hooking the FCNPC functions. The reason I previously decided to use custom functions was because I had long 'constructor' functions that had the possibility to set every variable. Since those long constructors are gone now, there's not really a point to not make it easier and hook the FCNPC functions.
FAI_INVALID_BOSS_ID will be replaced by INVALID_PLAYER_ID and FAI_MAX_BOSSES will be replaced by MAX_PLAYERS.
I should also look into how gmx would affect this change, since NPCs don't disconnect and reconnect on gmx and FCNPC_Create then just returns the npc id. Trying a fs reload doesn't seem to work then.
After 2.0 is stable and released, update this: https://github.com/Southclaws/vscode-pawn
The custom functions are not really needed.
Also look at other possible hooks (FCNPC_AimAt(Player), FCNPC_StopAim, FCNPC_MeleeAttack, FCNPC_StopAttack, FCNCP_SetWeapon, FCNPC_SetFightingStyle ...).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.