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

Make an Aiment Visible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 03-10-2007 , 19:30   Make an Aiment Visible?
Reply With Quote #1

What I'm trying to do is turn off the player's view model (an easy console command) and rely on his own p_ model (the model everyone else sees of his weapon).

The problem I'm having is that it seems whenever you take an entity and attach it to a player (aiment), the player cannot see that entity's model. It's as if it just makes it invisible only to that player. Even the parachute mods we've seen - the person with the parachute cannot see his own parachute even if he looks up.

Is there a way to make the aiment'd entity's model visible to the player it's attached to?
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 03-11-2007 , 19:33   Re: Make an Aiment Visible?
Reply With Quote #2

Update: I managed to see what this looks like by altering the ES_Number so I could control my body remotely - I put my player model inside my view so I wasn't technically attached, and the desired effect is beyond belief - if I can figure out how to do this without the separate player model (by making an aiment viewable to the client it's attached to), the gameplay will be much more advanced.

So overall, is there a way to make the aiment visible to the client it's attached to?
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
watch
Senior Member
Join Date: Sep 2005
Old 03-12-2007 , 09:33   Re: Make an Aiment Visible?
Reply With Quote #3

From weapons.cpp. Hope it helps, I'm not at home so I can't fiddle with it.

Code:
void CBasePlayerItem::AttachToPlayer ( CBasePlayer *pPlayer )
{
	pev->movetype = MOVETYPE_FOLLOW;
	pev->solid = SOLID_NOT;
	pev->aiment = pPlayer->edict();
	pev->effects = EF_NODRAW; // ??
	pev->modelindex = 0;// server won't send down to clients if modelindex == 0
	pev->model = iStringNull;
	pev->owner = pPlayer->edict();
	pev->nextthink = gpGlobals->time + .1;
	SetTouch( NULL );
}
__________________
Code:
#include <amusing_small_signiture>
watch is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 03-12-2007 , 13:46   Re: Make an Aiment Visible?
Reply With Quote #4

Thanks for your help watch.

One thing I noticed in messing with it was that if I tried to change pev_effects to make it visible or invisible (EF_NODRAW), nothing was altered for anyone.

That got me thinking...the reason we see other players holding a weapon is because of their pev_weaponmodel value...so theoretically that is not the weapon entity that we are looking at.

What happens to the weapon entity when a player is holding it? Does it get killed or turn invisible? Should I really be asking how to allow a player to see his own pev_weaponmodel ?
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
VEN
Veteran Member
Join Date: Jan 2005
Old 03-12-2007 , 15:15   Re: Make an Aiment Visible?
Reply With Quote #5

Quote:
Does it [...] turn invisible?
Yes.

Quote:
Should I really be asking how to allow a player to see his own pev_weaponmodel ?
I do not see a point.

p-model is for 3rd person view
v-model is for 1st person view

So what would be the point in displaying 3rd person view model in 1st person view?
VEN is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 03-13-2007 , 13:20   Re: Make an Aiment Visible?
Reply With Quote #6

Because if you are able to see your own p-model instead of v-model, the weapon model will actually point in different directions and different positions based on your aim, similar to that of Red Orchestra or even the old game Goldeneye.

http://29th.org/video/dynamicaim.zip -- this is what it would look like, minus the white player model holding it (that's the only way I could test it)
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-13-2007 , 19:07   Re: Make an Aiment Visible?
Reply With Quote #7

Hiho, Wilson! You always try to do the craziest stuff. ;)

This particular issue seems to be an engine limitation, so it makes the workaround even trickier. Based off of your DoD Paratrooper mod, I was able to create the following:

Code:
#include <amxmodx>  #include <engine>  #include <fakemeta>  new aiment[33], maxPlayers;  public plugin_init()  {     register_clcmd("say aiment","make_aiment");     register_forward(FM_AddToFullPack,"fw_addtofullpack",1);     maxPlayers = get_maxplayers();  }  public plugin_precache()  {     precache_model("models/parachute_khaki.mdl");  }  public fw_addtofullpack(es_handle,e,ent,host,hostflags,player,pSet)  {     new owner = get_es(es_handle,ES_AimEnt);     if(owner > 0 && owner < maxPlayers+1 && ent == aiment[owner])         set_es(es_handle,ES_AimEnt,0);     return FMRES_IGNORED;  }  public make_aiment(id)  {     aiment[id] = create_entity("info_target");     entity_set_model(aiment[id],"models/parachute_khaki.mdl");     entity_set_int(aiment[id],EV_INT_movetype,MOVETYPE_FOLLOW);     entity_set_edict(aiment[id],EV_ENT_aiment,id);     entity_set_int(aiment[id],EV_INT_sequence,1);     entity_set_float(aiment[id],EV_FL_animtime,20.0);     entity_set_float(aiment[id],EV_FL_framerate,1.0);  }

This allows the aiment to be seen by the player that it is attached to. However, for some reason its vertical location seems to become twice as high as it should be. But, hopefully this will give you a jumping off point.

Cheers!
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 03-13-2007 , 20:36   Re: Make an Aiment Visible?
Reply With Quote #8

Awesome, Avalanche, thanks so much for the help!
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
manchimocyrus
Member
Join Date: Nov 2006
Location: Vitan
Old 03-14-2007 , 15:07   Re: Make an Aiment Visible?
Reply With Quote #9

Give this model parachute_khaki.mdl .
manchimocyrus is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 03-14-2007 , 18:27   Re: Make an Aiment Visible?
Reply With Quote #10

It's available in DoD Paratrooper, from the Approved Plugins forums. If I get a chance later I'll post a direct link.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
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 17:48.


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