| Author |
Topic: PlayerWeapons |
| RyanX~rb |
General Member Since: Dec 23, 2006 Posts: 625 Last: Dec 23, 2006 [view latest posts] |
|
|
|
Category: SoFII Mapping Posted: Sunday, Jun. 12, 2005 01:10 pm |
 |
| Code Sample | // prefectly draw a anm14 nade onto the hip and it will stay attached cool. boltWeapon = trap_G2API_AddBolt( cent->ghoul2, 0, "*hip_r" ); memset ( &item, 0, sizeof(item) ); item.renderfx = rf | RF_MINLIGHT; item.ghoul2 = cgs.media.anm14Model; G2_PositionEntityOnBolt ( &item, cent->ghoul2, 0, boltWeapon, cent->lerpOrigin, angles, cent->modelScale ); trap_R_AddRefEntityToScene(&item); |
That works perfect to actually draw the anm14 nade on to the right HIP of the player. Anyone know how to do this sort of thing with an ak74 on the *back |
 |
|
|
| GODh~rb |
General Member Since: Dec 23, 2006 Posts: 1228 Last: Dec 23, 2006 [view latest posts] |
|
|
|
|
| RyanX~rb |
General Member Since: Dec 23, 2006 Posts: 625 Last: Dec 23, 2006 [view latest posts] |
|
|
|
|
| GODh~rb |
General Member Since: Dec 23, 2006 Posts: 1228 Last: Dec 23, 2006 [view latest posts] |
|
|
|
|
| sweatingbullets~rb |
General Member Since: Dec 23, 2006 Posts: 79 Last: Dec 23, 2006 [view latest posts] |
|
|
|
Category: SoFII Mapping Posted: Sunday, Jun. 12, 2005 07:43 pm |
 |
| Code Sample | // Need to add bolt to model if ( cg_items[ MODELINDEX_GAMETYPE_ITEM + i ].boltModel ) { refEntity_t item;
if ( ci->boltGametypeItems[i] == -1 ) { ci->boltGametypeItems[i] = trap_G2API_AddBolt( cent->ghoul2, 0, "*back" ); if ( ci->boltGametypeItems[i] == -1 ) { continue; }
// Remove all identity items on the back CG_RemoveIdentityItemsOnBack ( cent ); }
memset ( &item, 0, sizeof(item) ); item.renderfx = rf | RF_MINLIGHT; item.ghoul2 = cg_items[ MODELINDEX_GAMETYPE_ITEM + i ].boltModel; G2_PositionEntityOnBolt ( &item, cent->ghoul2, 0, ci->boltGametypeItems[i], cent->lerpOrigin, angles, cent->modelScale ); trap_R_AddRefEntityToScene(&item); }
|
Make sure CG_RemoveIdentityItemsOnBack will not cause your weapons to be removed each time a gametype item is picked up. |
 |
|
|
| RyanX~rb |
General Member Since: Dec 23, 2006 Posts: 625 Last: Dec 23, 2006 [view latest posts] |
|
|
|
|
| Gibbs~rb |
General Member Since: Dec 23, 2006 Posts: 152 Last: Dec 23, 2006 [view latest posts] |
|
|
|
|
| RyanX~rb |
General Member Since: Dec 23, 2006 Posts: 625 Last: Dec 23, 2006 [view latest posts] |
|
|
|
|
| Gibbs~rb |
General Member Since: Dec 23, 2006 Posts: 152 Last: Dec 23, 2006 [view latest posts] |
|
|
|
Category: SoFII Mapping Posted: Sunday, Jul. 17, 2005 10:09 pm |
 |
I tried using your code but couldnt figure out how to get it to work. I tried adding this: | Code Sample | | trap_G2API_InitGhoul2Model ( &cgs.media.anm14model, "models/weapons/anm14/world/anm14.glm", 0, 0, 0, 0, 0 ); |
to cg_main.c but still got tons of errors. Could you post the other snippets i need to get this working? That'd be cool  |
 |
|
|
| Gibbs~rb |
General Member Since: Dec 23, 2006 Posts: 152 Last: Dec 23, 2006 [view latest posts] |
|
|
|
Category: SoFII Mapping Posted: Friday, Jul. 29, 2005 07:00 pm |
 |
For testing purposes i copied the nightvision bolt on code. | Code Sample | if ( cent->currentState.eFlags & EF_GOGGLES ) { refEntity_t item;
if ( ci->boltanm14Model == -1 ) { ci->boltanm14Model = trap_G2API_AddBolt( cent->ghoul2, 0, "*hip_r" ); }
memset ( &item, 0, sizeof(item) ); item.renderfx = rf | RF_MINLIGHT; item.ghoul2 = cgs.media.anm14Model; G2_PositionEntityOnBolt ( &item, cent->ghoul2, 0, ci->boltanm14Model, cent->lerpOrigin, angles, cent->modelScale ); trap_R_AddRefEntityToScene(&item); } else if (cg.weaponSelect == WP_ANM14_GRENADE) { return; } |
Basically it draws an Anm14 if the player doesn't have it equiped, and then hides it when the player has it in their hand. What i want to do now is find out what weapons the player has, so if he/she selected an Anm14 but doesn't have it active i want the bolt on to be placed. kinda hard to explain so heres some psuedo code: | Code Sample | if (player has anm14 selected in outfitting && weapon != anm14....) { bolt on code here } |
I've searched and searched but haven't found anything too helpful. Any help would be ideal  |
 |
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|