Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > King's Bounty > King's Bounty: The Legend > Mods

Mods Everything about mods

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 11-20-2012, 01:57 AM
MattCaspermeyer MattCaspermeyer is offline
Approved Member
 
Join Date: Aug 2010
Posts: 553
Lightbulb Give this a try...

Quote:
Originally Posted by jukeey View Post
Sorry for my poor english; and i dont speak Russian.
Thx for advices, but im afraid, my goals impossible.
Okay - that's not a problem, you'll just have to be patient with me when I ask you a bunch of questions...

Quote:
Originally Posted by jukeey View Post
I will try to express myself more accurately, example:
I want to unit resistances should always visible on dlg_chesspiece, in new lines, not only hint. It is possible? And if yes, how?
I think this may be possible...

I think the files you need to start with are: 1) ENG_UNITS.LNG (or your equivalent LNG files) and 2) TEMPLATES.LNG.

At the top of ENG_UNITS.LNG, you'll see where the text descriptions of the abilities are (i.e. you'll see such labels as CPI_LEADERSHIP, CPI_ATTACK, etc. (note that I've capitalized them here so they standout, but they are lower case in my LNG file)). Then you'll see equals (=) and usually a template surrounded by the caret, i.e. ^int_cpi_t0^. Such templates are in TEMPLATES.LNG (search in there for that template) and essentially serve as keywords for a "macro" that can do many different things to display text such as change the color, display a text string, run an LUA function, etc.

Now if you compare the unit cards between TL and WotN, you'll notice that Crit has been added and the unit's Current Health removed from the unit card.

Now what you want to do is add more lines to the the unit card. For this, I think the files you need to edit are DLG_CHESSPIECE.UI and INFO_CHESSPIECE.UI. From your other posts, I can see that you've been modding the UI files pretty extensively and so I think you already know how to edit these files. As far as I can tell, DLG_... is used for outside of the arena and INFO_... is used inside the arena (i.e. when you are not and are fighting battles, respectively).

For all the "begin simple text" statements, the text strings should be in the *.LNG files. For example, "cpi_initiative2" is in ENG_UNITS.LNG. You probably know a lot more about the UI files than I do, but there are other text strings (for example "text_15" or all the "text_##" strings for that matter) that I don't know where they are.

Now if you want to add the resistances, you need to look at the [res] macro under the cpi_defense_h label (in ENG_UNITS.LNG) using the def_hint_t1 template with the res macro (these are located in TEMPLATES.LNG): gen=gen_unit_res. This refers to the gen_unit_res function located in TEXTGEN.LUA. What you probably want to do, since you want the resistances to be spelled out separately, is you're going to want to create variants of that function (i.e. gen_unit_res_physical, ..._astral, ..._fire, etc.) that simply list a value for one resistance type that display the resistance values (as well as the base values). You'll then want to add the lines to display new text lines to the UI files and you can add the new labels to either ENG_UNIT.LNG or your can make a new LNG file with your new labels.

After that, you need to edit the picture of the dialogue to extend its space, but I think you already know how to do this.

I think that is pretty much it - hopefully I've been clear and if not ask more questions!

Quote:
Originally Posted by jukeey View Post
I tried many ways, and failed. Logic....() is not enough. Cant fix hint as simple_text. Resistances available with Au....(unit); but the unit parameter how works? Can i set a unit from hero army? The best solution would be a new, own script. I studied game and mod files, i see the relationships, and i can write some scripts, but this task not feasible for me.
The calls to gen_unit_res use the "data" variable, here is the code for the gen_unit_res function (note that there are two of them, so I'm not sure what happens in LUA in this situation, but they look identical to me):

TL TEXTGEN.LUA (lines 121-136):

Code:
function gen_unit_res(data)
local text=""

        local res_count=AU.rescount()
        for i=0,res_count-2 do
          local res = AU.resistance( data, i )
          local t=""
          if res>95 then res=95 end
          if res> 0 then t="<label=cpi_defense_res_D>" end
          if res< 0 then t="<label=cpi_defense_res_U>" end
        text=text.."<br> -<label=cpi_defense_res_"..(i+1)..">: "..res.."% "..t

    end

return text
end
TL TEXTGEN.LUA (lines 137-151):
Code:
function gen_unit_res(data)
local text=""
        local res_count=AU.rescount()
        for i=0,res_count-2 do
          local res = AU.resistance( data, i )
          if res>95 then res = 95 end
          local t=""
          if res> 0 then t="<label=cpi_defense_res_D>" end
          if res< 0 then t="<label=cpi_defense_res_U>" end
        text=text.."<br> -<label=cpi_defense_res_"..(i+1)..">: "..res.."% "..t

    end

return text
end
Note that this function runs at the end of the cpi_defense_h label via the def_hint_t1 template using the res macro. You may have to add new macros (i.e. res_physical macro that makes a call to your gen_unit_res_physical function, etc.) to the def_hint_t1 template in TEMPLATES.LNG to get AU to work correctly (I'm not sure when this library is available as I've tried to use it sometimes and it wasn't available for use). Another library that you can use if AU is giving you trouble is Logic with the cp_ functions (although it is more for getting base values of the chesspieces).

Let me know if any of this works for you - if you're still having trouble, I'll try to see if I can get it to work, although my time is really limited right now.

Good luck!

/C\/C\

P.S. One thing I'd like to do is to be able to allow units other than Priests to be upgraded via the DLG_CHESSPIECE.UI. I'm not sure how to do this, but I thought it would be neat to allow Beholders to be upgraded to Evil Beholders, etc. when you get the Paladin Inquisition skill. It seems like there has to be a way to get it to work with units other than just Priests, but maybe this is a limitation...
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:24 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.