New account registration is temporarily disabled.

REAPERGURL'S PROFILE

Search

Filter

Slip into Ruby - Under the Hood part 3: Game Objects

Yay! Seems I was never too far off in the first place.

But aren't there other ways for boolean checks, such as if, else and elsif?

lol 'elsif' - for whatever reason, I think of 'Keebler Elves' when I see that term.

Slip into Ruby - Under the Hood part 3: Game Objects

def on_expire
    BattleManager.abort unless $game_switches[#] == true
  end

Slip into Ruby - Under the Hood part 3: Game Objects

author=Trihan
No, if you wanted to do it non-implicitly you'd do

BattleManager.abort unless $game_switches[#] == true


How do you get the code to come up in those colors?

Or is it a manual edit?

Of course, the ==...implicitly equal to. I'm guessing that Ruby doesn't like =/= for inequal.

Slip into Ruby - Under the Hood part 3: Game Objects

def on_expire
BattleManager.abort unless $game_switches[#].true
end
So, it would look like this?

That's neat.

Hmm...

Slip into Ruby - Under the Hood part 3: Game Objects

author=Trihan
def on_expire
    BattleManager.abort unless $game_switches[#]
  end
You can do angle brackets by enclosing them in angle brackets in your post. :)

I think what's breaking it is that "true?"; $game_switches has no such method, and you appear to be missing a dot to make it a method call anyway.


I'm guessing that I misinterpreted how if a switch is on, it's read as 'true' in the syntax. Missing the dot, where exactly?

$.game_switches [#] (?)

Kinda feelin' the novice burn...

Slip into Ruby - Under the Hood part 3: Game Objects

This is likely a huge necropost, but since no one else has posted their thoughts, I may as well.

I always thought it annoying(!) when the battle ended due to the timer being zero.

Once, I tried to change the method by adding

'unless $game_switches (#) true?' (without the quotes and with brackets in place of parentheses because these forums hate brackets)
to the end of BattleManager.abort ...

That made Ruby throw a fit.
Pages: 1