Group: Global Mod
Posts: 1,784
Type: None
RM Skill: Undisclosed
Rev Points: 15
This would seem like such a small thing, but I haven't had much luck in finding this out. Also, I'm sure there are scripts that can do what I'd like, but it would seem like a waste for such a small snippet of code if I don't plan to implement the other features of the script. Plus, adding in a snippet (or changing the default script within my own project, not the RTP) would get me more into understanding a bit how scripts work.
Okay, with that said, what I am trying to do is alter the amount of damage you receive with the poison state. Simple enough, I know, but completely lost on a guy who doesn't understand scripting.
What I want is for damage to take 1 HP off per step while on the field (outside of battle) for the actors who have the Poison State applied. In battle, I want 20% damage applied for each turn that an actor has the Poison State applied, which I think will create a bit more urgency for a player to apply a heal as opposed as to just waiting it out.
Now, I think I can solve the latter (in battle) issue. If I'm not mistaken I look for this snippet of code.
def slip_damage_effect if slip_damage? and @hp > 0 @hp_damage = apply_variance(maxhp / 10, 10) @hp_damage = @hp - 1 if @hp_damage >= @hp self.hp -= @hp_damage end end end
And change the 3rd line to
@hp_damage = apply_variance(maxhp / 20, 10)
However, outside of battle, I believe it takes 10 HP for each step that Poison State is applied, and I don't know where to change that so it's just 1 per step.
Also, backing up to my percentage change for in battle, I'm guessing the number 10 on the right side of the comma is the variance. I know (to some degree) how variance works, what I don't know is if that variance is in percentages (10% variance) or in HP (10 HP variance). If it's in percentages, I'll leave it alone, but if it's a variance of actual HP, I may want to boost that up as well to say around 50 HP.
Group: +Gold Member
Posts: 1,519
Type: Scripter
RM Skill: Undisclosed
For the steps damage, refer to the line highlighted:
image stretches forums
It should, by default, only subtract 1 hp for each step. Do you have any other scripts in place, a battle system or anything? Do a Ctrl Shift F search through the script editor for def on_player_walk and see if it gets redefined as actor.hp -= 10 somewhere else.
And for the slip damage during battle, the apply_variance method takes 2 inputs, the first is the standard amount of damage, and the second is the variance., so for the line:
CODE
@hp_damage = apply_variance(maxhp / 10, 10)
it deals max_hp/10 damage, and varies randomly by 10hp, which I believe you've figured out. The only problem is you said max_hp/20 is 20% damage, but it's only 5% damage. To get 20% damage you need to use max_hp/5
__________________________
K.I.S.S. Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.
Group: Global Mod
Posts: 1,784
Type: None
RM Skill: Undisclosed
Rev Points: 15
Thanks, I'm having all sorts of brain farts on this medication. Okay, now that my mind is working this morning, I'll just tell myself duh, I should have realized it needs to be divided by 5 to get 20%, not 20. I think I'll up the variance to 50, since 10 just doesn't seem like a big difference.
Second, I haven't had much chance to test the poison effect by walking, so I was basing the assumption it was taking 10 by default on what I was reading everywhere else on the internet. But it appears to already be doing what it should (ie., 1 damage per step). And now I know where it's at, since previously I was trying to find it under Actor.
Group: +Gold Member
Posts: 1,519
Type: Scripter
RM Skill: Undisclosed
No worries
I just did a Ctrl Shift F search for 'slip', I wish it was something more fancy, but I just remembered the term 'slip damage' and searched the code until I found something that looked right, and on_player_walk seemed like a good place for me.
__________________________
K.I.S.S. Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.