Guest Access
Go to page : 1, 2
Administrator
Administrator
Administrator
profile {'the G Code'}
/script to project\
The 'G' Code is a dial pad
that is set to trigger one switch
if the code is correct
and another switch if the code
is incorrect
first there was the script now the project/demo is on the way
the G code v3.0
+ over the top instructions
+ new user friendly module for setup
added controls in the module for:
+window settings
+text settings
+graphic settings
+input settings
+animated cursor
final script version
SCRIPT
GRAPHICS:
Event example:
CREDITS:
DEVELOPEMENT:
G@MeF@Ce
profile
/script to project\
The 'G' Code is a dial pad
that is set to trigger one switch
if the code is correct
and another switch if the code
is incorrect
first there was the script now the project/demo is on the way
the G code v3.0
+ over the top instructions
+ new user friendly module for setup
added controls in the module for:
+window settings
+text settings
+graphic settings
+input settings
+animated cursor
final script version
SCRIPT
- "The "G" Code 3.2:
- Code:
################################################################################
# The "G" Code v3.2 by g@Mef@Ce @ www.gameface101.com 7-13-2011
################################################################################
=begin
Instructions: (101)
[ Step 1 - RPG MAKER XP Installation ]-----------------------------------------
1.) copy this script
2.) open the RMXP editor
3.) go into the scripts database (F11)
4.) insert new sheet in left field, paste script into right field, click OK.
5.) now copy this code: The_G_Code.new (A,B,C)
6.) create an event, insert new command in the right field
7.) in the events commands menu, third tab > bottom right > script
8.) paste in "the G Code" (incase you didn't copy it) The_G_Code.new (A,B,C)
*you may customize the event to call the script now or after CONFIG.
[ Step 2 - Script configuration ]-----------------------------------------------
A = the combination ~ like "1234"
B = correct switch ~ correct switch number is 20
C = wrong switch ~ error swtich number is 21
should look like this: The_G_Code.new (1234,20,21)
[ Step 3 - Event configuration ]-----------------------------------------------
a.) under that line of code start the first conditional branch for
(what happens when you enter the correct code)
b.) now last setup another conditional branch for what will happen
(if the wrong code has been entered)
*check out " computer programming " at www.gameface101.com for more info
enjoy!
free to use must give credit > do not post in other forums.
=end
#---------------------------------------------------------------------
# Customization
#---------------------------------------------------------------------
module GCODE
#window settings
GWINSIZE_X = 130
GWINSIZE_Y = 230
GWINPOS_X = 64
GWINPOS_Y = 96
GWINOPACITY = 0
#font settings
#-G Code title
GTITLE = "CODE?"
GTITLE_X = 16
GTITLE_Y = 0
GTITLE_COLOR = Color.new(155, 214, 214, 255)
#dial numbers color
DIAL_COLOR = Color.new(255, 255, 255, 255)
#-entered symbols
GSYMBOL = "?"
SYMBOL_COLOR = Color.new(160, 219, 219, 255)
#input settings
GCODE_ENTER = Input::C
GCODE_CANCEL = Input::B
#graphic settings
GCURSOR = 'cursor.png' # cursor graphic in character folder
GCURSOR_START = 10 # cursor start position on index
GCURSOR_SPEED = 3 # cursor animation speed (1=slow, 2=med, 3=fast)
GBACK = "gback" #background image in windowskins folder
GBACK_X = GWINPOS_X - 16
GBACK_Y = GWINPOS_Y - 16
GBACK_Z = 4
GBACK_OPA = 50
#sound settings
G_SELECT = ""
end
#===============================================================================
# The_G_Code Class
#===============================================================================
class The_G_Code < Window_Base
#---------------------------------------------------------------------
# refer to module
#---------------------------------------------------------------------
include GCODE
#---------------------------------------------------------
def initialize(combo,right,wrong= -1)
#---------------------------------------------------------
super(0,0,GWINSIZE_X,GWINSIZE_Y)
#------------------------------------------
@play_code = true
@correct = combo
@go = right
@stop = wrong
@numbers = ["1","2","3","4","5","6","7","8","9","#","0","*"]
@index = GCURSOR_START
@amount = ""
@counter = 0
#------------------------------------------
self.contents = Bitmap.new(width-32,height-32)
@back = Sprite.new
@back.bitmap = RPG::Cache.windowskin(GBACK)
@back.x = 320 - GBACK_X
@back.y = 240 - GBACK_Y
@back.z = GBACK_Z
@back.opacity = GBACK_OPA
self.active = true
self.opacity = GWINOPACITY
self.x = 320 - GWINPOS_X
self.y = 240 - GWINPOS_Y
veiwport = Viewport.new(0, 0, 640, 480); veiwport.z = 300
@cursor = Sprite.new(veiwport)
@cursor.bitmap = Bitmap.new(128,64)
@cursor.bitmap.blt(0, 0, Bitmap.new('Graphics\\Characters\\' +
GCURSOR), Rect.new(0, 128, 128, 64))
main
Input.update
@cursor.bitmap.dispose
@cursor.dispose
@back.dispose
self.dispose
end
#---------------------------------------------------------------------
# Main
#---------------------------------------------------------------------
def main
loop do
Graphics.update
Input.update
update
break unless self.active
end
end
#---------------------------------------------------------------------
# Update
#---------------------------------------------------------------------
def update
@cursor.src_rect.set((@counter/15)*32, 0, 32, 64)
@cursor.x = 32 * (@index % 3) + self.x + (@cursor.bitmap.width / 8)
@cursor.y = 32 * (@index / 3) + self.y + (@cursor.bitmap.height / 4)
@counter = (@counter + GCURSOR_SPEED) % 60
@cursor.update
#---------------------------------------------------------
if Input.trigger?(GCODE_CANCEL)
g101_error
self.active = false
end
#---------------------------------------------------------
if Input.trigger?(Input::DOWN)
@index += 3
if @index > 11 then @index -= 12 end
g101_select
end
#---------------------------------------------------------
if Input.trigger?(Input::UP)
@index -= 3
if @index < 0 then @index += 12 end
g101_select
end
#---------------------------------------------------------
if Input.trigger?(Input::LEFT)
@line = (@index / 3)
@index -= 1
if @index < (@line * 3) then @index += 3 end
g101_select
end
#---------------------------------------------------------
if Input.trigger?(Input::RIGHT)
@line = (@index / 3) + 1
@index += 1
if @index == (@line * 3) then @index -= 3 end
g101_select
end
#---------------------------------------------------------
if Input.trigger?(GCODE_ENTER)
@amount += @numbers[@index]
if @amount.length == @correct.to_s.length
if @amount.to_i == @correct
g101_correct
$game_switches[@go] = !$game_switches[@go]
$game_map.need_refresh = true
else
@amount += @numbers[@index]
g101_error
if @stop != -1
$game_switches[@stop] = true
$game_map.need_refresh = true
end
end
#---------------------------------------------------------
self.active = false
else
g101_click
end
end
#---------------------------------------------------------
self.contents.clear
self.contents.font.color = GTITLE_COLOR
self.contents.draw_text(GTITLE_X,GTITLE_Y,110,32,GTITLE)
@try = ""
#---------------------------------------------------------
for i in 0..@amount.length-1
@try += GSYMBOL
end
#---------------------------------------------------------
self.contents.font.color = SYMBOL_COLOR
self.contents.draw_text(-6,160,110,32,@try,1)
@lx = 0
@ly = 0
#---------------------------------------------------------
for i in 0..11
self.contents.font.color = DIAL_COLOR
self.contents.draw_text(
(@lx * 32)+(10), (@ly * 32)+32,32,32,@numbers[i])
@lx += 1
#---------------------------------------------------------
if @lx == 3
@lx = 0
@ly += 1
end
end
@cy = (@index / 3)
@cx = (@index) - (@cy * 3)
self.cursor_rect.set(@cx*32,(@cy*32)+32,32,32)
end
end #end def
#---------------------------------------------------------------------
# Select Cursor
#---------------------------------------------------------------------
def g101_select
if @play_code then $game_system.se_play($data_system.cursor_se) end
end
#---------------------------------------------------------------------
# Input
#---------------------------------------------------------------------
def g101_click
if @play_code then $game_system.se_play($data_system.decision_se) end
end
#---------------------------------------------------------------------
# Correct
#---------------------------------------------------------------------
def g101_correct
if @play_code then $game_system.se_play($data_system.buzzer_se) end
end
#---------------------------------------------------------------------
# Wrong
#---------------------------------------------------------------------
def g101_error
if @play_code then $game_system.se_play($data_system.cancel_se) end
end
#---------------------------------------------------------------------
# Length
#---------------------------------------------------------------------
def length
string = [@correct]
end
#end of script ^,^
GRAPHICS:
- Spoiler:
- cursor: (place in characters folder)
*new cursor:
background: (place in windowskins folder)
Event example:
- Spoiler:
CREDITS:
- Spoiler:
- by gameface101
special thanks to Hackel for help with converting
strings and integers! (I was ultimately stuck)
special thanks to albertfish for teaching me how to make
windows and for_loops a few months back
special thanks to mr_wiggles for this 'print trick' which
helped me out in testing and for lining up the animated cursor
free to use must give credit!
do not post in any other site.
enjoy~
DEVELOPEMENT:
- Spoiler:
- *keep checking for the demo ^,^
Blue wrote:i just realised how useful this thing is... Possibilites:
activate a robot
crack a safe
security thing
bomb
easter egg
game secret
puzzle
minigame (repeat the pattern)
minigame (maths!)
stuff
locks
safe cracker tool
etc etc
Administrator
Show Signature
EVENTALIST
EVENTALIST
EVENTALIST
profile
mr_wiggles
profile
Sweet script by the way, ill be sure to find a spot for this in my game.
EVENTALIST
Show Signature
EVENTALIST
Administrator
Administrator
Administrator
profile
G@MeF@Ce
profile
@wiggles - it would be an honor ^,^
and for those who may need...
here's an event example for a basic setup to test with.
-the code = 36
-the correct switch = 20
-the error switch = 21
*make sure to set a second event page
with Self Switch A checked to end with a win!
and for those who may need...
here's an event example for a basic setup to test with.
-the code = 36
-the correct switch = 20
-the error switch = 21
*make sure to set a second event page
with Self Switch A checked to end with a win!
Administrator
Show Signature
Poster Mcposty
Poster Mcposty
Poster Mcposty
profile
MotionM
profile
@GameFace: Is this like the Lt. Surge gym thing from pokemon?
Poster Mcposty
Show Signature
C.O.R.N.
C.O.R.N.
C.O.R.N.
profile
BluE
profile
THIS IS CRAZY! I COULD USE IT IN SOME GAME INVOLVING NINJAS CRACKING SAFES!
C.O.R.N.
Show Signature
Administrator
Administrator
Administrator
profile
it's simply a dial pad that when entering the right code a switch will trigger...
however you intend to use it...
G@MeF@Ce
profile
@GameFace: Is this like the Lt. Surge gym thing from pokemon?
it's simply a dial pad that when entering the right code a switch will trigger...
however you intend to use it...
Administrator
Show Signature
Poster Mcposty
C.O.R.N.
C.O.R.N.
C.O.R.N.
profile
BluE
profile
i just realised how useful this thing is... Possibilites:
activate a robot
crack a safe
security thing
bomb
easter egg
game secret
puzzle
minigame (repeat the pattern)
minigame (maths!)
stuff
locks
safe cracker tool
etc etc
activate a robot
crack a safe
security thing
bomb
easter egg
game secret
puzzle
minigame (repeat the pattern)
minigame (maths!)
stuff
locks
safe cracker tool
etc etc
C.O.R.N.
Show Signature
Administrator
Administrator
Administrator
profile
G@MeF@Ce
profile
the "G" Code returns, after taking a look back I realized that this wasn't as cool and user friendly as it is now...
{'the G Code'}
/multipurpose\
a new more advanced G Code...
there's added controls in the module for:
+window settings
+text settings
+graphic settings
+input settings
+ use any character sheet for an animated cursor
+ use a background image to customized the look
not only will this script be used in the game it will control the access to it.
*if there's many ways to use one thing, then it's gotta be a good thing
^,^
the original post has been updated with a final version.
demo on the way~?...
/multipurpose\
a new more advanced G Code...
there's added controls in the module for:
+window settings
+text settings
+graphic settings
+input settings
+ use any character sheet for an animated cursor
+ use a background image to customized the look
not only will this script be used in the game it will control the access to it.
*if there's many ways to use one thing, then it's gotta be a good thing
^,^
the original post has been updated with a final version.
demo on the way~?...
Administrator
Show Signature
Active Member
Active Member
Active Member
profile
Legault123
profile
Looks amazing! Great work, waiting for de demo. This will come in handy for my game, thanks for sharing
Active Member
Show Signature
Active Member
Go to page : 1, 2