YO 0 Posted January 25, 2009 Well, i think topic title says all about it, I would like to know, first, where is declared that screen that shows velocity, fuel, etc when in a vehicle, and how can it be modified for certain vehicles to add some extra info, if possible. thx in advance. Share this post Link to post Share on other sites
[aps]gnat 28 Posted January 26, 2009 unitInfoType = "UnitInfoSoldier"; unitInfoType = "UnitInfoTank"; unitInfoType = "UnitInfoAirplane"; unitInfoType = "UnitInfoHelicopter"; unitInfoType = "UnitInfoShip"; I could be wrong but I think they are all hard-coded. .... love to know how the turret display bit works. Share this post Link to post Share on other sites
[frl]myke 14 Posted January 26, 2009 @[APS]Gnat In the bin.pbo there is this part: http://pastebin.com/m5e1818b0 Seems it should be possible to define own displays for it. If i'm not completely wrong, of course. Share this post Link to post Share on other sites
[aps]gnat 28 Posted January 26, 2009 hmmmm ... certainly looks like its related. But no idea how to properly add my own .... Share this post Link to post Share on other sites
.kju 3245 Posted January 26, 2009 well just try to define a new class in there (just copy+rename one existing as a start i suggest) and assign the value to the vehicle see what happens Share this post Link to post Share on other sites
YO 0 Posted January 26, 2009 much appreciated. I'll try to make as Q says, copy-pasting and renaming. As soon as I get it I post it here. Share this post Link to post Share on other sites
YO 0 Posted January 26, 2009 I've been playing for a while with bin.pbo's config but cannot make it works. First I'm unable to declare class RscInGameUI properly cause it demands so many other classes it inherits from for text format, so I made a replacing addon with whole bin.pbo in wich I only changed 'text' parameters inside RscInGameUI class, giving a fix text instead of stringable, but it seems to do nothing. Second problem i've glimpsed, the 'text' parameters are set to $STR_DISP_ERROR, wich is an error string in stringableUI.csv, so really don't know how the game reads the proper info to show it on the status screen, nor how I could write code there when a string is expected. Any help on this is much appreciated Share this post Link to post Share on other sites
[frl]myke 14 Posted January 26, 2009 It seems that <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> text="$STR_DISP_ERROR"; is some kind of placeholder for the case the real value can't be displayed for any reasons....kind of debug text. If you see this, somethings wrong. However, as the noob in dialogue writing (or even understanding) i guess the real value to be displayed is added by the class idc: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> idc=118; as in <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Weapon: RscIGText { idc=118; x=0.025000; y=0.380000; w=0.190000; text="$STR_DISP_ERROR"; }; But i can't say where this value is defined. Would also like to know more about this as i have a similar problem. Share this post Link to post Share on other sites
.kju 3245 Posted January 26, 2009 that approach is no good. you can easily go for an addon. define a proper cfgPatches header and try this http://pastebin.com/m5630e164 and use <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">cfgVehicles { ... class MyUnit: ... { unitInfoType = "UnitInfoSoldier_My"; }; }; even inheritance should work <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class RscUnitInfoSoldier; class RscUnitInfoSoldier_My: RscUnitInfoSoldier { // bla }; Share this post Link to post Share on other sites
[frl]myke 14 Posted January 26, 2009 that approach is no good. Which approach you mean? Me or YO? However, while digging into the various pbo's i found this in ui.pbo/resincl.hpp: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> // InGameUI // - unit info #define IDC_IGUI_TIME 101 #define IDC_IGUI_DATE 102 #define IDC_IGUI_NAME 103 #define IDC_IGUI_UNIT 104 #define IDC_IGUI_VALUE_EXP 106 #define IDC_IGUI_COMBAT_MODE 107 #define IDC_IGUI_VALUE_HEALTH 109 #define IDC_IGUI_VALUE_ARMOR 111 #define IDC_IGUI_VALUE_FUEL 113 #define IDC_IGUI_CARGO_MAN 114 #define IDC_IGUI_CARGO_FUEL 115 #define IDC_IGUI_CARGO_REPAIR 116 #define IDC_IGUI_CARGO_AMMO 117 #define IDC_IGUI_WEAPON 118 #define IDC_IGUI_AMMO 119 #define IDC_IGUI_VEHICLE 120 #define IDC_IGUI_SPEED 121 #define IDC_IGUI_ALT 122 #define IDC_IGUI_FORMATION 123 #define IDC_IGUI_BG 124 #define IDC_IGUI_COMMANDER 125 #define IDC_IGUI_DRIVER 126 #define IDC_IGUI_GUNNER 127 The numbers go along with those in the bin.pbo but right now i can't see how i could alter the infos displayed. Let me give a more specific example: In a vehicle it shows me the name of the currently selected weapon and the amount of munition left. Lets say i don't want the weapon name displayed but the magazine name....from which side i should approach this, where and how can i define the value for this. right now, these values are defined within these 2 blocks, referring to the IDC's listed above: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Weapon: RscIGText { idc=118; x=0.005000; y=0.185000; w=0.250000; text="$STR_DISP_ERROR"; }; class Ammo: RscIGText { idc=119; style="0x01 + 0x100"; x=0.170000; y=0.190000; w=0.150000; text="$STR_DISP_ERROR"; }; As said, i don't really understand dialogue scripting so i'm lost here. Share this post Link to post Share on other sites
.kju 3245 Posted January 26, 2009 @Myke It was a response to Yo's editing the bin.pbo itself. You kinda posted the same time, so didnt know even about your post. Â IDC are links to hardcoded functionality. Share this post Link to post Share on other sites
[frl]myke 14 Posted January 26, 2009 IDC are links to hardcoded functionality. Hmmm...so this means they can't (or shouldn't) be altered. But how about to add more IDC's? Like the last IDC has number 127 so would it be possible to add something new? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #define IDC_IGUI_AMMONAME 128 If this would work, how would i assign the respective value to it? Share this post Link to post Share on other sites
.kju 3245 Posted January 27, 2009 A define is only a text replacement: http://community.bistudio.com/wiki/PreProcessor_Commands#.23define So you can use strings like true and false, instead of 1 and 0. Just helps for readability in this case. The IDC number is read by the engine and does something. Kinda of (set of) function(s). It may read values, and display sth. Or whatever it does. The only thing you can do is to use IDC values, you cannot alter their functionality. Using IDCs for workaround/hacks probably wont work well, as no one really knows how a specific IDC works and what it does. Share this post Link to post Share on other sites
YO 0 Posted January 27, 2009 thanks for your answers, really value comments came here. @ Q: using #define is a way to write with synonymous words, like 0 intead of true, etc. That's ok. So I assume IDC_IGUI_TIME, IDC_IGUI_DATE, IDC_IGUI_NAME, etc are internal variables the game has, and that they have a value, so where it says: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Weapon: RscIGText { idc=118; x=0.005000; y=0.185000; w=0.250000; text="$STR_DISP_ERROR"; }; one could replace idc=118; for: idc=(score player); or the way it has to be written here, but in any case, any other variable you want to be shown. Or is not? Assuming that, I've tried -unsuccesfuly- to build a new unitInfoType. First case I've tried to inherit the most I could and simply adding a new unitInfoType, wich results in my helo showing the green background af an empty hint. here's the config: http://pastebin.com/m6a4e02eb Second case I've declared whole class RscInGameUI, wich made standard unit screen to show the info in green instead of white (like if they were vehicles instead of soldiers) and making my helos screen to be shown empty again but with grey background like normal hints, and reporting some error when entering default choppers. config: http://pastebin.com/m3dc0e508 It seems to me I miss some property to be inherited or something like this but really can't see what it's. Thanks for your help. PS: wich syntax highlighting do u use for configs and SQF scripts in pastebin? Share this post Link to post Share on other sites
.kju 3245 Posted January 27, 2009 As you see above the string is replaced with a number. So again the engine itself doesnt know 'IDC_IGUI_TIME'. That will be replaced by a number. The number has an internal function assigned to the UI element. (per rsc dialog i think) From what I know an IDC is never a simple variable. It doesnt relate to scripting code either. Instead its a set of functionality from the engine (c++ code). try Quote[/b] ]class RscUnitInfo;class RscUnitInfo_WI : RscUnitInfo {}; You should use the unitInfoType of the given unit first and change the width or sth visible. Next introduce the inheritance, change it only in there and assign the new unitInfoType. Share this post Link to post Share on other sites
YO 0 Posted January 29, 2009 Quote[/b] ]You should use the unitInfoType of the given unit first andchange the width or sth visible. don't get what u mean. Do u say I should modify RscUnitInfo class (before declaring RscUnitInfo_WI by inheritance), or should I add a unit using that default unitInfoType? Sorry I'm asking too much but neither my comprehension of english nor such config stuff is very good. Btw, I've tried both with null results. I'd really appreciate if someone could provide a working example. thx Share this post Link to post Share on other sites