Raised This Month: $32 Target: $400
 8% 

How To: Make a perfect NPC


Post New Thread Reply   
 
Thread Tools Display Modes
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 10-08-2009 , 11:30   Re: How To: Make a perfect NPC
Reply With Quote #131

Ham_TakeDamage
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 10-08-2009 , 14:31   Re: How To: Make a perfect NPC
Reply With Quote #132

Quote:
Originally Posted by ot_207 View Post
Ham_TakeDamage
Can you give me example. Im just a beginner and i can't imagine how its done.

Edit: Is it normal when i shoot my npc it has same effect that shield?

Last edited by matsi; 10-08-2009 at 14:35.
matsi is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 10-08-2009 , 15:09   Re: How To: Make a perfect NPC
Reply With Quote #133

Quote:
Originally Posted by matsi View Post
So i made npc with default sas model:
Code:
spawn_npc( id ) {     new Float:origin[ 3 ]         entity_get_vector( id, EV_VEC_origin,origin )         new ent = create_entity( "info_target" )         // Give it a classname     entity_set_string( ent, EV_SZ_classname, "func_npc" )         entity_set_origin( ent, origin );     origin[ 2 ]  += 100.0     entity_set_origin( id, origin )         entity_set_float (ent, EV_FL_takedamage, 1.0 )     entity_set_float( ent, EV_FL_health, 100.0 )         entity_set_string( ent, EV_SZ_classname, "test_npc" );     entity_set_model( ent, "models/player/sas/sas.mdl" );     entity_set_int( ent, EV_INT_solid, 2 )     entity_set_byte( ent, EV_BYTE_controller1, 125 );     entity_set_byte( ent, EV_BYTE_controller2, 125 );     entity_set_byte( ent, EV_BYTE_controller3, 125 );     entity_set_byte( ent, EV_BYTE_controller4, 125 );         new Float:maxs[ 3 ] = { 16.0,16.0,36.0 }     new Float:mins[ 3 ] = { -16.0,-16.0,-36.0 }     entity_set_size( ent, mins, maxs )         entity_set_float(ent,EV_FL_animtime,2.0)     entity_set_float( ent, EV_FL_framerate, 1.0 )     entity_set_int( ent, EV_INT_sequence, 0 );         entity_set_float( ent, EV_FL_nextthink, halflife_time() + 0.01 )         drop_to_floor( ent )         // Register the take damage     RegisterHamFromEntity(Ham_TakeDamage, ent, "fw_takedamage")         return 1; } public fw_takedamage(ent, inflictor, attacker, Float:damage, bits) {     client_print(0, print_chat, "Damage:%f", damage);     return HAM_IGNORED }

So how can i detect if its loosing hp ? And is my code correct for that use?
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 10-08-2009 , 15:32   Re: How To: Make a perfect NPC
Reply With Quote #134

Thanks tested and it works. ;)
matsi is offline
OneMoreLevel
Senior Member
Join Date: Aug 2009
Location: Look behind you... Very
Old 10-24-2009 , 12:24   Re: How To: Make a perfect NPC
Reply With Quote #135

Is this out of date?
__________________
60/100 60%
[||||||||||||||||||||]
Project: Warfighter mod
Blog:
http://sites.google.com/site/dailymultitasker/
PHP Code:
   if ( i_help_you "Yes" ) == )
    
set_user_karma(onemorelevel,add,+1
OneMoreLevel is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 10-27-2009 , 16:22   Re: How To: Make a perfect NPC
Reply With Quote #136

Wow. This was just a tiny little tutorial to document how to make a very basic NPC when I was just starting to make a bot API.

Thank you all, so very much, for using what little work of mine from that era is still usable.

It...really means a lot.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-27-2009 , 16:58   Re: How To: Make a perfect NPC
Reply With Quote #137

I actually used this the other day to write a simple mod for someone.

Very useful reference
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
OneMoreLevel
Senior Member
Join Date: Aug 2009
Location: Look behind you... Very
Old 10-27-2009 , 20:01   Re: How To: Make a perfect NPC
Reply With Quote #138

Quote:
Originally Posted by Twilight Suzuka View Post
Wow. This was just a tiny little tutorial to document how to make a very basic NPC when I was just starting to make a bot API.

Thank you all, so very much, for using what little work of mine from that era is still usable.

It...really means a lot.
Its a MUCH needed tutorial, although it could use some things, do you mind adding these?

1. How to trigger something when a player presses the USE key AND is in front of the NPC.

2. Make a NPC be able to shoot someone when they get shot at.(But still not be able to die.)
__________________
60/100 60%
[||||||||||||||||||||]
Project: Warfighter mod
Blog:
http://sites.google.com/site/dailymultitasker/
PHP Code:
   if ( i_help_you "Yes" ) == )
    
set_user_karma(onemorelevel,add,+1
OneMoreLevel is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 03-21-2010 , 07:58   Re: How To: Make a perfect NPC
Reply With Quote #139

how can i turn the npc around? He isnt moving for his face should turn 180 degrees
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Legend
Member
Join Date: Mar 2010
Location: Denmark
Old 03-21-2010 , 15:27   Re: How To: Make a perfect NPC
Reply With Quote #140

Lol I didnt even know that it was possible to make a npc
__________________
Legend 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 16:41.


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