![]() |
|
#1
|
|||
|
|||
![]()
OK i checked poisoning effect : 480 dwarfs i killed 120 with royal snakes and poisoned them, next turn only 32 die from poison effect (and by your explanation should be 60). Try that combination, royal snakes special attack have 100% poisoning so it`s easy to check does it work. That situation with 800 bowman and burning might be because i used hell breath on thorn hunters, and it`s not related to ishara whip.
|
#2
|
|||
|
|||
![]() Quote:
What makes Royal Snakes more complicated is that their normal damage is physical. So a unit's physical resistance comes into play and that is the damage that will go into the features_poison function inside UNIT_FEATURES.LUA. I'll give a little mini-tutorail about the code in there, but first let's discuss the Royal Snake's attacks. The Royal Snake's normal attack has a 30% chance to poison and its "lunge" attack a 100% chance to poison (check SNAKE_ROYAL.ATOM). However, dwarves have at least 7 resist all (I think it is 8 in impossible due to the +25% increase) and possibly more if they are with a hero. I'm not sure which situation you're dealing with, but you'll need to look at the Dwarve's resistances (or really just poison). I'm pretty sure the flying damage numbers above the unit's head should be the damage that goes into the features_poison function. This serves as a mini tutorial, but here's the code: Code:
function features_poison( damage, addrage, attacker, receiver, minmax ) if ( minmax == 0 ) and damage > 0 then --local receiver=Attack.get_target(1) -- êîãî? local poison = tonumber( Attack.get_custom_param( "poison" ) ) poison = effect_chance( poison, "effect", "poison" ) local poison_res = Attack.act_get_res( receiver, "poison" ) local rnd = Game.Random( 100 ) local poison_chance = math.min( 100, poison * ( 1 - poison_res / 100 ) ) local poison_damage = damage * poison_chance / 200 if rnd < poison_chance and not Attack.act_feature( receiver, "golem" ) then -- and (not Attack.act_feature(receiver,"poison_immunitet") or Attack.act_race("undead")) then effect_poison_attack( receiver, 0, 3, poison_damage, poison_damage ) end end return damage, addrage end It's possible that in your case, you're using the Royal Snake's base attack, I don't know, but let's use both examples with the Dwarve's base resistance and follow the code: Code:
local poison = tonumber( Attack.get_custom_param( "poison" ) ) poison = effect_chance( poison, "effect", "poison" ) With the "lunge" attack, poison = 100 The second line would apply a modifier to the chance poison if the hero had an item with a bonus here. In this case, though, I don't think I have any items with a specific poison chance bonus (this is to allow people to mod my mod in the future with their own bonuses!) so the values above aren't modified. Next: Code:
local poison_res = Attack.act_get_res( receiver, "poison" ) local rnd = Game.Random( 100 ) local poison_chance = math.min( 100, poison * ( 1 - poison_res / 100 ) ) local poison_damage = damage * poison_chance / 200 Case 1 (base attack): poison_chance = min between( 100 and 30 * ( 1 - 8 / 100 ) ) = 27.6 Case 2 (lunge attack): poison_chance = min between( 100 and 100 * ( 1 - 8 / 100 ) ) = 92 So those are the two chances to cause poison based on whichever attack the Royal Snake is using if the Dwarve's resistance is 8%. Code:
local poison_damage = damage * poison_chance / 200 Case 1: poison_damage = 12,000 * 27.6 / 200 = 1656 Cast 2: poison_damage = 12,000 * 92 / 200 = 5520 So the chance to cause the damage goes into how effective the poisoning (in this case) is. Note that the reason why it is 200 is because I'm halving the damage (it could have just as easily been written as X / 100 / 2, but I combined the 2 values). I neglected to mention that the chance applies as well in my previous post, but this is the way it works per the code. Code:
if rnd < poison_chance and not Attack.act_feature( receiver, "golem" ) then -- and (not Attack.act_feature(receiver,"poison_immunitet") or Attack.act_race("undead")) then effect_poison_attack( receiver, 0, 3, poison_damage, poison_damage ) end If poison is successful, then "effect_poison_attack" is called with: 1) the receiver to apply the damage to, 2) pause (this is for timing of the display, I think), 3) duration of the effect, 4) min damage, and 5) max damage. Inside the effect_poison_attack function (inside SPELL_EFFECTS.LUA) there is a lot going on, but I essentially store the damage value on the unit (this is a neat feature of the scripting engine that the developers implemented) with the receiver's resistance used to scale up the damage back to what it would be like so: Code:
dmg_min = dmg_min * ( 1 + poisonresist / ( 100 - poisonresist ) ) dmg_max = dmg_max * ( 1 + poisonresist / ( 100 - poisonresist ) ) Case 2: dmg_min = dmg_max = 5520 * ( 1 + 8 / ( 100 - 8 ) ) = 6000 This was a little wrinkle I needed to put in because of the way the damage system works. Since the damage system applies the resistance to the damage, I didn't want the damage to be reduced by the resistance twice (once when storing and then again when computing damage) so this restores the "pre-resistance" damage and stores those values (in either case) on the unit. What happens next, is that when the receiver takes its turn the damage will be applied to the unit and the resistance will be applied - here's the code: Code:
Attack.atk_set_damage( typedmg, dmg_min, dmg_max ) -- Each successive burn causes half damage Attack.act_spell_param( target, effect_type, "dmg_min", dmg_min / 2, "dmg_max", dmg_max / 2 ) Note that atk_set_damage applies the damage type over the range specified by the mininum and maximum damage. This is an internal King's Bounty library and so when it does this, it computes the resistance of the unit and since I can't gain access to this library that's why I had to scale the damage back up by the unit's resistance because it gets (properly) scaled down by the library function. This was quite complex and took me a while to figure out because of what "goes on under the hood" of the C/C++ library functions. So in this case, the damages will be restored to 1656 and 5520 for cases 1 and 2, respectively as applied to the unit. and then you'll note that half 1800 and 6000 (900 and 3000) will be stored on the unit so that the next turn the same thing will happen - resistance is applied, but not twice! Like I said above, I spent a lot of time working on this and before I did this, the damage would be reduced by the unit's resistance and then by its resistance again before damage was applied (that wasn't the way I wanted it to work!). There is a lot more going on inside of some of the functions I've mentioned (like how to combine successive hits), but this is how it works per the code. The funny thing is that I still don't get the same answer you do: Case 1 apply 1656 damage to Dwarves - number killed: 1656 / 100 = 16.56 (or 16) Case 2 apply 5520 damage to Dwarves - number killed: 5520 / 100 = 55.2 (or 55) So in case 1 I get half what you mentioned and in case 2 quite a bit more. So you'll have to see what the Dwarve's actual resistance is and also the damage for your case, but this is how it works exactly per the code. Anyway, I hope that explains it and this is also a mini-tutorial for how to apply a damage effect and work with the damage library. ![]() /C\/C\ |
#3
|
|||
|
|||
![]()
Finally i finished playthrough in this mod (had a lot work past days), and it was great. ! more time thx for great mod Matt.
I managed impossible/no loss and it was hard in some fights ( Raab Soten, Baal . . . pretty much any hero with intellect above 30 was boring to fight because double/triple cast but it was worth it ![]() Found some weird thing in magic hero fights, when they cast some mass spell mana spent is like for 1 target (expl : Haas cast mass defenseless and spend only 8 mana(instead 40) , or mass magic shackles for 10 (instead 50). If enemy heroes got 2/3 spell casts per turn at least they should pend mana same as player hero. I`m not sure is this bug, or error in code but pls check it out. It`s bad enough to have enemy with 50/60 mana regen per turn, without them casting spells on low prices ![]() And what did you give to Sonya as speciality ( i now remember her, but other enemy heroes also have this) her dryads are 2 lvl unit, but had 12-16 dmg(1-4 basic), so WTF did you put in her inventory for her to have that stats on dryads ? ![]() ![]() In the end, i can say warrior with rina/feanora/mirabella/diana/neoka/xeona working without problems. Also had couple ideas, so what you ppl think about this ? Priest have 26 hp, and heal 2x10hpm but cant cast it on undead as dmg.Heal spell can be used as dmg for undead, so why not priest healing ability? I would lower it to 5 heal (when you lead more then 90 priests you dont have unit that can be healed for that much hp 90priest*10heal), and reload 2 so it wouldn`t be used 2 times in row then gift and imba dmg to undead. Thought`s ? ( i got this idea in just finished game i had 1400 priests, and who need 14000 hp healing ? so i thought to make them a bit more useful in fights against undead). You did nice thing with healer skill and heal/revive abilities , so i though to add something similar to other units that have active abilities. In necromancy add bonus for necromancer animate dead , in archmage add bonus for druid summon (more bears), for evil beholder hypnotise (higher lds), alchemist potions (more dmg), shaman totems (more hp) and such. I`ll check rest of your modding manual, but i hope to do it without big problems. Last edited by Fatt_Shade; 12-21-2011 at 09:05 PM. |
#4
|
|||||
|
|||||
![]() Quote:
![]() But only a little bit, I've been experimenting with dropping unit morale as a function of combat duration as well as their initiative and speed (they are getting tired after all!). I've been limiting morale drop to everyone except Undead and Golems, but am not sure what to do with the Undead, Golems, and Plants with respect to speed and initiative. On the one hand, Undead, Golems, and Plants probably don't really get tired, but I was thinking that maybe since magic is decreasing the control of your Undead troops would start to wane, which would reduce their initiative and then speed. I was thinking of leaving Plants and Golems alone since they are different. Anyway, just struggling with what to do there... The way it works now is that when the first long battle message occurs is that all units (except Undead and Golems) decrease 1 morale. Then when the second long battle message occurs, all units continue to decrease 1 morale (Undead and Golems are still not included), and all units (except Plants and Golems) drop 1 initiative. Then on the third long battle message, all troops continue to drop 1 morale (except those previously excluded), and then all troops drop 1 initiative and speed (except Plants and Golems). Lastly, for each successive set of stat decrease rounds (every 5 on impossible), morale, initiatve, and speed all continue to drop as they did before. This simulates your troops becoming more and more tired. This only applies to your troops as the enemy troops have no morale penalties (this is internal to the game apparently) and for initiative and speed I figured that since they are the defenders then that's their "homefield" advantage. Also, I've added charges to all reloadable attacks so that for long combats every troop will eventually run out of using their special abilities since they are getting tired of fighting. The minimum round at which a troop will run out of an attack if they use it as soon as possible through their normal reload time is round 15. So that is plenty of time to use those abilities and you can always use Gift on them (same with AI). I'm still experimenting with both of these changes... but I think that these won't have much an effect on combat since by round 15 pretty much everyone is dead anyway, except for maybe a few of the enemy hero battles. Also, you can always use Haste and Battle Cry to give your troops a speed or initiative boost as well as Gift to recharge their attacks in the latter rounds... You have an interesting use for the word boring! ![]() Quote:
I thought I worked around it successfully and actually thought the mana was being subtracted correctly, but it looks like I might still be undershot by the internal workings of that part of the game. I'll look into it some more, but I'm probably stuck there! Quote:
I'll lay it out sometime, because I'm going to use a similar system with AP/CW... Mysticus is awesome! So is Raab Sotten and Baal like they should be! Like I mentioned previously, a hero with a level higher than yours is going to be pretty tough! Quote:
![]() Can you do me a favor and snap a screenshot (or two) of your hero's stat's and army setup after defeating Haas so I can see what you ended the game with? I'm just curious and it'll help me gauge some things... Quote:
These are all excellent ideas - I'm pretty sure I have all the bonuses in place and just need to add them to the skill. I'll look into implementing them! By the way, Erkki found an error in my implementation of the Shaman Dancing Axes skill so I'll have a fix out for that soon... Have a happy holiday season! ![]() /C\/C\ |
#5
|
|||
|
|||
![]() Quote:
About enemy hero mana regen, and spell costs, problem i had mostly was with magic shackles and blind. They constantly used it on my inquisitors no matter that i almost never attacked enemy units with them after 5th turn, just reviving, but enemy kept blind/doom on them all time. Quote:
![]() I finished game with : Zerock 46lvl, Sleem 40 , Lina 36, Death 46. Here`s couple screens : in hero screen image i showed new upgrade for heroism banner i made. I` not thinking what more items could use upgrading, since there are fewer items here then in AP/CW so at least i can add a bit stronger item of already existing for later in game (thought about upgrading memoirs for bonus exp% to give 15% hero/spirit exp , some other ideas still figuring out how to implement). . . .cant upload image ![]() http://www.imgplace.com/viewimg819/2...ishingarmy.png http://www.imgplace.com/viewimg407/9...heroscreen.png http://www.imgplace.com/viewimg853/2...ndmgdealer.png http://www.imgplace.com/viewimg155/1...edicalunit.png http://www.imgplace.com/viewimg36/4049/28spirits.png |
#6
|
||||
|
||||
![]()
Thanks for the screenies!
Okay, a couple of questions (well, okay more than a couple ![]()
Quote:
Quote:
Quote:
Quote:
Lastly, what would your change list be for my mod? Every time I play the game, I create a change list and either make things tougher or try to improve aspects of the game. So let me know what you'd change and I'll start thinking about how to improve it some more... Well, thanks for playing! I'm glad you enjoyed it! ![]() /C\/C\ |
#7
|
|||
|
|||
![]()
Ok, I've implemented the Catapult's Boiling Oil attack as well as changed the Furious Goblin such that it has one Throw Axe charge and is furious.
Screenies provided below... Anyway, I plan on enterring the beta phase soon since there doesn't appear to be any show-stopping game crashes that prevent the player from reloading and continuing... /C\/C\ Last edited by MattCaspermeyer; 12-22-2011 at 10:59 AM. Reason: Updated status of change... |
#8
|
|||
|
|||
![]() Quote:
I had everything working, but the hint. As it turns out (I had a similar problem when implementing the Thorn's Gift of Life) certain abilities' hints are hard coded in the game. The fact that it is called "cure" means that it has a built-in hint generator and it cannot be overriden! This was giving me fits all day today! So I called it "cure2" so I could use a custom hint - whew! Screenies of the implementation are below. Damage might be a little low, but we'll see how it goes - base heal is 2 and then priests do 2x damage to undead so base damage is 4. In your example, their Heal would be 2800 and then damage to undead would be 5600. If you had your Healer skill at level 3, you'd get an additional +30%, which would be 3640 healing and 7280 damage. That seems pretty reasonable for right now. Note that if the total cure value isn't consumed when healing then a charge isn't used - we'll have to see how that goes. I didn't put a reload value, but it may be a good idea to give them one. Also with respect to charges, it might be better to just let it consume a charge but give them a few more charges. Hmmm... /C\/C\ |
#9
|
|||
|
|||
![]()
Okay, here's a screenie of the new Giant Thump feature.
The idea behind this is that the Giant is able to knock out opponents (most likely so that it can take them back to its lair and eat them - especially EGD's ![]() Highly experimental, it'll be provided in the next update... /C\/C\ |
#10
|
|||
|
|||
![]()
Here's a list of things I'm currently working on, thinking about implementing, or simply dreaming about implementing...
/C\/C\ Last edited by MattCaspermeyer; 01-08-2012 at 05:45 PM. Reason: Updated status of some tasks... |
![]() |
|
|