[FilterScript] SuperNova NPC System - Streamer, walking, adding NPC with 1 function and more.
#1

SuperNova NPC System Beta 1.1

The new CNPC has been created!

You don't need npcmodes folder and OnPlayerRequestClass anymore. The only thing you should do is moving bot.amx file to the npcmodes folder from downloaded file. All NPCs will use bot.amx file. Then, add "new streamid = CreateStreamedNPC(...)" line to anywhere in gm. You will use SetNPCxxx(streamid.. functions instead of SetPlayerxxx(playerid.. functions. And if you want to remove npc, you will use DestroyStreamedNPC function.

If you want a bot to walk to a certain location, you can use 2 method.

1- WalkNPC(streamid_returned_from_create_function, walkid_for_walkend_callback, x,y,z,bool:run)
2- I copied playback recording functions to gamemode from npcmodes. You can use playback function.

Default NPC system? Can I use "ConnectNPC"?

No. You must use my system for all NPCs.

Will we use playerid?

No. CreateStreamedNPC will return stream id and you will use streamid for all NPC actions. Don't use player functions (SetPlayerPos etc.).

Why we must use streamid? Can't we use playerid?

System includes streamer. In some cases, NPCs will not be connected. When it connected/streamed in, it will have another playerid. But streamid will never change.

Is there something we should be aware of?

maxnpc limit in server.cfg and define's at the top of the file.

