AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=43)
-   -   How do I do things with Entities? (https://forums.alliedmods.net/showthread.php?t=34367)

Batman/Gorlag 08-23-2005 04:14

How do I do things with Entities?
 
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.

Freecode 08-23-2005 04:19

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).

Batman/Gorlag 08-24-2005 02:33

Oh yeah while i was looking at the createEntity method the parameter is szClassname[], what do i put for that? anything i want?

yang 08-24-2005 02:41

yeah u can name the classname anything u want ;)

Batman/Gorlag 08-24-2005 03:10

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

OFFTOPIC:Please check my offtopic forum "How long have you been coding?" It's my chance to get to know people and stuff =D.

Freecode 08-24-2005 03:48

no classname cannot be anything.
It has to be a valid classname. If you dont know what to use then just use "info_target"

Batman/Gorlag 08-24-2005 03:51

alright thx for the info freecode, and what about the SV_movestep() function? I can't seem to find it in the includes.

yang 08-24-2005 04:09

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 :D

i thought u didn't have internet while moving freecode?

Batman/Gorlag 08-24-2005 04:16

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?

Freecode 08-24-2005 04:43

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


All times are GMT -4. The time now is 09:07.

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