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

Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2014, 08:02 PM
knight_9 knight_9 is offline
Approved Member
 
Join Date: Jun 2014
Posts: 5
Question Need help with some editing( I guess this is the place I can get my answer)

Hi, I'm new here. Please help if you can.
Since dark side is still in beta, I decided to play ice and fire DLC first.
However, I dont want to waste time for waiting mana recover and searching chests.

So these are two things I want to achieve.
1: I want to set restore mana after each fight, and the rage doesn't decrease on map.

I tried to edit logic_hero.lua to achieve that. I can't make it work.

in function change_manarage (event)

if rage > rage_min then
local tmp_rage = max_rage*(rage_sub/100)*(1-Logic.hero_lu_item("sp_rage_map", "count")/100)/k_rage_dif
if tmp_rage < 1 then
tmp_rage = 1
end
--rage = rage - tmp_rage ( I comment it out)
if rage < 0 then
rage = 0
end
end

and for mana part, I changed original to
if new_mana > max_mana then
new_mana = max_mana (just made the mana to max)
end
Logic.cur_lu_item( "mana", "count", new_mana)
Game.ClearEffect( "mana" )

And also tried to fix these two functions

function decrease_rage () --ftag:action
local rage = Logic.cur_lu_item( "rage", "count" )
if rage > 0 then
--rage = rage - 1
Logic.cur_lu_item( "rage", "count", rage )
Game.ClearEffect( "rage" )
end

return false
end

and I copy the code in function restore_mana () to function increase_mana () which should give me what I wanted.

I don't think there is anything else in this file that is needed to edit. however, when I was in game, it still regenerating mana every 10 seconds.
I even tried to change local time_period = 1 which increase the rate to 1 second, nothing works.

What else do I need to edit to achieve what I need?



And for search radius, in param.txt

search_radius {
count=3
cmc=1
limit=0
zerocount=1
}

count represents the effective digging radius.
If I increase count, I can see light pillars from distance; however, the con is that as long as I can see it, I will be able to dig it up.
What I want is that I will be able to see the light pillars from distances, but can only dig them up when I'm nearby. I believe that zerocount is the field for light pillar radius. I tried to increase it. It doesn't work.
Can someone give me a pointer here, thank you.
Reply With Quote
  #2  
Old 06-14-2014, 09:19 PM
MattCaspermeyer MattCaspermeyer is offline
Approved Member
 
Join Date: Aug 2010
Posts: 553
Default

I think really the goal you are after is that you want to start each battle with maximum rage and mana.

Since you are already editing the LUA files, I'll point you in the right direction for the files you need to edit and I'll let you work out the details...

For changing mana / rage at the beginning of a battle, you'll need to edit the "on_round_start" function in ARENA.LUA. For seeing how to change your mana / rage during combat see the function "enbox_bonus" in SPIRIT_LINA.LUA.

You should be able to figure out what to do from looking at those two functions to start each battle with maximum mana / rage.

For the search radius function, the zerocount=1 parameter is just for identifying whether that counter can be zero or not. Most counters are set to be positive so that negative values are not allowed. If a param has cmc=1, then it is a counter where the counter value increments; whereas if it is cml=1, then it is a counter where the limit increments (see mana or rage in PARAMS.TXT, for example).

None of the parameters under search_radius, though, effect digging distance. I do not know where this is in the game. It is possible that it is hard coded in the EXE or there may be something in BOXGEN.LUA.

Good luck!

/C\/C\
Reply With Quote
  #3  
Old 06-15-2014, 02:06 AM
knight_9 knight_9 is offline
Approved Member
 
Join Date: Jun 2014
Posts: 5
Default

Quote:
Originally Posted by MattCaspermeyer View Post
I think really the goal you are after is that you want to start each battle with maximum rage and mana.

Since you are already editing the LUA files, I'll point you in the right direction for the files you need to edit and I'll let you work out the details...

