squidgy617 Posted December 11, 2014 Posted December 11, 2014 I posted this on LucasForums but that place is pretty barren, so I thought I'd post here and see if I can get an answer. Hi everyone. I'm very new to coding for Jedi Academy, and I'm just trying to learn the basics of it all. I have some programming experience but I've never messed with JA's code before so I'm just figuring out how everything ticks. Anyway, to start off I wanted to make it so that at the character select screen (not the character customization screen), the player can see the character model in a sort of preview pane, just like what the character customization screen does, but in this case its just displaying the model of whatever character you've chosen. Naturally, I just copied the code over from the character customization screen: //Character Model display itemDef { name character group models type ITEM_TYPE_MODEL //rect 95 84 820 1000 rect 52 84 900 1000 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 -20 -15 -10 //model_g2maxs 10 15 20 model_g2mins -10 -15 -10 model_g2maxs 20 15 30 model_rotation 50 //model_fovx 75 model_fovx 50 //model_fovy 75 model_fovy 50 isCharacter 1 visible 1 decoration } Now, its just sort of slapped haphazardly onto the menu screen with no effort put into making it look pretty (for now), but that's not my issue at the moment. See, my problem is that it shows a texture-less female Twi'lek at all times, instead of showing the character the player has selected. I am almost certain that changing "ui_char_model" to something else will give me my desired result (although I could need to do more as well I'm sure), but I'm not sure what exactly I have to change it to, or what else I need to change to get the model to show up. I'm new to all this and just trying to get my hands dirty to start learning. I will probably have a lot more questions in the future, but I'd like to play around with things before asking any more. Doesn't hurt to ask though, right? Thanks in advance. I realize menus are different from the actual source code, but here's hoping someone knows how to do this. If I wasn't totally clear in there... I'm trying to do something similar to what JA+ does, where when you select your character model/skin, it displays, similar to the character creation screen. Thanks in advance.
Tempust85 Posted December 11, 2014 Posted December 11, 2014 So you've already chosen your character in a previous menu, and now you just want to display the character model choice as a 3D portrait? If so, you need to add: uiScript "character" to the onOpen part of your menu file. Leave your posted menu snippet stuff as-is, it's fine. I just tested this and it should display what you want.
squidgy617 Posted December 12, 2014 Author Posted December 12, 2014 Thank you, that got me a step closer and is much better than my previous issue, but I don't think that was specific enough. The menu I'm playing with here is the skin selection screen - not the customization one, but the skin selection. So, the player will be choosing preset characters such as a stormtrooper or Kyle or Luke etc., and I want the 3D portrait to change based on what character the player chooses. What you said is better, but I want it to load the model the player chooses before even leaving the menu. Thank you very much for the help though! Its getting me much closer.
Asgarath83 Posted December 12, 2014 Posted December 12, 2014 Thank you, that got me a step closer and is much better than my previous issue, but I don't think that was specific enough. The menu I'm playing with here is the skin selection screen - not the customization one, but the skin selection. So, the player will be choosing preset characters such as a stormtrooper or Kyle or Luke etc., and I want the 3D portrait to change based on what character the player chooses. What you said is better, but I want it to load the model the player chooses before even leaving the menu. Thank you very much for the help though! Its getting me much closer.Download the escape from yavin 4 the lost map Mod. this mod have a large and expensive character menu: there is a character creaton menu, but also a section about story and characters of the mod that show every model of every character of the game. Studying UI of EY4 for me was really precious for making UI menu of my mod. i suggest you to study the structures of menu of EY4 mod about characters 3d show
squidgy617 Posted December 13, 2014 Author Posted December 13, 2014 Download the escape from yavin 4 the lost map Mod. this mod have a large and expensive character menu: there is a character creaton menu, but also a section about story and characters of the mod that show every model of every character of the game. Studying UI of EY4 for me was really precious for making UI menu of my mod. i suggest you to study the structures of menu of EY4 mod about characters 3d show That was extremely helpful. I took a look at it as well as JA+'s code, but unfortunately I still cannot achieve what I'm trying to do. Both will be useful for reference in the future, however. Even when directly copying the ui from JA+, what I'm trying to do is not achieved. Instead, it just loads a generic jedi. This leads me to believe that they must have changed some of the actual code to get JA+ working properly. My guess, somewhere in the code they force the jedi model to change something else. I've been sifting through the code for a couple of hours now trying to find what exactly I need to change/add to to get this working, but I can't find it. I'm guessing I need to find the character select screen code - i.e. where it tells the game what character you've chosen - and in that I can force the ui model to change as well, hopefully. Thanks anyway, though. Hopefully someone knows how to do this. Asgarath83 likes this
Asgarath83 Posted December 14, 2014 Posted December 14, 2014 so on JA+ have changed the character selection code? O.o aw, damn.EY4 mod can work with normal JK and OpenJK. :| but what they change the code of character menu?
squidgy617 Posted December 15, 2014 Author Posted December 15, 2014 I don't know. EY4 seems to just use the ui_char_model cvar and change that based on what you clicked, but they don't have a system in place to make it change based on what character you've chosen, which is what I want to achieve. JA+ on the other hand changes the model based on the character you've chosen, which is exactly what I'm trying to do, but somewhere in the game's code they must have set that up because otherwise its just a generic jedi. If I can find where the code decides what model you're using and also force it to change the the model displaying on the main menu or something to that nature, I can do what I want, but until then I am stuck.
Asgarath83 Posted December 15, 2014 Posted December 15, 2014 I don't know. EY4 seems to just use the ui_char_model cvar and change that based on what you clicked, but they don't have a system in place to make it change based on what character you've chosen, which is what I want to achieve. JA+ on the other hand changes the model based on the character you've chosen, which is exactly what I'm trying to do, but somewhere in the game's code they must have set that up because otherwise its just a generic jedi. If I can find where the code decides what model you're using and also force it to change the the model displaying on the main menu or something to that nature, I can do what I want, but until then I am stuck. Pity JA++ developer and also the dark force MP mod not release his code with a signing of all edit maked.
Raz0r Posted December 15, 2014 Posted December 15, 2014 The menu I'm playing with here is the skin selection screen - not the customization one, but the skin selection. So, the player will be choosing preset characters such as a stormtrooper or Kyle or Luke etc., and I want the 3D portrait to change based on what character the player chooses.In JA++, I had to edit the UI code for that, not just the .menu file. It's probably not exactly the same as Slider's code, but it seems to work. Pity JA++ developer [...] not release his code with a signing of all edit maked.JA+ is not related to JA++, and all of my (JA++) code is freely available (with revision history)
Asgarath83 Posted December 15, 2014 Posted December 15, 2014 In JA++, I had to edit the UI code for that, not just the .menu file. It's probably not exactly the same as Slider's code, but it seems to work. JA+ is not related to JA++, and all of my (JA++) code is freely available (with revision history)Sorry for mistake.
squidgy617 Posted December 15, 2014 Author Posted December 15, 2014 In JA++, I had to edit the UI code for that, not just the .menu file. It's probably not exactly the same as Slider's code, but it seems to work. JA+ is not related to JA++, and all of my (JA++) code is freely available (with revision history) Aha! I've been looking at JA++ for a while but was struggling to find the code. Upon further inspection, I've finally figured it out! Everything works! Thanks everybody! And thanks for having that source code available, Raz0r, it was very helpful indeed. Raz0r likes this
Jeff Posted December 16, 2014 Posted December 16, 2014 Aha! I've been looking at JA++ for a while but was struggling to find the code. Upon further inspection, I've finally figured it out! Everything works! Thanks everybody! And thanks for having that source code available, Raz0r, it was very helpful indeed. What was the fix?
Rayce Posted January 2, 2015 Posted January 2, 2015 Hello. Sorry for reviving this, but I'm looking to do the same thing. Can you please tell me what the solution is? As well as how add a placeholder icon for models that don't have them, like JA+ does? Thanks in advance.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now