AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Change entity angle and origin - backweapon (https://forums.alliedmods.net/showthread.php?t=45922)

joselitostrike 10-14-2006 13:42

[SOLVED] Change entity angle and origin - backweapon
 
I'm trying to find a solution for the plugin back weapons by cheap_suit to not use custom models and use w_ models, so far i can't get nothing. I tried changing the origin with entity_set_origin but dunno what is wrong.

Code:

if(g_bwEnt[id] < 1)
        {
                g_bwEnt[id] = create_entity("info_target")
                if(g_bwEnt[id] > 0)
                {
                        new float:test[3]
                        entity_get_vector(id, EV_VEC_origin,test)
                        entity_set_origin(g_bwEnt[id], test)
                        entity_set_int(g_bwEnt[id], EV_INT_movetype, MOVETYPE_FOLLOW)
                        entity_set_edict(g_bwEnt[id], EV_ENT_aiment, id)
                        test[1] += 500.0 // numbers just for test
                        test[2] += 9998.0
                        entity_set_origin(g_bwEnt[id], test)
                }
        }

Any other idea to change the angle and origin are welcome.

joselitostrike 10-14-2006 18:02

Re: Change entity angle and origin - backweapon
 
Another question, how do i make a model invisible using fakemeta, so far on engine i used set_entity_visibility.

EDIT: After trying a little more things with fakemeta, i think that's not possible to change the angles using the current method for the model follow the player.

It must be something with amxx or the hl1 engine that doens't let you add angles to the info_target model. Their angles just follow the player angles, and if you think in using another method, i'm pretty sure it will lag a lot.

diamond-optic 10-15-2006 11:29

Re: Change entity angle and origin - backweapon
 
Quote:

Originally Posted by joselitostrike (Post 391160)
Another question, how do i make a model invisible using fakemeta, so far on engine i used set_entity_visibility.


heres a stock i use that is from VEN's fakemeta_util

Code:

stock fm_set_entity_visibility(index, visible = 1)        //from fakemeta_util
{
        set_pev(index, pev_effects, visible == 1 ? pev(index, pev_effects) & ~EF_NODRAW : pev(index, pev_effects) | EF_NODRAW)

        return 1
}

if you dont want to just use the stock, it at least shows you how to do it...

joselitostrike 10-15-2006 18:28

Re: Change entity angle and origin - backweapon
 
Thx diamond-optic, i followed what you said and found out that using pev_effects have solved my problem. From back weapons by cheap_suit:

Code:

if(equal(modelName, "models/pshell.mdl"))
                        {
                                set_pev(g_bwEnt[id], pev_effects, EF_NODRAW)
                                return PLUGIN_CONTINUE
                        }
                       
                        set_pev(g_bwEnt[id], pev_effects, 0)

About the problem with the angles and origin of the weapon model that is set to MOVETYPE_FOLLOW, it follows the aiment entitie. The only fix possible is suggesting a new feature, which will be change the origin and angle of a MOVETYPE_FOLLOW.

Don't know if there's another way, because getting the player origin and angles to use with another entitie doesn't do the same effect. Even if you set a task to the minimum time.

diamond-optic 10-16-2006 09:58

Re: [SOLVED] Change entity angle and origin - backweapon
 
i tried to do the same thing when he released that..

i wanted to use it for dod but also didnt want to have a whole lot of models to download (plus that would put me well over the precache limit) but it seems i ran into the same problems you are :-) so i gave up and moved on lol

v3n1n 11-15-2006 08:39

Re: [SOLVED] Change entity angle and origin - backweapon
 
Just a question I ask :

The backpack w_ model :

[IMG]http://img218.**************/img218/4650/backpacksd7.th.jpg[/IMG]

Look at the ground position (the backpack is on the ground) but in the game it can be in the back of terrorist and on the ground. Can't the origin or I don't know what can't be used with that ?

VEN 11-15-2006 10:41

Re: [SOLVED] Change entity angle and origin - backweapon
 
No, it's controlled by the body pev. It's hardcoded into the T-models.

v3n1n 11-15-2006 11:56

Re: [SOLVED] Change entity angle and origin - backweapon
 
Oh I see ! :'( too bad for now...

SoulWeaver16 06-02-2021 14:58

Re: [SOLVED] Change entity angle and origin - backweapon
 
What was the plugin or how was it resolved?

Natsheh 06-02-2021 18:02

Re: [SOLVED] Change entity angle and origin - backweapon
 
Quote:

Originally Posted by SoulWeaver16 (Post 2748650)
What was the plugin or how was it resolved?


As it seems the author of the thread didnt really bother to post the solution but here is a side solution

https://forums.alliedmods.net/showpo...7&postcount=10


All times are GMT -4. The time now is 04:53.

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