Jump to content

Kayzee

Member
  • Content Count

    3,566
  • Joined

  • Last visited

  • Days Won

    240

Kayzee last won the day on June 18

Kayzee had the most liked content!

About Kayzee

  • Rank
    FAIRY DUST! FAIRY DUST FOR EVERYONE! WHEE!
  • Birthday 07/27/1979

Profile Information

  • Gender
    Not Telling
  • Location
    Fairyland!
  • Interests
    cute things, fairies, snuggles, kisses, fairy dust, naughty fun time

RPG Maker Information

  • RM Skill -
    Coder

Recent Profile Visitors

33,655 profile views

Single Status Update

See all updates by Kayzee

  1. I was just experimenting with if statements that used if statements as conditions in ruby.

     

    Yes, you can do that.

     

    Only reason I was curious to see how well it worked was I sometimes want to do something like:

     

    unless ( if something
        do_something
      end or if somethingelse
        do_somethingelse
      end )
      do_nothing
    end

     

    Or in other words, I want something to happen if and only if nothing else happens. The usual way I end up doing this is like this:

     

    done = false
    if something
      do_something
      done = true
    end
    if somethingelse
      do_somethingelse
      done = true
    end
    do_nothing unless done

    But it sort of bugs me that I need a variable. Not a big deal, but I wonder if there is a better way?

     

    Note: The last line of an inner if statement needs to set a value for that kind of funny nested if statement to work.

     

    Edit: Oh, actually it wouldn't work the way I want due to short circuiting I think... I thought using 'or' rather then '||' would disable that but apparently not.

    1. PhoenixSoul

      PhoenixSoul

      lolz

      if $guitar_skill <= $Slash
        print "Go play Bass instead."
      else
        print "Slash Unlocked, See Store."
        set $switch_Slash to 2
      end #lmfao

       

      Of course, that's all junk; none of that would work unless pre-defined, but there's some old game jokes in there. 😆

    2. Kayzee

      Kayzee

      Just to be clear I don't want to do an if else because that only has one thing or the other happen and I want both to be able to happen.

×