Raised This Month: $51 Target: $400
 12% 

[HOWTO] Make a NPC with extra features.


Post New Thread Reply   
 
Thread Tools Display Modes
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 03-07-2012 , 00:23   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #41

@Rirre
Yes I can but there's already a 3rd party plugin that does this. Devil259 has linked it.
It shouldn't be hard at all from just looking at the plugins code.

1.Spawn a env_sprite entity and set it above the NPC.
2.If you want to only show the sprite to a specific team only then you will need to filter out in the AddToFullPack forward and display to whomever you like.
3. Catch whenever the NPC takes damage and update the frame of the sprite by converting the health of a percentage. ( (Current HP / Max HP) * 100.0 )

Hope this helps!


I just updated the script.
Whenever you knife the NPC it will now play a proper flesh knife hit sound. This is good if your NPC is made out of flesh like this tutorial.
__________________
It's a mystery.
Mini_Midget is offline
MynDoS
Junior Member
Join Date: Sep 2011
Old 04-07-2012 , 04:28   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #42

A few questions
First How to make a npc that was immortal?
Second How do I do that by pressing the "e" (a distance of 200 treatment units) shows the menu.
I saw this idea on amxx, but I do not know how to do it
MynDoS is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 04-09-2012 , 07:51   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #43

I think should fix this !
Code:
new bool: g_Hit[32];
====>
Code:
new bool: g_Hit[33];
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 04-09-2012 , 08:27   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #44

IMO, this stock should be useful :

Code:
stock set_entity_anim( ent, anim ) {     if( pev_valid( ent ) )     {         entity_set_float( ent, EV_FL_animtime, get_gametime( ) );         entity_set_float( ent, EV_FL_framerate, 1.0 );         entity_set_int( ent, EV_INT_sequence, anim );     }       }
__________________
You can do anything you set your mind to, man.


Last edited by Devil259; 04-09-2012 at 08:28.
Devil259 is offline
Sprit3x
Senior Member
Join Date: Sep 2010
Location: Romania, Constanta
Old 07-15-2012 , 02:35   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #45

If i use other model it stucks.. and i tried to increase that z-axis but no result -.-'
Sprit3x is offline
Send a message via Skype™ to Sprit3x
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-15-2012 , 10:59   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #46

Great stock Devil !
__________________
Pawn ? Useless
Aooka is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 09-13-2012 , 23:16   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #47

Question, lets say we want to spawn 10 NPC of the same class,
when for example we damage one of the 10 NPC's, the damage done will be dealt too all the NPC's with the same class or not?
if so, how could we give every npc spawned a new index so that we can use a specifik npc index at any time, for example to call a command on that npc.
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 09-13-2012 at 23:18.
striker07 is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 09-15-2012 , 09:00   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #48

Quote:
Originally Posted by striker07 View Post
Question, lets say we want to spawn 10 NPC of the same class,
when for example we damage one of the 10 NPC's, the damage done will be dealt too all the NPC's with the same class or not?
if so, how could we give every npc spawned a new index so that we can use a specifik npc index at any time, for example to call a command on that npc.
You could use pev_iuser or pev_euser values to set the index when creating and then checking them.
__________________

Accepting all kinds of requests via private message.
matsi is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 09-15-2012 , 11:47   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #49

Quote:
Originally Posted by matsi View Post
You could use pev_iuser or pev_euser values to set the index when creating and then checking them.
The NPC that will take damage is not going to be owned by anyone, they randomly spawn on the map without a owner so that wont work i think unless i set every npc spawn id one higher then the previous starting from index 33, but then:

when i would make the npc's fakeplayers (so that they dont use any slots on the server)
Can a user/NPC index be higher then 32? so that for example i could add more then 32 NPC's to the game
(just a matter finding the boundaries)
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 09-15-2012 , 13:12   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #50

Quote:
Originally Posted by striker07 View Post
The NPC that will take damage is not going to be owned by anyone, they randomly spawn on the map without a owner so that wont work i think unless i set every npc spawn id one higher then the previous starting from index 33, but then:

when i would make the npc's fakeplayers (so that they dont use any slots on the server)
Can a user/NPC index be higher then 32? so that for example i could add more then 32 NPC's to the game
(just a matter finding the boundaries)
No.

Create array and increase it when loading the NPC's. Then set i.e pev_euser1 to current NPC.

Code:
new myArrray; In load config do myArray++; in npc creation: set_pev( iEnt, pev_euser1, myArray ); in npc touch: new npcId = pev( iEnt, pev_euser1 ); client_print( id, print_chat, "Touched npcId #%i", npcId  );
__________________

Accepting all kinds of requests via private message.
matsi is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 00:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode