Solved Trying to add another effectiveness display in EBS

#1
(Sorry, I know EBS isn't getting any more updates, but I can't figure out what I'm doing wrong with my code and needed some help)

Okay, so, basic idea: I wanted to include an option for "No effect" to be displayed as well, since marking these moves as "Not very effective" is a little misleading. To do this, I've made two changes:
In EliteBattle_3
eff=[_INTL("Normal damage"),_INTL("Not very effective"),_INTL("Super effective")]
has been changed to
eff=[_INTL("Normal damage"),_INTL("Not very effective"),_INTL("Super effective"),_INTL("No effect")]


Further down in the same section,

eff=0
if @modifier<8 && @modifier>0
eff=1 # "Not very effective"
elsif @modifier>8
eff=2 # "Super effective"
elsif @modifier==0
eff=3 # No effect
end

has been changed to
eff=0
if @modifier<8 && @modifier>0
eff=1 # "Not very effective"
elsif @modifier>8
eff=2 # "Super effective"
elsif @modifier==0
eff=3 # No effect
end


(I've made a few other alterations to the section, like adding colored text, but when trying to solve this problem, I've commented it out)

For a while, I thought my issue was that eff or i weren't recognizing the fourth options, but after some tinkering, I think the main issue is with the 24*eff part. (Specifically, the @typeInd.src_rect.y = 24*eff , and then referencing that when I use pbDrawOutLineText) Using 3 or 4 on it (whether that's by referencing a variable or directly putting in the number) just doesn't seem to work, the text won't be visible. I know the text is being written somewhere - I tried switching it out to one of the already-used numbers, and it definitely appeared for the moves with effectiveness related to them, actually being written on top of their regular message. But I can't figure out

  • I've double-checked to be sure I was referring to the right modifier by making the 0 set eff to 2, which worked correctly.
  • I tried increasing the range of i by changing for i in 0...3 to for i in 0...4. This didn't seem to have any effect.
  • I attempted to work around the problem by skipping eff and instead using conditionals- if i==1, draw this line, and so on - and replacing eff with the direct _INTL. (all still under the for i in) This worked fine for all the other displays, but I still couldn't get text to appear for moves with no effect.
  • I made another attempt to work around by skipping out on i and using conditions for eff. (if eff==1, draw this line, etc, still using the direct _INTL) This was where I figured out it was that 24* that was the problem.
  • I tried using 2.5 instead of 3. This did create text that I could see, but it was halves of other displays.
  • I tried using 4 instead of 3. This had the same issue as 3.
  • I tried using -1 instead of 3. This had the same issue as 3.

Sorry this is so long, but to sum it up: I've tried adding a fourth display option for type effectiveness in EBS. Everything is cooperating except for the @typeInd.src_rect.y = 24*eff, which isn't letting me use any numbers greater than 2, regardless of whether that's a variable or referenced directly. I'd like to figure out some way to get another option in.

EDIT: I've solved it! The problem was with

@typeInd.bitmap=Bitmap.new(192,24*3)

I needed to change the 3 to a 4 to let me have another option. Hooray!
 
Last edited:
Top