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

MOVETYPE_FOLLOW & pev_aiment weird model.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
metal_upa
Senior Member
Join Date: Jun 2016
Old 08-31-2021 , 09:29   MOVETYPE_FOLLOW & pev_aiment weird model.
Reply With Quote #1

Hello, i wanna create a plugin that can spawn a pet (with animation) and follow our movement. But the strange issue happen to me. The model spawn but it attach to weird coordinate on player body, also the animation seems stuck.

I don't think the code is wrong because when i use a different hat model it stay in right coordinate and with animation too.

I attached the code and models.

The Pet Plugin


Screenshot
Attached Files
File Type: zip we_pet.zip (359.9 KB, 64 views)
metal_upa is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-31-2021 , 15:09   Re: MOVETYPE_FOLLOW & pev_aiment weird model.
Reply With Quote #2

Code:
CreatePet(id)
{
    new ent = create_entity("info_target")
    if(!pev_valid(ent)) return;

    new iRandom = random(sizeof szModelPets)
    set_pev(ent, pev_classname, CLASSNAME_PET)
    entity_set_model(ent, szModelPets[iRandom])
    set_pev(ent, pev_movetype, MOVETYPE_FOLLOW)
    set_pev(ent, pev_aiment, id)
    set_pev(ent, pev_sequence, 0)
    set_pev(ent, pev_framerate, 1.0)
    set_pev(ent, pev_animtime, get_gametime())

    iUserPet[id] = ent;
    client_print(id, print_chat, "[WePet] Your pet is: %s", szModelPets[iRandom])
}
It seems the model has bad animations, or better yet MOVETYPE_FOLLOW doesn't fit the current pet models...
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-31-2021 at 15:15.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
metal_upa
Senior Member
Join Date: Jun 2016
Old 09-02-2021 , 09:29   Re: MOVETYPE_FOLLOW & pev_aiment weird model.
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
Code:
CreatePet(id)
{
    new ent = create_entity("info_target")
    if(!pev_valid(ent)) return;

    new iRandom = random(sizeof szModelPets)
    set_pev(ent, pev_classname, CLASSNAME_PET)
    entity_set_model(ent, szModelPets[iRandom])
    set_pev(ent, pev_movetype, MOVETYPE_FOLLOW)
    set_pev(ent, pev_aiment, id)
    set_pev(ent, pev_sequence, 0)
    set_pev(ent, pev_framerate, 1.0)
    set_pev(ent, pev_animtime, get_gametime())

    iUserPet[id] = ent;
    client_print(id, print_chat, "[WePet] Your pet is: %s", szModelPets[iRandom])
}
It seems the model has bad animations, or better yet MOVETYPE_FOLLOW doesn't fit the current pet models...
MOVETYPE_FOLLOW, MOVETYPE_NOCLIP, MOVETYPE_FLY all works with pev_aiment, once we set pev_aiment.. enitity will follow us. I believe there must be something wrong with the model itself, because only certain model has this issue. I don't know much about GoldSrc model.

Last edited by metal_upa; 09-02-2021 at 10:17.
metal_upa is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-02-2021 , 09:58   Re: MOVETYPE_FOLLOW & pev_aiment weird model.
Reply With Quote #4

pev_aiment will take effect only if the entity move type is follow
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
metal_upa
Senior Member
Join Date: Jun 2016
Old 09-02-2021 , 10:19   Re: MOVETYPE_FOLLOW & pev_aiment weird model.
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
pev_aiment will take effect only if the entity move type is follow
That's not 100% correct, you can test it with MOVETYPE_FLY or MOVETYPE_NOCLIP, entity still follow player. I've have tested this.
metal_upa is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-02-2021 , 10:37   Re: MOVETYPE_FOLLOW & pev_aiment weird model.
Reply With Quote #6

Quote:
Originally Posted by metal_upa View Post
That's not 100% correct, you can test it with MOVETYPE_FLY or MOVETYPE_NOCLIP, entity still follow player. I've have tested this.
Not a problem this isn't the correct way for this kind of model, you need to update the model origin on each time the player think
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 09-02-2021 at 10:42.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
SHIELD755
Veteran Member
Join Date: Feb 2018
Location: FROM MARVEL STUDIO
Old 09-03-2021 , 23:58   Re: MOVETYPE_FOLLOW & pev_aiment weird model.
Reply With Quote #7

It once happened with me also … try to change model origin … i do same
__________________
SED LYF !!!
SHIELD755 is offline
Reply


Thread Tools
Display Modes

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 19:39.


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