Jump to content

Help Displaying Model in a Menu


Recommended Posts

For MP Jedi Academy, I'm trying to edit a .menu file (specifically player.menu) to include a 3D preview of the selected player's model (much like the one in player2.menu).

I understand that most people have achieved this by editing the game code itself, but I am wondering if anyone knows of a way to do this in just the vanilla version of Jedi Academy.

I have copied the following lines from player2.menu into player.menu:

itemDef
{
	name			character
	group			models
	type 			ITEM_TYPE_MODEL
	rect			310 192 200 225
	model_g2anim 		"BOTH_WALK1"
	asset_model		"ui_char_model"
	model_angle		180
	//mins maxs format is apparently z x y (hmmm... y x z?)
	model_g2mins		-30 -15 -14
	model_g2maxs		20 15 30
	model_rotation		90
	model_fovx		50
	model_fovy		50
	isCharacter		1
	visible			1
	decoration
}

However, "ui_char_model" only displays the model of "Jaden" in the Character Customization Window (player2.menu).

The closest I have been able to get is adding these lines to the itemDef:

action
{
	setcvar			"ui_char_model" kyle/default
	uiScript		"characterchanged"
	uiScript		"resetcharacterlistboxes"
}

As you can see, this just changes the model in the view to be Kyle Katarn. And even then, he has no textures applied to his model.

Is there any way to set "ui_char_model" to the value stored in "model"? And how would I go about applying the texture?

Link to comment

Sure. If you check the escape from yavin 4 the lost maps mod, and you see the menu files about characters.menu, you will see how properly work this feature. :)

example of displaying model item menu:

 

 

itemDef
        {
            name                character
            group                models
            type                 ITEM_TYPE_MODEL
            rect                360 84 300 340
            
            model_g2anim             "BOTH_WALK1"
            asset_model            "ui_char_model"
            model_angle            180
            model_g2mins            -10 -15 -10
            model_g2maxs            20 15 30
            model_rotation            28
            model_fovx            50
            model_fovy            55
            isCharacter            1
            visible                1
            decoration
        }
 
 

this NEED to be called by an interactive text button, like that:

 

// RESPEN
        itemDef
        {
            name                RESPEN
                        group                           friends
            style                WINDOW_STYLE_EMPTY
            type                ITEM_TYPE_BUTTON
            rect                180 100 100 15
            text                "Respen"
            descText            " "
            font                3
            textscale            .75
            textaligny            0
            textalign            ITEM_ALIGN_LEFT
            textstyle            1
            textalignx            0
            forecolor            1 .682 0 1
            visible                0

            mouseEnter
            {
                show            button_glow
                setitemrect        button_glow    160 100 150 12

                                setcvar                 "ui_char_model" Respen
                                uiScript                "characterchanged"
                uiScript        "resetcharacterlistboxes"

                                setcvar                 "UI_HOME" "Villaggio sconosciuto"
                                setcvar                 "UI_RACE" "Mietitore"
                                setcvar                 "UI_POSITION" "Guardiano della Mente"
                                setcvar                 "UI_HEALTH" "2000"
                                setcvar                 "UI_FORCE" "200"

                                setcvar                 "UI_STRENGTHS" "Conoscenze Arcane. Volontà Ferrea, Telepatia."
                                setcvar                 "UI_WEAKNESSES" "Nessuna nota."
                                setcvar                 "UI_WEAPON_PREF" "Mietitrice d'Aria."
                                show                    information
                setcvar                 "UI_INFO" @CHARS_RESPENSTATUS
            }
            mouseExit
            {
                hide            button_glow
                                uiScript                "characterchanged"
                uiScript        "resetcharacterlistboxes"
            }
            action
            {
                                setcvar                 tier_mapname "maptransition level0"
                play            "sound/weapons/Air_Reaver/airreaver1.mp3";
                close            all
                open            respenstory
            }            
        }

 

example by character menu of my mod, based on character menu of ey4

Link to comment

Thank you for the reply!

