TRIHAN'S PROFILE

Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
Sidhe Quest
When everything goes wrong, it's up to our heroes to go and do a bunch of other stuff!

Search

Filter

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

They follow the same principle. You can do

if $game_switches[#]


just as easily as unless.

Ruby is one of the few languages that supports this syntax of putting your condition after the line of code to execute.

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

That's it! Though personally I'd just do

BattleManager.abort unless $game_switches[#]


I try never to use explicit method calls for boolean checks if all I'm doing is checking for truth, implicit true for the win!

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

You'd use != for not equal to.

When you click the "code" tag it asks you what the language is. If you enter "ruby" it'll automatically colour the code for you.

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

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

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

McBacon Jam 4

author=Jeroen_Sol
Have we decided on a pronunciation yet? Is it Treyezyeohn Tehdjick?


Try-gerr-oh-enn Maj-ick.

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

You can do just $game_switches[*] as a condition and it'll implicitly understand that you want to check it returns true for the value of the element, or if the switch class had a true? method defined you could do $game_switches[*].true?

Method calls will always have a dot between the name of the method and the object calling them.

Let's Play Chronicles of Tsufanubra! Part 2

Yeah, I noticed that too. Not quite sure what the issue was.

McBacon Jam 4

You can do RPG Maker MV but you can't do RPG Maker MV. Sounds legit!

McBacon Jam 4

Everything that starts with Tri is cool.

[RM2K3] the animation for a switch skill isn't showing?

Oh, I see where you've gone wrong. Common events only run on the map. If it's a battle skill you'll have to make a monster party event for every troop that's activated by the switch that the skill turns on, and do your text there.