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

How To: Make a perfect NPC


Post New Thread Reply   
 
Thread Tools Display Modes
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-28-2005 , 17:47  
Reply With Quote #11

Making him die is easy, and so is the making him flinch. You need to make him think every frame or even just 1.0, and when his health goes down, play a pain animation and make a sound, and then do a death animation when his HP goes below 1, and remove him.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-28-2005 , 17:54  
Reply With Quote #12

Can you actually make an entity Think, the good ol' HL way, with FM, or do you have to replicate it with Small?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-28-2005 , 17:56  
Reply With Quote #13

You can, in theory, make an entity think just like in the HL source using engine and FM.

I've used call_think and register_think and all that.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-28-2005 , 18:31  
Reply With Quote #14

Could you tell me how to do the whole fakedamage() thing?
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 03-29-2005 , 08:05  
Reply With Quote #15

Nice!
BAILOPAN should place this in usefull links
XunTric is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-29-2005 , 09:48  
Reply With Quote #16

Not too useful right now. I'll update it tonight for adding simple thinks, and giving the NPC a weapon.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 03-30-2005 , 07:07  
Reply With Quote #17

Can you give it a weapon, make it follow you, and make it shoot on enemys?

And btw, that talking thing...
How to i make the NPC talk everytime somebody is near him/she and press "use"-button? (Show a message print, or motd window or something like that...)
XunTric is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-30-2005 , 09:55  
Reply With Quote #18

Well, here is how you can give your NPC a weapon:

Code:
        entWeapon = create_entity("info_target") 

        entity_set_string(entWeapon, EV_SZ_classname, weapString) 

        entity_set_int(entWeapon, EV_INT_movetype, MOVETYPE_FOLLOW) 
        entity_set_int(entWeapon, EV_INT_solid, SOLID_NOT) 
        entity_set_edict(entWeapon, EV_ENT_aiment, entOwner) 
        entity_set_model(entWeapon, "models/p_m4a1.mdl")
thats from geezu's guide to giving a model a weapon.

Basically, you make another ent, give it a classname like, for instance "ts_groundweapon" or "ts_worldweapon". It doesnt actually matter what the classname is, but its good to be consistant with the mod your going for.

You make it not solid, and make it follow the model entity you want, and then give it a model. Keep in mind that depending on the model, you will want to have a different animation called. Check the model for details.

In addition, I've been working very hard on using engine to make the entity "think" like a normal HL default ent. Once this is done, I will post it, and the possibilities will be endless.

See, with SMALL, you'd have to check damage and such every server_frame, but if you have a constantly calling think(), then you can check it every server_frame (or close to it), but the calling is really done inside the engine, making it not lag very much (since all ents do this).

Then we can do all sorts of things to make the entity move, walk, shoot, etc etc.

Anyway, just be patient.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-30-2005 , 17:54  
Reply With Quote #19

Can you show me how to make it take damage, or be 'killable'?
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 03-30-2005 , 19:30  
Reply With Quote #20

Quote:
Then we can do all sorts of things to make the entity move, walk, shoot, etc etc.
*waits for future replies*

also, is this that dam onna model i had to dl when i joined Marc's server

P.S. You can make hostage ents if you want them to just follow, but when you write how to make the entity move, walk, and shoot; this will be much better
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
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:16.


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