OmegaDev
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Kyle's Snippet Zone

+3
moneymenace
omegas7
Kyle?
7 posters

Page 2 of 2 Previous  1, 2

Go down

Kyle's Snippet Zone - Page 2 Empty Re: Kyle's Snippet Zone

Post by omegas7 Sun May 02, 2010 5:20 pm

Oh look another error... Try removing "include KYLE" and instead put it below
Code:
class Scene_Map < Scene_Base
omegas7
omegas7
Admin
Admin

Posts : 1180
Gald : 4121

Stats
Cookies: 0

http://www.omegadev.biz

Back to top Go down

Kyle's Snippet Zone - Page 2 Empty Re: Kyle's Snippet Zone

Post by Kyle? Mon May 03, 2010 1:27 am

Ok I'm so new to that methos I foudn out about it when you made my hud
Kyle?
Kyle?
Platinum Cookiez
Platinum Cookiez

Posts : 500
Gald : 418

Stats
Cookies: 5

Back to top Go down

Kyle's Snippet Zone - Page 2 Empty Re: Kyle's Snippet Zone

Post by moneymenace Mon May 03, 2010 7:27 am

Code:
module KYLE

SWITCH = 3
TRANSITION_NAME = "Battle Transition"

end

class Scene_Map < Scene_Base
include KYLE
def perform_battle_transition
if $game_switches[KYLE::SWITCH] == true
  Graphics.transition(80, "Graphics/System/" + TRANSITION_NAME, 80)
  Graphics.freeze
else
  Graphics.transition(80, "Graphics/System/Battle Transition", 80)
  Graphics.freeze
  end
 end
end

Like this Omega? Because if so, then it still doesn't work.
moneymenace
moneymenace
Resource Moderator
Resource Moderator

Posts : 538
Gald : 1337

Stats
Cookies: 0

Back to top Go down

Kyle's Snippet Zone - Page 2 Empty Re: Kyle's Snippet Zone

Post by Jet Fri May 07, 2010 7:00 pm

The snippet could made do with an alias as well instead of an entire rewrite, and the == true isn't even needed. Here is a clean up code for ya.

Code:
module KYLE
 
  SWITCH = 1
 
  TRANSITION = "BossBattleStart"
 
end

class Scene_Map
 
  include KYLE

  alias kyle_perform_battle_transition perform_battle_transition unless $@
  def perform_battle_transition
    if $game_switches[SWITCH]
      Graphics.transition(80, "Graphics/System/" + TRANSITION, 80)
      Graphics.freeze
    else
      kyle_perform_battle_transition
    end
  end
end
Jet
Jet
Newcomer
Newcomer

Posts : 13
Gald : 91

Stats
Cookies: 0

Back to top Go down

Kyle's Snippet Zone - Page 2 Empty Re: Kyle's Snippet Zone

Post by Kyle? Fri May 07, 2010 7:16 pm

Well I barely know what an alais doe's or how to use it
Kyle?
Kyle?
Platinum Cookiez
Platinum Cookiez

Posts : 500
Gald : 418

Stats
Cookies: 5

Back to top Go down

Kyle's Snippet Zone - Page 2 Empty Re: Kyle's Snippet Zone

Post by moneymenace Fri May 07, 2010 7:27 pm

Well, what do you know! You certainly know your stuff on scripting! Glad to have you on OmegaDev.
Good effort, Kyle?, I can't do what you guys do, so that's a big to me.
moneymenace
moneymenace
Resource Moderator
Resource Moderator

Posts : 538
Gald : 1337

Stats
Cookies: 0

Back to top Go down

Kyle's Snippet Zone - Page 2 Empty Re: Kyle's Snippet Zone

Post by Kyle? Fri May 07, 2010 7:34 pm

Trust me once you start scripting...
You learn something new everyday (Almost)
oh learning about alais...
Kinda know how to use em'
Kyle?
Kyle?
Platinum Cookiez
Platinum Cookiez

Posts : 500
Gald : 418

Stats
Cookies: 5

Back to top Go down

Kyle's Snippet Zone - Page 2 Empty Re: Kyle's Snippet Zone

Post by moneymenace Fri May 07, 2010 8:19 pm

The thing is, I don't know a thing on scripting with Ruby or RGSS2, so I just appreciate the help I can get from the people who can script. So thanks guys.
moneymenace
moneymenace
Resource Moderator
Resource Moderator

Posts : 538
Gald : 1337

Stats
Cookies: 0

Back to top Go down

Kyle's Snippet Zone - Page 2 Empty Re: Kyle's Snippet Zone

Post by Andinator Tue May 18, 2010 11:49 am

I may use the boss transition XD
Andinator
Andinator
Student
Student

Posts : 100
Gald : 458

Stats
Cookies: 0

Back to top Go down

Kyle's Snippet Zone - Page 2 Empty Re: Kyle's Snippet Zone

Post by IMP1 Mon Jul 19, 2010 11:35 am

Just adding to what Jet said.
He said the == true isn't necessary.
This is because when using an if branch (or an unless, or a while etc.)
the if checks to see if what's on the right returns "true".
Code:
variable = 4
if variable == 4 # variable == 4 returns 'true'
  puts variable
end
And so because $game_switches[KYLE_SWITCH] is true, you don't need to check whether it being equal to something (true) is true or not.

Badly explained. Sorry.
IMP1
IMP1
Coding Moderator
Coding Moderator

Posts : 503
Gald : 1399

Stats
Cookies: 5

Back to top Go down

Kyle's Snippet Zone - Page 2 Empty Re: Kyle's Snippet Zone

Post by Sponsored content


Sponsored content


Back to top Go down

Page 2 of 2 Previous  1, 2

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum