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

How do I do things with Entities?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 08-23-2005 , 04:14   How do I do things with Entities?
Reply With Quote #1

Alright well now that goku is completed, i've decided to move on to my next BIG project, making a hero that has a disk that hurts people. I know how to create the entity and set the model, but now I don't know how to set the speed of an entity, and also where to initially place the entity. Overall I need some big help. I mean I could try and study the engine include or the Vexd_Utilities but there are just too many functions. And the comments that go along with the includes are kind of vague. I could also try ripping from bazooka, but I want to actually learn how to do the coding. So, if anyone wants to teach me how to do stuff with an Ent, please do; it will allow me to make my hero plus also make future heroes that i plan to make using entities.

P.S. you don't know how excited I am to make these heroes =D. And i'll also post more stuff if I need more help.
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 08-23-2005 , 04:19  
Reply With Quote #2

well when u create an entity you set their origin and their default values. Then you can either set their origin to a specific place(if thats what you want)
or you can set entity's movetype and velocity thus it will move by itself (and u can gives its first push).
Freecode is offline
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 08-24-2005 , 02:33  
Reply With Quote #3

Oh yeah while i was looking at the createEntity method the parameter is szClassname[], what do i put for that? anything i want?
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag is offline
yang
Veteran Member
Join Date: May 2005
Location: galoreservers.net
Old 08-24-2005 , 02:41  
Reply With Quote #4

yeah u can name the classname anything u want ;)
__________________
yang is offline
Send a message via AIM to yang
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 08-24-2005 , 03:10  
Reply With Quote #5

Sweet! cool, now um.... for the move type, what parameters are required for SV_movestep() cause i don't know what include the SV_movestep() function is in..... I mean I want my move type to follow wherever you're looking at with your crosshair with a certain amount of speed. I believe that this would do it right? That is if you put it in the SV_movestep() function.

Code:
// track movement of aiment
#define MOVETYPE_FOLLOW		12
OFFTOPIClease check my offtopic forum "How long have you been coding?" It's my chance to get to know people and stuff =D.
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 08-24-2005 , 03:48  
Reply With Quote #6

no classname cannot be anything.
It has to be a valid classname. If you dont know what to use then just use "info_target"
Freecode is offline
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 08-24-2005 , 03:51  
Reply With Quote #7

alright thx for the info freecode, and what about the SV_movestep() function? I can't seem to find it in the includes.
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag is offline
yang
Veteran Member
Join Date: May 2005
Location: galoreservers.net
Old 08-24-2005 , 04:09  
Reply With Quote #8

i appologize lol... i misread it and thought it was:
entity_set_string(newEnt, EV_SZ_classname, "Anyname")

or is that wrong too o.O... eh well, atleast I learn something new today

i thought u didn't have internet while moving freecode?
__________________
yang is offline
Send a message via AIM to yang
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 08-24-2005 , 04:16  
Reply With Quote #9

Yeah that looks pretty right to me for that method:
native entity_set_string(iIndex, iKey, const szNewVal[]);

index would be the newly created entity, don't know about key, might be class name, and the last parameter is for setting gun models, or more generic, string values.

Anyways on topic, anyone having luck finding the SV_movestep() function?
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 08-24-2005 , 04:43  
Reply With Quote #10

he was talking about the create_entity native which takes a classname
Code:
/* Creates an entity, will return the index of the created entity. ClassName must be valid. */ native create_entity(szClassname[]);

and about
Quote:
native entity_set_string(iIndex, iKey, const szNewVal[]);

index would be the newly created entity, don't know about key, might be class name, and the last parameter is for setting gun models, or more generic, string values.
to get key you look into engine_const.inc (for amxx) and since your using string(entity_set_string) and under where it says /* Strings */ are u available choice
Code:
/* String */ enum {     EV_SZ_classname = 0,     EV_SZ_globalname,     EV_SZ_model,     EV_SZ_target,     EV_SZ_targetname,     EV_SZ_netname,     EV_SZ_message,     EV_SZ_noise,     EV_SZ_noise1,     EV_SZ_noise2,     EV_SZ_noise3,     EV_SZ_viewmodel,     EV_SZ_weaponmodel, }

And i didnt move yet. about 5 -6 days left till i leave
Freecode 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 14:43.


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