movimiento de hats
#1
hola a todos, la siguiente consulta que queria hacer era sobre el movimiento de entidades, en este caso es un sombrero que posee un movimiento y el problema es que el sombrero se mantiene estatico, aclaro no es problema del model esto es mas de las entidades que se usa

Código PHP:
    new ent g_ent[id]
    new 
infotarget engfunc(EngFunc_AllocString"info_target")
    
    if (!
pev_valid(ent))
    {
        
engfunc(EngFunc_RemoveEntityent)
        
g_ent[id] = ent engfunc (EngFunc_CreateNamedEntityinfotarget)        
        
set_pev(entpev_movetypeMOVETYPE_FOLLOW)
        
set_pev(entpev_aimentid)
        if (
is_user_admin(id)) 
    { 

dejo un model hast test con el movimiento q hace, y no es el model final, solo para q vean con el visor model

saludos


Archivos adjuntos
.zip   zp_test.zip (Tamaño: 12.03 KB / Descargas: 8)
Responder
#2
Probalo asi

Código PHP:
new iHatEntity;
iHatEntity g_HatEnt[id];

if(!
is_valid_ent(iHatEntity))
{
    
iHatEntity create_entity("info_target");

    
entity_set_string(iHatEntityEV_SZ_classnameHAT_CLASSNAME);
    
entity_set_int(iHatEntityEV_INT_solidSOLID_NOT);
    
entity_set_int(iHatEntityEV_INT_movetypeMOVETYPE_FOLLOW);
    
entity_set_edict(iHatEntityEV_ENT_aimentid);
    
entity_set_edict(iHatEntityEV_ENT_ownerid);
    
entity_set_model(iHatEntityHAT_MDL);

    
g_HatEnt[id] = iHatEntity;

Responder
#3
WTF?
Código PHP:
g_ent[id] = ent engfunc (EngFunc_CreateNamedEntityinfotarget
Responder
#4
(14/10/2019, 05:04 PM)INTIFADA escribió: Probalo asi

Código PHP:
new iHatEntity;
iHatEntity g_HatEnt[id];

if(!
is_valid_ent(iHatEntity))
{
    
iHatEntity create_entity("info_target");

    
entity_set_string(iHatEntityEV_SZ_classnameHAT_CLASSNAME);
    
entity_set_int(iHatEntityEV_INT_solidSOLID_NOT);
    
entity_set_int(iHatEntityEV_INT_movetypeMOVETYPE_FOLLOW);
    
entity_set_edict(iHatEntityEV_ENT_aimentid);
    
entity_set_edict(iHatEntityEV_ENT_ownerid);
    
entity_set_model(iHatEntityHAT_MDL);

    
g_HatEnt[id] = iHatEntity;


no me funciono... use el model como si fuera un paracaidas y se activa el movimiento, tendria q ver algo requierido al personaje este estatico?


(14/10/2019, 09:27 PM)Niper.-. escribió: WTF?
Código PHP:
g_ent[id] = ent engfunc (EngFunc_CreateNamedEntityinfotarget

no le encontre sentido a eso, ya que arriba tambien dice q ent es igual a g_ent[id] Roflmao Roflmao es algo q saque del foro
Responder
#5
Tienes que ponerle la animación a la entidad del hat.
(17/04/2015, 03:36 PM)Neeeeeeeeeel.- escribió: No se va a volver a conectar a internet en toda su puta vida... nadie sube porno a mi foro y vive para contarlo.
Responder
#6
Si no me equivoco tenes que usar: entity_set_int(ent, EV_INT_sequence, sequencia) para darle animación a la entidad

Responder
#7
hola lei bastante del tema pero falta optimizar el codigo..... y sacar lo innecesario...
tome el codigo de federico de santa automatico y edite, ya q era un codigo mas limpio y entendible, ya que hay muchas partes del codigo que en tutoriales no explica lo que es o que funcion cumple

Código PHP:
public fw_PlayerSpawn_Post(const id)
{
    if(
g_IsChristmas) {
        if(
is_user_alive(id)) {
            if(!
g_HatId[id]) {
                
g_HatEnt[id] = create_entity("info_target");
                
                if(
is_valid_ent(g_HatEnt[id])) {
                    
g_HatId[id] = 1;
                    
entity_set_string(g_HatEnt[id], EV_SZ_classnameg_CLASSNAME_SantaHat);
                    
                    
entity_set_int(g_HatEnt[id], EV_INT_solidSOLID_NOT);
                    
entity_set_int(g_HatEnt[id], EV_INT_movetypeMOVETYPE_FOLLOW);
                    
entity_set_edict(g_HatEnt[id], EV_ENT_aimentid);
                    
entity_set_edict(g_HatEnt[id], EV_ENT_ownerid);
                    
entity_set_floatg_HatEnt[id], EV_FL_animtime0.0);
                    
entity_set_floatg_HatEnt[id], EV_FL_framerate0.4);
                    
entity_set_int(g_HatEnt[id], EV_INT_sequence1);
                    
entity_set_intg_HatEnt[id], EV_INT_gaitsequence);
                    
entity_set_floatg_HatEnt[id], EV_FL_frame0.0 );
                    
entity_set_floatg_HatEnt[id], EV_FL_fuser10.0 );
                    

                    
                    
entity_set_int(g_HatEnt[id], EV_INT_rendermodekRenderNormal);
                    
entity_set_float(g_HatEnt[id], EV_FL_renderamt255.0);
                    
                    
entity_set_model(g_HatEnt[id], g_MODEL_Hat);
                    
                    
                }
            }
        }
    }



algo que podria sacar... lo q si me gustaria hacelerar un poco la velocidad del moviento

dejo una imagen para que vean q el model posee una animacion para los diseñadores.... gracias a xSuffering que fue el creador de este model, muy buena honda por iniciar el proyecto


[Imagen: 1.jpg]
Responder
#8
Con esto me parece que aceleras la velocidad de la animación: entity_set_float(ent, EV_FL_animtime, float)

Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)