| Blockland Forums > Modification Help |
| setRepairRate making it negative |
| << < (3/4) > >> |
| Kiwi:
This is working quite well but still calls onDamage. First it does 10 damage,20 damage, 40 damage, then kills when I include it into the onDamage function of my playertype. Now I came up with an idea: --- Code: ---function PlayerEliteForceArmor::onDamage(%this,%obj,%delta) { Parent::onDamage(%this,%obj,%delta); if(%delta > 0) { if(%obj.getState() !$= "Dead") { %currentDamage = %obj.getDamageLevel(); %addingDamage = %activeDamage / 10; if(%activeDamage < 10) { %activeDamage += 1 bleedSchedule1 = %obj.schedule(333,setDamageLevel,%currentDamage+%addingDamage); } else { %activeDamage = 0; parent::onDamage(%this,%obj,%delta); } } } } --- End code --- Now this does the bleeding sort of like I want it, but not really. Because when I got hit 3 times it also bleeds 3 times. But I think I'm on the right track. What does the ::onDamage(%this,%obj,%delta) stand for? |
| Ash:
I would think that delta means the amount. |
| Amade:
--- Quote from: Kiwi on February 09, 2011, 11:40:03 PM ---snip --- End quote --- Oh, I see why you were trying to avoid ::onDamage now. I'm fairly certain the %delta in onDamage is the amount, and that there are more than three arguments. The only way I could think to make what you're trying to do work is to use a special bleeding damage type and then package player::damage rather than armor::onDamage and only trigger a bleed when the damagetype isn't a bleed itself so you don't run into that stacking effect. |
| Kiwi:
--- Quote from: Amade on February 10, 2011, 01:47:25 AM ---Oh, I see why you were trying to avoid ::onDamage now. I'm fairly certain the %delta in onDamage is the amount, and that there are more than three arguments. The only way I could think to make what you're trying to do work is to use a special bleeding damage type and then package player::damage rather than armor::onDamage and only trigger a bleed when the damagetype isn't a bleed itself so you don't run into that stacking effect. --- End quote --- This is going too high for my poor scripting knowledge. I'll just throw it since it's not easy to accomplish. It still would be awesome if you guys contributed such a function to a realistic playertype. Might make Gravity Cats games even more realistic. ;) |
| Mr.jacksaunt:
Why am I bleeding so much |
| Navigation |
| Message Index |
| Next page |
| Previous page |