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

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-30-2005 , 20:18  
Reply With Quote #21

Finished!

Now with a little coding,y ou can make a very good bot in AMXX, or a perfect NPC.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 03-30-2005 , 20:21  
Reply With Quote #22

teh w00ters ate teh h00ters;

nice tutorial!
now that i scimmed through it, i will now concentrate all my energy to figure out how to use it correctly instead of something i was doing earlier... ugg

except, could u elaborate on the EngFunc_RunPlayerMove ?
I dont really understand...
Code:
EngFunc_RunPlayerMove, // void ) (edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec );
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-30-2005 , 20:44  
Reply With Quote #23

whats not to understand? its very easy to understand.

EngFunc_RunPlayerMove, // void ) (edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec );

First parameter is the bot you want to move

second is the angles
third through fifth is the directions and their speeds, the next is the buttons they are pushing, then the impulses, then how much time these are over.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 03-30-2005 , 21:17  
Reply With Quote #24

u specifiy bot by ent id right?

the view angles would be the same as the angles as when u set an ent to face a certain direction like in valve hammer editor?

3 is "w" and "s' speeds; 4 is "a" and "d" speeds; and 5 is "spacebar" speed? *Those are what i use to move in-game, just in case you have somethign different*

unsigned short buttons are the buttons that you want the bot to simulate pressing? kinda like an advanced client_command?

byte impulse = 101 for impulse 101?

byte msec = 1000 if i wanted the bot to move forward for 1 second?

and can you give me a code example with working vaules plugged in?
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-30-2005 , 21:41  
Reply With Quote #25

Not until I test it myself.
__________________
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 04-16-2005 , 03:56  
Reply With Quote #26

How would I make it duck/jump at the same time?
__________________
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
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 04-19-2005 , 09:52  
Reply With Quote #27

Yay! I came up with a better NPC.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Belsebub
Senior Member
Join Date: Feb 2005
Location: Sweden
Old 04-25-2005 , 16:43  
Reply With Quote #28

how to make the npc spawn infront of you?

and im really waiting to know how to make the npc shoot and stuff
Belsebub is offline
Lotion
Member
Join Date: Apr 2005
Old 04-28-2005 , 14:49  
Reply With Quote #29

where do i put in the origin? like where do i paste my coords for it
Lotion is offline
noob cannon lol
SourceMod Donor
Join Date: Sep 2005
Old 10-22-2005 , 15:24  
Reply With Quote #30

I've tried using this to create a bot in Zombie Panic (to test plugins and maps) and this was what I got. I'm not familiar with entities.
Code:
L 10/22/2005 - 11:15:45: [AMXX] [ENGINE] Invalid player 0 (not in-game)
Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>

new entWeapon

public plugin_init()
	{
	register_plugin("onna", "0.0.1", "noob cannon lol")
	register_clcmd("onna", "onna")
	register_think("npc_onna","npc_think");
}

public plugin_precache()
	{
	precache_model("models/KazeXtreme2.mdl")
	precache_model("models/p_gauss.mdl")
}

public onna(id)
	{
	
	new Float:origin[3]
	
	entity_get_vector(id,EV_VEC_origin,origin)
	
	new ent = engfunc(EngFunc_CreateFakeClient,"Onna")
	
	entity_set_origin(ent,origin);
	origin[2] += 300.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,"npc_onna");
	entity_set_model(ent,"models/player/survivor/survivor.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)
	return 1;
}

public npc_think(id)
	{
	// Put your think stuff here.
	entity_set_float(id,EV_FL_nextthink,halflife_time() + 0.01)
}
noob cannon lol is offline
Send a message via AIM to noob cannon lol Send a message via MSN to noob cannon lol
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 05:27.


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