But I think you didn't understand what I'm trying to do. I'm not trying to create separate buttons for a finite number of characters. What I'm trying to do is utilize the default table for character selection that comes with the scrollbar. That way, I can add an infinite number of characters and they all be able to be accessible without the need to create a button for each and every character.

 

I want other people to be able to add their own models and not have to make any future edits to .menu files.

A solution would be to do something like: setcvar "ui_char_model" "model", but I know that doesn't work because you can't pass a cvar value as the value for a cvar...as far as I know.

Any ideas?

Link to comment

Thank you for the reply!

 

But I think you didn't understand what I'm trying to do. I'm not trying to create separate buttons for a finite number of characters. What I'm trying to do is utilize the default table for character selection that comes with the scrollbar. That way, I can add an infinite number of characters and they all be able to be accessible without the need to create a button for each and every character.

 

I want other people to be able to add their own models and not have to make any future edits to .menu files.

 

A solution would be to do something like: setcvar "ui_char_model" "model", but I know that doesn't work because you can't pass a cvar value as the value for a cvar...as far as I know.

 

Any ideas?

 

let me understand. is  a custom character menu file \ screen with a button that allow to scroll up all characters available on models directory, or is the character selection for player at the start of game?

Link to comment

Try this:

 

ui_char_model Kyle

ui_char_skin_head default

ui_char_skin_torso default

ui_char_skin_legs default

 

ui_char_model is whatever the model folder is called, for example Jedi_hm, luke, lando.

 

The skin cvars you use to set the skin file name, may or may not need the "model_" bit in the name.

Link to comment

let me understand. is  a custom character menu file \ screen with a button that allow to scroll up all characters available on models directory, or is the character selection for player at the start of game?

You might be thinking of Singleplayer? I am talking about the Multiplayer screen where, after selecting "PROFILE" on the main menu, you get to the jamp/player.menu screen. This screen has a LISTBOX populated with the heads of all the models in the /models/players/ folder.

 

For instance, if someone were to download and add their own model, my objective is to get this menu to also display a 3D preview of that model once they've selected it as their player skin. The "button" I created is just adding an action line to the LISTBOX so that every time they click it, ui_char_model is refreshed to be the model they selected. The problem is, I do not know how to make the "setcvar ui_char_model" line dynamic enough to change to the player's current character model (stored in the cvar: "model")

 

JA+ and JA++ has this feature, but their creators edited the game's code to allow this. Same with, I believe, MOVIE BATTLES II.

 

Try this:

 

ui_char_model Kyle

ui_char_skin_head default

ui_char_skin_torso default

ui_char_skin_legs default

 

ui_char_model is whatever the model folder is called, for example Jedi_hm, luke, lando.

 

The skin cvars you use to set the skin file name, may or may not need the "model_" bit in the name.

Thank you for the help (huge fan of your work btw). Just tried adding "setcvar ui_char_skin_head default" and "setcvar ui_char_skin_head model_default". Neither of those seem to change the value of ui_char_model though.

Link to comment

You might be thinking of Singleplayer? I am talking about the Multiplayer screen where, after selecting "PROFILE" on the main menu, you get to the jamp/player.menu screen. This screen has a LISTBOX populated with the heads of all the models in the /models/players/ folder.

 

For instance, if someone were to download and add their own model, my objective is to get this menu to also display a 3D preview of that model once they've selected it as their player skin. The "button" I created is just adding an action line to the LISTBOX so that every time they click it, ui_char_model is refreshed to be the model they selected. The problem is, I do not know how to make the "setcvar ui_char_model" line dynamic enough to change to the player's current character model (stored in the cvar: "model")

 

JA+ and JA++ has this feature, but their creators edited the game's code to allow this. Same with, I believe, MOVIE BATTLES II.

 

Thank you for the help (huge fan of your work btw). Just tried adding "setcvar ui_char_skin_head default" and "setcvar ui_char_skin_head model_default". Neither of those seem to change the value of ui_char_model though.

 

Sorry i am a SP modder \ coder so i have not familiar with MP. so i cannot help you.

I fear however that is coded. i fear the unique way to do that, is to download ja++ source code, find the code blocks that allow that, paste into a your version of open jk code, and build MP client.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...