For changing mana / rage at the beginning of a battle, you'll need to edit the "on_round_start" function in ARENA.LUA. For seeing how to change your mana / rage during combat see the function "enbox_bonus" in SPIRIT_LINA.LUA.

You should be able to figure out what to do from looking at those two functions to start each battle with maximum mana / rage.

For the search radius function, the zerocount=1 parameter is just for identifying whether that counter can be zero or not. Most counters are set to be positive so that negative values are not allowed. If a param has cmc=1, then it is a counter where the counter value increments; whereas if it is cml=1, then it is a counter where the limit increments (see mana or rage in PARAMS.TXT, for example).

None of the parameters under search_radius, though, effect digging distance. I do not know where this is in the game. It is possible that it is hard coded in the EXE or there may be something in BOXGEN.LUA.

Good luck!

/C\/C\
Thank you very much for the quick reply.

I will try to work out the two lua file you pointed out.

And for search radius, the count actually affects both the digging radius, and radius for displaying light pillars. I guess I will just be becareful with the "D" key for now that I have to do.

And if you figured out how to makes the the accumulated rage does not decrease on the map, please let me know.

Thank you again.
Reply With Quote
  #4  
Old 06-15-2014, 02:17 AM
knight_9 knight_9 is offline
Approved Member
 
Join Date: Jun 2014
Posts: 5
Default

yeah, I just added the function call of restore_mana() in function on_round_start(round, tend) when the the round is 1, which restores my mana to maximum.

Because I only want the rage not to decrease outside of battle, not the maximum rage at the beginning of the battle, so I didn't fix anything here.

However, restoring the mana alone freed me from pointless waiting. Thanks.
Reply With Quote
  #5  
Old 06-15-2014, 05:16 AM
MattCaspermeyer MattCaspermeyer is offline
Approved Member
 
Join Date: Aug 2010
Posts: 553
Default

Good point on the digging / search radius - I thought it worked that way, but since you had originally posted otherwise, I thought I must have been wrong. As it turns out it affects both, which is actually what I thought!

For rage, if you'd rather just reduce the rate at which rage falls to zero, then you're probably going to want to modify the counter, sp_rage_map. This counter controls the rate at which rage falls. This counter is located in SPECIAL_PARAMS.TXT, by the way...

Next, is how do you want to modify this counter? You can add it to an item if you wish to have it equipped all the time, but a better way may be to add it to a skill. That way, once you select that skill in your skill tree, you'll have it from this point forward (as an aside, you can also implement it virtually anywhere, but let's stick with these two ways for now).

I don't really see much difference between starting at full rage or letting if fall very slowly after combat, but if that is really what you'd rather do then if you go the skills route, you'll need to edit at least SKILLS.LUA. For example, look at the function "skill_wizdom" in SKILLS.LUA. You will see how counters are modified (essentially permanently) with a function - it is very similar to changing mana or rage, but instead you'd be changing sp_rage_map.

If you go to "wizdom" in SKILLS.TXT, you will note that it has a script= line and you will see that for wizdom it is script=skill_wizdom (which matches the function in SKILLS.LUA). So you can either add code to a skill that already has a function call (just like wizdom above) or add a script= line to another skill such that when you choose it, it will increase sp_rage_map. Supposedly sp_rage_map is a decrease in decay rate by that value so if you set it to 100 then it should fall twice as slowly.

If you want to go the item route and just add the bonus to the item then go to ITEMS.TXT and search on sp_rage_map (for example: blackthorn_crown has sp_rage_map=count,50 for a 50% slower rage decrease). This is an easier way to do the rage thing, but you'd have to have the item equipped at all times for the behavior to work. Of course, if you do it this way, it is easy to disable it as well by unequipping the item.

So your choice - you've got a couple of options there.

Good luck!



/C\/C\
Reply With Quote
  #6  
Old 06-15-2014, 12:52 PM
knight_9 knight_9 is offline
Approved Member
 
Join Date: Jun 2014
Posts: 5
Default

Thanks for the reply. I will get on it when I got the chance. Nice day.
Reply With Quote
Reply


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 08:28 PM.


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