![]() |
|
Mods Everything about mods |
![]() |
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
![]()
Sorry for my poor english; and i dont speak Russian.
Thx for advices, but im afraid, my goals impossible. 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 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. In warcraft3 editor, i was able to accomplish pickpocketing five minutes with triggers. 5 years ago, when programming was chinese for me. Code sipmply, logical; events, objects clearly. Easy to display my own textboxes with custom texts. Easy to insert my own models and textures. And great documentation with examples. Now i have experienced with delphi (+minimal javascript, actionscript, php knowledge). Lua syntax not too much of a problem; but kings bounty scripting very strange, and im afraid, very limited. And documentations not available or incomplete. |
#2
|
|||
|
|||
![]() Quote:
Quote:
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:
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 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 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... |
#3
|
|||
|
|||
![]()
Thank you very much for detailed advices.
Info_chesspiece.ui opening only on main window as infobox, when right click on unit in hero army. All other cases the dlg_chesspiece.ui opening when click on unit, as dialog form. Ui files easy editable, i wrote a program which can read this files, and show me visually with names and coordinates, no problem (i adjusted some ui files and png interface-textures for better appearance). But resistances: I think, the first "gen_unit_res" function maybe a trash, only the second works. Your advices was my first idea, Tried and failed. Maybe i did something wrong; but i think, its simply dont work. My second idea: creating 6 global variables, and including to loop in "gen_unit_res" this: if i==0 then fiz=res end if i==1 then mer=res end if i==2 then mag=res end if i==3 then tuz=res end if i==4 then fag=res end if i==5 then ast=res end function gen_unit_res(data) local text="" local res_count=AU.rescount() for i=0,res_count-1 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 if i==0 then fiz=res end if i==1 then mer=res end if i==2 then mag=res end if i==3 then tuz=res end if i==4 then fag=res end if i==5 then ast=res end text=text.."<br> -<label=cpi_defense_res_"..(i+1)..">: "..res.."% "..t end if Game.LocIsArena() then if Attack.act_feature(data, "humanoid") then local count = Attack.val_restore(data,"contrstrike") if count~=nil and count~="" then text = text.."<br><br>Îňâĺňíűő ŕňŕę îńňŕëîńü: "..count end end end return text end This is work, new variables got the correct resistance values, when function execute, but problems: This function execute when hint appear (onmouseover event on gui_object_name "defense" on chesspiece dialog). So not enough to open the dialog, must move the cursor over "defense" text. I can adjust this invisible object over cursor, or fullscreen ![]() Variables got the values, but new texts not refreshed actually, only when opening next time the dialog... Events and other essential things seems absolutely unavailable. Its serious? Other: I understand what do you want, great idea. But im afraid, impossible with this way. Too limited, this few modifiable thing is chaotic. With a decent editor or api, we can make castles, buildings for races, write pathfinding algorithm for ai, etcetera. Better than homm. But with this pile of diffuse code, i say, waste of time. Great, beautiful, funny and tactical game with terrible mechanism. Maybe converting models and write a new program, easiest and time-saving modding. |
#4
|
|||
|
|||
![]() Quote:
I've actually been updating my HOMM3 Babies (H3B) mod to extend the spirit upgrade UI and have been doing it by hand. I've been making some changes and I was running out of room and so decided to start fiddling with the interface - your mod that did this helped me out, although when I replied to you at first I didn't realize you were the one who created this mod. Quote:
Quote:
I know that a lot of stuff in TL is hard coded, but when they went to AP and beyond they opened stuff up. Case in point, I'm still working on my H3B mod for TL and have made a change to the Ice Thorns ability where not only do they block passage, but they also hit and damage units if they are within the fall radius (the hexes surrouding the triad of 3, i.e. if the unit wasn't there a thorn would be created in that hex). I've been able to get everything working except having the damage hint show up correctly. It seems like to get it to calculate the cells properly, you have to use Attack.multiselect(3), but when you do that, if you turn on hints, the units have to be within the multiselect triad to have damage displayed even though the calccells function selects the cells surrounding that triad. So it is silly - the highlighted hexes will be the ones where the thorns go and are around the triad, but I have to place the triad on top of units (where the thorns don't go) to get it to display the damage hint, which is not correct. I haven't given up, yet, but I know what you mean when it comes to dealing with limitations of the game engine / system. If you look at Fishes and Rage Drain, though, these abilities don't show the damage either and so I think that it is most likely a limitation of TL or it was too convoluted to implement so I might give up soon and have it not display the hint just like Fishes and Rage Drain (although if I figure out how to do it for Ice Thorns, then maybe I can try to do it for these two as well). /C\/C\ |
#5
|
|||
|
|||
![]()
Hello matt,
You're the most advanced modder for KB (except may be russian one ![]() There so many change in LUA files that it's not realistic to transfert them one by one, only if we can import whole files....and what files ? LUA, .TXT, all loc_ses ok but how to integrate them into the Armored princess campaign with Amelie for Hero ? My question is ridiculous, no one know. ![]() |
#6
|
|||
|
|||
![]() Quote:
![]() Seriously, I'm sure there are quite a few good ones on the board here, but thanks! Quote:
I'm in the throws right now of making my H3T mod for AP and CW and I wish I could easily port stuff over from my H3B mod for TL and be done, but it is much more involved than that. I've been striving to create a common set of files between my AP and CW H3T mods and so far it is doable, but time consuming. Then the CW variant will have a superset of the files that are different, and then if I happen to still be wanting to mod this game, the WotN files would be another superset... I'm also still working on my H3B mod for TL and have a big update coming... The point is that you're most likely right in that it'd be really time consuming, but it is doable so long as my comment about the engine being the same is true. Tell me about it - I actually started playing WotN, but then when I saw how buggy it was, I figured I'd shelve it and wait 6 months for it to be fixed. I bet Jukeey could update the Rage Ability UI and make room for another set of abilities around the core 9 (i.e. another 16 new abilities) for a total of 25 - 4 each for the 5 Valkyries and then 5 for your hero (or something like that). Would be cool! Anyway... Quote:
You could also go the other way, and try the AP files with the WotN engine - that might be the better idea, actually, since AP should have at least everything that WotN has. You would not to have to worry about the engine being different, either. It also might be easier, then, to splice in the AP maps, quests, etc. into the WotN *.kfs files. Most likely, though, you're in for quite a long project. For the skills, you might be able to simply replace the SKILLS.TXT in AP with the one for WotN, but you'll have to follow a similar process as above with respect to finding all the functions used by the skills (most likely in SKILLS.LUA), the skill picture icons (they may be in a TEX*.DDS file), and then editing HERO.TXT to include the skills for each class to start with (amongst other tasks). There are quite a few users on the forums with knowledge modding WotN (i.e. the BugFixes thread) - maybe you can get one of them to help you? Probably would be a better use of their talents since Katauri / 1C are the ones who are supposed to fixing the game (we gave them money after all), although, I whole-hearted appreciate their efforts! /C\/C\ |
#7
|
|||
|
|||
![]() Quote:
In fact i tried to use Wotn into a new campaign for crossworld, but it don't work, also in the editor, so yeah unfortunately there are some portability problem. Quote:
![]() And yes it would be cool to have new ability for valkyries but animation and rage skill are pretty hard to mod. Quote:
I would prefer to grad all LUA,TXT and loc_ses and found inside how to make amelie the hero inside wotn files. After find what Armored princess engine don't like into them....hard job, yup, but may be doable. |
#8
|
|||
|
|||
![]() Quote:
Not sure if you can still find the mod on these boards. If not, let me know and I'll try to upload it to this thread. Note: the mod I mentioned requires KBMaster mod. |
#9
|
|||
|
|||
![]()
Yah - I know about that mod (and I'm pretty sure I have it), it would just be nice to use the UI on the unit info card to do it, though, since it works so well. Plus, I kind of wanted to make the Inquisition skill apply to units other than just Priests / Inquisitors, but work with similar pairs (i.e. Robbers -> Marauders, Barbarians -> Berserkers, Bear -> Ancient Bears, etc.).
It must be hard-coded, though, since the developers basically used the "army shop" style to perform the upgrades (especially with CW), but it seems like it is a simple logic switch to say let this unit be upgraded to another. Oh well, thought I'd mention it... /C\/C\ Quote:
|
![]() |
|
|