NPC walk system can be affected from lag problem in 0.3c. (https://sampforum.blast.hk/showthread.php?tid=212017)

It is one more thing you shouldn't forget, script is in the beta stage.

Callbacks

- OnNPCWalkEnd(streamid,walkid,method)

walkid should be entered to WalkNPC command.
Methods:
0- Automaticly.
1- By StopWalkNPC command.
2- You started playback and walking automaticly stoped.

- OnNPCRecordingPlaybackEnd(streamid)

Copied to gamemode from npcmodes.

Functions

pawn Код:
public CreateStreamedNPC(const name[], skin, Float:x, Float:y, Float:z, Float:angle,viwo)
public DestroyStreamedNPC(streamid)
public WalkNPC(streamid,walkid,Float:x,Float:y,Float:z,bool:run)
public StopWalkNPC(streamid)
public SetNPCPos(streamid,Float:x,Float:y,Float:z)
public SetNPCFacingAngle(streamid,Float:angle)
public SetNPCVirtualWorld(streamid,viwo)
public SetNPCSkin(streamid,skinid)
public ApplyNPCAnimation(streamid,animlibs[],animnames[],Float:fS,timer,freeze,loop)
public ClearNPCAnimations(streamid)
public StartRecordingPlayback(streamid,playbacktype,recordname[])
public StopRecordingPlayback(streamid)
Download

Waiting for your feedback.

b1: http://solidfiles.com/d/efa184/
b1.1: http://solidfiles.com/d/9eab/
Reply
#2

kk, checked it out. is the walk streamed nicely? ;o

edit: kk
Reply
#3

Quote from first message:

Quote:

NPC walk system can be affected from lag problem in 0.3c. (https://sampforum.blast.hk/showthread.php?tid=212017)

It is one more thing you shouldn't forget, script is in the beta stage.

Reply
#4

Wow Look Nice But Where ScreeenShot?
Reply
#5

Forget screenshots, we need videos. You can't demonstrate a walking NPC with screenshots.
Reply
#6

This is great, I'm going to use this instead. I could make some more functions for this <3 Thanks alot

EDIT: Works through objects? thats a great idea, I would of never come up with that lol
Reply
#7

wooo very good Fs
Reply
#8

Very nice FS , continue updating this man, you have future = )

public CreateStreamedNPC(const name[], skin, Float, Float:y, Float:z, Float:angle,viwo)
public DestroyStreamedNPC(streamid)
public WalkNPC(streamid,walkid,Float,Float:y,Float:z,bo ol:run)
public StopWalkNPC(streamid)
public GetNpcIDFromStreamID(streamid)
public ApplyNPCAnimation(streamid,animlibs[],animnames[],Float:fS,timer,freeze,loop)
public ClearNPCAnimations(streamid)
public StartRecordingPlayback(streamid,playbacktype,recor dname[])
public StopRecordingPlayback(streamid)

Can you make a example or tutorial with this things?
thanks xD
Reply
#9

Thanks for feedbacks.

I will make tutorial today.
Reply
#10

v1.1 released. Functions changed. Please re-download.

How to add NPCs and animate them?

Firstly, you must use CreateStreamedNPC function. It will return streamid, and you will use this for all NPC functions.
You shouldn't use player functions (SetPlayerPos etc.) for NPCs.

pawn Код:
new streamid = CreateStreamedNPC("Robber",0,x,y,z,angle,0);
If you want to animate NPC, you must use ApplyNPCAnimation function. ApplyAnimation will not work after the CreateStreamedNPC, because NPC will not be created yet. Also this script includes streamer too, for this reason if NPC disconnected and reconnected, you had to use ApplyAnimation function again. But if you use ApplyNPCAnimation once, you will not need re-use function.

pawn Код:
ApplyNPCAnimation(streamid,animlib[],animname[],fS,timer,freeze,loop);
And you can clear animations with;

pawn Код:
ClearAnimations(streamid);
How I will change its position?

If you want to change NPC's position, it is two way to do it:

1- You can use WalkNPC function. It will update position data even if NPC is not connected. Don't forget to add walkid for OnNPCWalkEnd callback.
2- SetNPCPos. It will update position data even if NPC is not connected like WalkNPC.

Why do you removed GetNpcIDFromStreamID in v1.1?

Because I added SetNPCVirtualWorld, SetNPCPos, SetNPCFacingAngle, SetNPCSkin functions. They will work even if NPC is not connected/not streamed in. It is no reason to use playerid.
Reply
#11

This sounds really interesting, but I can't figure out how to use it. I added the filterscript to my config but when I type /recordplaybackcb nothing happens "unknown command". Perhaps a tutorial on how to set up this system is needed..
Reply
#12

So this still uses samp-npc.exe than right? I really wanted to use CNPC for its efficiency (I have alot of NPC's and they use alot of resources) but the player spoofing ruined it.
Reply
#13

nice thank you
Reply
#14

Wow!! It works without including CNPC! Can you explain us how it works?
Reply
#15

Quote:
Originally Posted by [GF]Sasino97
Посмотреть сообщение
Wow!! It works without including CNPC! Can you explain us how it works?
What exactly works? I don't actually understand the whole Walk_NPC or whatever. What is the benefit compared to default SAMP version?
Reply
#16

nice FS
maxnpc 50 ?? server.cfg
50 place?
I am not there in nothing samp.server
Watch your server.log
Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3c R2, ©2005-2011 SA-MP Team

[09:20:36] 
[09:20:36] Server Plugins
[09:20:36] --------------
[09:20:36]  Loading plugin: streamer.dll
[09:20:36] 

*** Streamer Plugin v2.5 by Incognito loaded ***

[09:20:36]   Loaded.
[09:20:36]  Loading plugin: sscanf.dll
[09:20:36] 

[09:20:36]  ===============================

[09:20:36]       sscanf plugin loaded.     

[09:20:36]    © 2009 Alex "******" Cole

[09:20:36]  ===============================

[09:20:36]   Loaded.
[09:20:36]  Loading plugin: Whirlpool.dll
[09:20:36]  
[09:20:36]  ==================
[09:20:36]  
[09:20:36]   Whirlpool loaded
[09:20:36]  
[09:20:36]  ==================
[09:20:36]  
[09:20:36]   Loaded.
[09:20:36]  Loading plugin: regex.dll
[09:20:36] 


[09:20:36] ______________________________________


[09:20:36]  Regular Expression Plugin v0.2.1 loaded
[09:20:36] ______________________________________


[09:20:36]  By: Fro © Copyright <TBG> 2009-2011
[09:20:36] ______________________________________


[09:20:36]   Loaded.
[09:20:36]  Loaded 4 plugins.

[09:20:36] 
[09:20:36] Filter Scripts
[09:20:36] ---------------
[09:20:36]   Loading filter script 'LuxAdmin.amx'...
[09:20:36] 
 ___________________________________________________
[09:20:36]  
[09:20:36]                    L.A.S v1.6 Beta                         
[09:20:36]                  ---------------
[09:20:36]              LuX Administration System               
[09:20:36]  ___________________________________________________

[09:20:36]  -> Loading...
[09:20:36] 
 -Current Configurations Successfully Loaded!
[09:20:36] 

[09:20:36]  -> L.A.S Basic Loaded Configurations:

[09:20:36]  AutoLogin:    [Enabled!]  ReadCmds:  [Enabled!]
[09:20:36]  AntiSwear:    [Disabled]  AntiSpam:  [Enabled!]
[09:20:36]  NameKick:     [Enabled!]  AntiBot:   [Enabled!]
[09:20:36]  ConnectMsgs:  [Enabled!]  NoCaps:    [Disabled]
[09:20:36]  AdminCmdMsgs: [Enabled!]  Anti Ads:  [Enabled!]
[09:20:36]  SaveMoney:    [Enabled!]  MustLogin  [Enabled!]
[09:20:36]  Forbid Weaps: [Disabled]  AdmSkins:  [Disabled]
[09:20:36]  ReadPms:      [Enabled!]  MaxLevel:  [10]
[09:20:36]  SaveWeaps     [Enabled!]  Max Ping:  [0ms]
[09:20:36]  ChatDisabled: [Disabled]  MuteWarns: [4]
[09:20:36]  MustRegister: [Enabled!]  AdmSkins   [217, 214]

[09:20:36]  -> Loaded Successfully!

[09:20:36]  Date: 23/7/2011 - Time: 9:20:36
[09:20:36]  ___________________________________________________

[09:20:36]   Loading filter script 'mape.amx'...
[09:20:36]   Loading filter script 'mape2.amx'...
[09:20:36]   Loading filter script 'Case.amx'...
[09:20:36]   Loading filter script 'tn.amx'...
[09:20:36] 
--------------------------------------
[09:20:36] Transfender,Wheel Arch Angels and Lowrider vehicles supported
[09:20:36] Car tuning menu v.1.1
[09:20:36] Coded by Lucas_Bertone aks Rsts
[09:20:36] Cleaned up a bit by kaisersouse 4/11/2008
[09:20:36] --------------------------------------

[09:20:36]   Loading filter script 'drift.amx'...
[09:20:36]   Loading filter script 'snnpcsystem.amx'...
[09:20:36]  
[09:20:36] ---------------- SuperNova NPC System Loaded ----------------
[09:20:36] [!] System will be activated after the first player connected. 
[09:20:36]  
[09:20:36]   Loaded 7 filter scripts.

[09:20:37]                 ===================================
[09:20:37]                 =======Romania Stunt Galaxy========
[09:20:37]                 ===================================
[09:20:37]                 =This server included:            =
[09:20:37]                 =Over 56 Car`s                    =
[09:20:37]                 =Over 21.000 Object               =
[09:20:37]                 =Over 70 Commands                 =
[09:20:37]                 =Over 100 Teleports               =
[09:20:37]                 =This gamemode not locale edit!   =
[09:20:37]                 ===================================
[09:20:37]                 ===================================
[09:20:37] Number of vehicle models: 55
[09:23:01] --- Server Shutting Down.
[09:23:01] 
 ___________________________________________________
[09:23:01]  
[09:23:01]                    L.A.S v1.6 Beta                         
[09:23:01]                  -------------
[09:23:01]              LuX Administration System               
[09:23:01]  ___________________________________________________

[09:23:01]  -> Unload!
[09:23:01] 

*** Streamer Plugin v2.5 by Incognito unloaded ***

[09:23:01] 

[09:23:01]  ===============================

[09:23:01]      sscanf plugin unloaded.    

[09:23:01]  ===============================

[09:23:01]  
[09:23:01]  ====================
[09:23:01]  
[09:23:01]   Whirlpool unloaded
[09:23:01]  
[09:23:01]  ====================
[09:23:01]  
[09:23:01] 


[09:23:01] ______________________________________


[09:23:01]  Regular Expression Plugin v0.2.1 unloaded
[09:23:01] ______________________________________
Reply
#17

where is function for interior?I want my NPC into the interior, and btw. this is nice but I still don't understand how to create it, I need a folder with NPC, or what?Please make a video or something
Reply
#18

Anyone actually get this to work? I'd like to see it in action but I don't understand how to set up the system.
Reply
#19

Quote:
Originally Posted by [LF]Mr.Lucci
Посмотреть сообщение
Anyone actually get this to work? I'd like to see it in action but I don't understand how to set up the system.
me too, just make it as one include!
Reply
#20

Anyone out there that can make sense of this system and how to actually use it? would be nice to know if someone actually got this working?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)