Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 6 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Soldier of Fortune
Category: SoFII Mapping
Mapping, modeling, scripting, skinning and all forms of editing for the game Soldier of Fortune II
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: PlayerWeapons
RyanX~rb
General Member
Since: Dec 23, 2006
Posts: 625
Last: Dec 23, 2006
[view latest posts]
Level 6
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
Share |
GODh~rb
General Member
Since: Dec 23, 2006
Posts: 1228
Last: Dec 23, 2006
[view latest posts]
Level 8
Category: SoFII Mapping
Posted: Sunday, Jun. 12, 2005 01:31 pm
No (not yet) but maybe look how it is done for the flag in CTF or the bomb in DEM??
Share |
RyanX~rb
General Member
Since: Dec 23, 2006
Posts: 625
Last: Dec 23, 2006
[view latest posts]
Level 6
Category: SoFII Mapping
Posted: Sunday, Jun. 12, 2005 03:35 pm
yeh thats how i used it but it wont stay attached with the ak!
Share |
GODh~rb
General Member
Since: Dec 23, 2006
Posts: 1228
Last: Dec 23, 2006
[view latest posts]
Level 8
Category: SoFII Mapping
Posted: Sunday, Jun. 12, 2005 03:56 pm
Huh??? Flags, bombs and briefcases do stay there... i think the answer is in CG_PlayerGametypeItems.
Share |
sweatingbullets~rb
General Member
Since: Dec 23, 2006
Posts: 79
Last: Dec 23, 2006
[view latest posts]
Level 3
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.
Share |
RyanX~rb
General Member
Since: Dec 23, 2006
Posts: 625
Last: Dec 23, 2006
[view latest posts]
Level 6
Category: SoFII Mapping
Posted: Monday, Jun. 13, 2005 12:58 am
just try to bolt the ak model on there.. it wont work trust me, ;\
Share |
Gibbs~rb
General Member
Since: Dec 23, 2006
Posts: 152
Last: Dec 23, 2006
[view latest posts]
Level 4
Category: SoFII Mapping
Posted: Sunday, Jul. 17, 2005 01:48 am
You figured this one out yet RyanX? I'd like to know how to do this :)
Share |
RyanX~rb
General Member
Since: Dec 23, 2006
Posts: 625
Last: Dec 23, 2006
[view latest posts]
Level 6
Category: SoFII Mapping
Posted: Sunday, Jul. 17, 2005 08:47 pm
nope, give up on it..
Share |
Gibbs~rb
General Member
Since: Dec 23, 2006
Posts: 152
Last: Dec 23, 2006
[view latest posts]
Level 4
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  :cool:
Share |
Gibbs~rb
General Member
Since: Dec 23, 2006
Posts: 152
Last: Dec 23, 2006
[view latest posts]
Level 4
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 :)
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Soldier of Fortune : SoFII Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»