PDA

View Full Version : JA Bug: Species Rotation *fixing, need help*


Teancum
01-03-2004, 07:04 PM
I have about 8 different species in my rotation, but there is a
nasty bug in the species selection code. Left click moves it
forward to the last one on the list, then cycles between the last
3, right click goes backwards, get the ones in the middle, then
cycles between the first 3. To kindof explain what I'm talking
about, here is my meuns.str:



REFERENCE JEDI_CF
NOTES "For character menu"
LANG_ENGLISH "Chiss Female"

REFERENCE JEDI_CM
NOTES "For character menu"
LANG_ENGLISH "Chiss Male"

REFERENCE JEDI_HF
NOTES "For character menu"
LANG_ENGLISH "Human Female"

REFERENCE JEDI_HM
NOTES "For character menu"
LANG_ENGLISH "Human Male"

REFERENCE JEDI_KDM
NOTES "For character menu"
LANG_ENGLISH "Kel Dor Male"

REFERENCE JEDI_RM
NOTES "For character menu"
LANG_ENGLISH "Rodian Male"

REFERENCE JEDI_TF
NOTES "For character menu"
LANG_ENGLISH "Twi'lek Female"

REFERENCE JEDI_ZF
NOTES "For character menu"
LANG_ENGLISH "Zabrak Female"

REFERENCE JEDI_ZM
NOTES "For character menu"
LANG_ENGLISH "Zabrak Male"

So, say we start with Rodian, left click takes us all the way to Zabrak Male, then, Twi'lek, Zabrak Female, and Zabrak Male over and over. Right click will take us all the way to Chiss Female, then Human Female, Chiss Male, Chiss Female over and over. I believe I have hunted down the area of ui_main.c that covers this, but I'm not sure how to change this to get it to cycle properly. I'm assuming it's just a max_variable, and it can't go above a certain number of species, but what do I know? Anyhow, here it is:


static void UI_UpdateCharacter( qboolean changedModel )
{
menuDef_t *menu;
itemDef_t *item;
char modelPath[MAX_QPATH];
int animRunLength;

menu = Menu_GetFocused(); // Get current menu

if (!menu)
{
return;
}

item = (itemDef_t *) Menu_FindItemByName(menu, "character");

if (!item)
{
Com_Error( ERR_FATAL, "UI_UpdateCharacter: Could not find item (character) in menu (%s)", menu->window.name);
}

ItemParse_model_g2anim_go( item, ui_char_anim.string );

Com_sprintf( modelPath, sizeof( modelPath ), "models/players/%s/model.glm", UI_Cvar_VariableString ( "ui_char_model" ) );
ItemParse_asset_model_go( item, modelPath, &animRunLength );

if ( changedModel )
{//set all skins to first skin since we don't know you always have all skins
//FIXME: could try to keep the same spot in each list as you swtich models
UI_FeederSelection(FEEDER_PLAYER_SKIN_HEAD, 0, item); //fixme, this is not really the right item!!
UI_FeederSelection(FEEDER_PLAYER_SKIN_TORSO, 0, item);
UI_FeederSelection(FEEDER_PLAYER_SKIN_LEGS, 0, item);
UI_FeederSelection(FEEDER_COLORCHOICES, 0, item);
}
UI_UpdateCharacterSkin();
}


To me that's all gibberish. I've only coded in cog (Jedi Knight 1's language) so I don't understand exactly what's going on. Anyhow, if someone will lead me in the right direction, I'll try some fixes.

*edit* I've found MAX_PLAYERMODELS in ui_local.h, and playerSpeciesCount seems to be connected to it. Don't know if that helps. On a related note, is there a way to search for something in the whole library with VS.net or do I have to open each file manually?

razorace
01-03-2004, 10:30 PM
Yeah, I noticed that the button selection seemed a bit weird. I'm pretty sure that UI_UpdateCharacter() isn't the root of the problem. I'm guessing that it involves something that calls UI_UpdateCharacter().

Teancum
01-03-2004, 10:42 PM
Okay, I'll start hunting for things that call for UI_UpdateCharacter

Teancum
01-04-2004, 08:38 AM
You know, on second thought, I'm not quite sure where to begin.

Teancum
01-06-2004, 11:07 PM
Left a post over at forgelink, where Raven members visit. They said they'd talk to the coders, and see if it's an easy fix

razorace
01-07-2004, 12:07 AM
Well, the selector still works correctly, right? It's just weird.

As such, I might look into it at some point but I'm pretty sick of doing minor bugfixes for now. There's little point of fixing minor issues when gameplay isn't engaging enough to keep people playing as is.

ASk
01-07-2004, 12:55 PM
On a related note, is there a way to search for something in the whole library with VS.net or do I have to open each file manually?


3 ways:

1) Native - Edit->Find->Find in files , set root dir to something like <location of code>, or <location of code>\game, depends where you want it to start searching from

Tick "look in subfolders", enter your text into search field and off you go.

2) Plugin for VS.net - There's a very good plugin for VS6/.NET called VisualAssist. It provides you with this service (any many more) on-the-fly. However it's commercial (30 day trial is available I believe)

3) External - get Doxygen (www.doxygen.org)
Run it and create a default.cfg
Edit it to fit your preferences (namely path to code files and depth of parsing). Run doxygen again with the edited file as parameter. Wait a few hours and it will generate cross-reference/documentation for the code (the level of documentation depends on the level of the comments in code)

Teancum
01-20-2004, 06:22 AM
HA! Such a simple fix! I simply upped MAX_PLAYERMODELS to 128. It is fixed both in SP and MP. I recommend that MAX_PLAYERMODELS be upped to 128 to avoid any future problems.

razorace
01-20-2004, 07:02 PM
I thought the problem was only in MP?

Teancum
01-20-2004, 07:51 PM
Well, in SP, you could only get all of the models by going backwards (right clicking) through the species. But this fixed both SP and MP.