Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Game Activation(originally danjchau's)

Game Activation

~P.S.~ The File_Test script is not mine but the Title_Screen and the demo is !! The sript was made by: danjchau from creation assylum!

About:
Haven't you always wished you could add an activation key to your game?? Well now u can with this :D. Try it out here: http://files.filefront.com/Activationexe/;...;/fileinfo.html
The activation code for the demo is 246813579, 987654321, 135792468, 123456789, or 246813579. You can use any of those for the demo!

Pretty much it does what it says... makes you type in an actiavtion key. If you need to know how to set it up just read below! I will add screenshots in one minute!

Screenshots:
http://img186.imageshack.us/img186/4799/untitlednu6.png[/IMG]
The first title screen.

http://img406.imageshack.us/img406/5749 ... edbny2.png[/IMG]
A poor animation of a loading screen type thing! (can someone make a better one! OR maybe a script one?

http://img246.imageshack.us/img246/9007 ... edcla6.png[/IMG]
If the activation is found a message pops up and the game is started

http://img100.imageshack.us/img100/4996 ... eddmo3.png[/IMG]
The activation screen.

The first title screen
Code:
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs title screen processing.
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # If battle test
    if $BTEST
      battle_test
      return
    end
    # Load database
    $data_actors        = load_data("Data/Actors.rxdata")
    $data_classes       = load_data("Data/Classes.rxdata")
    $data_skills        = load_data("Data/Skills.rxdata")
    $data_items         = load_data("Data/Items.rxdata")
    $data_weapons       = load_data("Data/Weapons.rxdata")
    $data_armors        = load_data("Data/Armors.rxdata")
    $data_enemies       = load_data("Data/Enemies.rxdata")
    $data_troops        = load_data("Data/Troops.rxdata")
    $data_states        = load_data("Data/States.rxdata")
    $data_animations    = load_data("Data/Animations.rxdata")
    $data_tilesets      = load_data("Data/Tilesets.rxdata")
    $data_common_events = load_data("Data/CommonEvents.rxdata")
    $data_system        = load_data("Data/System.rxdata")
    # Make system object
    $game_system = Game_System.new
    # Make title graphic
    @sprite = Sprite.new
    @sprite.bitmap = RPG::Cache.title($data_system.title_name)
    # Make command window
    s1 = "Main Menu"
    s2 = "Activate"
    s3 = "Shutdown"
    @command_window = Window_Command.new(192, [s1, s2, s3])
    @command_window.back_opacity = 160
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 288
   # Continue enabled determinant
    # Check if at least one save file exists
    # If enabled, make @continue_enabled true; if disabled, make it false
    @continue_enabled = true
    for i in 0...6
      if FileTest.exist? ("246813579.txt")
      elsif FileTest.exist? ("123456789.txt")
      elsif FileTest.exist? ("135792468.txt")
      elsif FileTest.exist? ("987654321.txt")
       @continue_enabled = false
      end
    end
    # If continue is enabled, move cursor to "Continue"
    # If disabled, display "Continue" text in gray
    if @continue_enabled
      @command_window.index = 1
    else
      @command_window.disable_item(1)
    end
    # Play title BGM
    $game_system.bgm_play($data_system.title_bgm)
    # Stop playing ME and BGS
    Audio.me_stop
    Audio.bgs_stop
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of command window
    @command_window.dispose
    # Dispose of title graphic
    @sprite.bitmap.dispose
    @sprite.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update command window
    @command_window.update
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 0  # New game
   $scene= Scene_Title2.new
      when 1  # Continue
             $scene= Scene_Activation.new
      when 2 
        command_shutdown
      end
    end
  end
  
  #--------------------------------------------------------------------------
  # * Command: Shutdown
  #--------------------------------------------------------------------------
  def command_shutdown
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Fade out BGM, BGS, and ME
    Audio.bgm_fade(800)
    Audio.bgs_fade(800)
    Audio.me_fade(800)
    # Shutdown
    $scene = nil
  end
  #--------------------------------------------------------------------------
  # * Battle Test
  #--------------------------------------------------------------------------
  def battle_test
    # Load database (for battle test)
    $data_actors        = load_data("Data/BT_Actors.rxdata")
    $data_classes       = load_data("Data/BT_Classes.rxdata")
    $data_skills        = load_data("Data/BT_Skills.rxdata")
    $data_items         = load_data("Data/BT_Items.rxdata")
    $data_weapons       = load_data("Data/BT_Weapons.rxdata")
    $data_armors        = load_data("Data/BT_Armors.rxdata")
    $data_enemies       = load_data("Data/BT_Enemies.rxdata")
    $data_troops        = load_data("Data/BT_Troops.rxdata")
    $data_states        = load_data("Data/BT_States.rxdata")
    $data_animations    = load_data("Data/BT_Animations.rxdata")
    $data_tilesets      = load_data("Data/BT_Tilesets.rxdata")
    $data_common_events = load_data("Data/BT_CommonEvents.rxdata")
    $data_system        = load_data("Data/BT_System.rxdata")
    # Reset frame count for measuring play time
    Graphics.frame_count = 0
    # Make each game object
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_screen        = Game_Screen.new
    $game_actors        = Game_Actors.new
    $game_party         = Game_Party.new
    $game_troop         = Game_Troop.new
    $game_map           = Game_Map.new
    $game_player        = Game_Player.new
    # Set up party for battle test
    $game_party.setup_battle_test_members
    # Set troop ID, can escape flag, and battleback
    $game_temp.battle_troop_id = $data_system.test_troop_id
    $game_temp.battle_can_escape = true
    $game_map.battleback_name = $data_system.battleback_name
    # Play battle start SE
    $game_system.se_play($data_system.battle_start_se)
    # Play battle BGM
    $game_system.bgm_play($game_system.battle_bgm)
    # Switch to battle screen
    $scene = Scene_Battle.new
  end
end

Activation script:

Code:
#
#========================================================================
#---------------------danjchau's Activation script-----------------------------#
#-----------Runs with danjchau's Multiple File Checking Script-----------------#
#-----------------Edit codes at line 42 stop at END----------------------------#
#========================================================================
class Scene_Activation

  def main
    @edit_window = Window_ActivationEdit.new
    @input_window = Window_ActivationInput.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @edit_window.dispose
    @input_window.dispose
  end
  
  def update
    @edit_window.update
    @input_window.update
    if Input.repeat?(Input::B)
      if @edit_window.index == 0
        return
      end
      $game_system.se_play($data_system.cancel_se)
      @edit_window.back
      return
    end
    if Input.trigger?(Input::C)
      if @input_window.character == nil
        @Activation_word = @edit_window.Activation.downcase


    #Edit below
     if @Activation_word == "987654321"
file = File.open("987654321.txt","w")
file.write("Activation Demo V2")
file.write("         Activation Key:")
file.write("987654321")
  print("Activation Successful!")
    
      elsif @Activation_word == "135792468"
file = File.open("135792468.txt","w")
file.write("Activation Demo V2")
file.write("         Activation Key:")
file.write("135792468")
  print("Activation Successful!")
    

    elsif @Activation_word == "123456789"
file = File.open("123456789.txt","w")
file.write("Activation Demo V2")
file.write("         Activation Key:")
file.write("123456789")
  print("Activation Successful!")
    
  
    elsif @Activation_word == "246813579"
file = File.open("246813579.txt","w")
file.write("Activation Demo V2")
file.write("         Activation Key:")
file.write("246813579")
  print("Activation Successful!")
    # END/STOP EDITING
        else
            $game_system.se_play($data_system.buzzer_se)
            print("Activation Invalid")
             $scene =Scene_Title2.new
          end
      $scene = nil
        return
      end
      if @input_window.character == ""
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @edit_window.add(@input_window.character)
      return
    end
  end
end

class Window_Base < Window
  def draw_icon_graphic(icon, x, y)
    bitmap = RPG::Cache.icon(icon)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end
end

class Window_ActivationEdit < Window_Base
  attr_reader   :Activation               
  attr_reader   :index                   
  def initialize
    super(0, 0, 640, 128)
    self.contents = Bitmap.new(width - 32, height - 32)
    @max_char = 17
    @index = 0
    @Activation = ""
    refresh
    update_cursor_rect
  end
  def add(character)
    if @index < @max_char and character != ""
      @Activation += character
      @index += 1
      refresh
      update_cursor_rect
    end
  end
  def back
    if @index > 0
      name_array = @Activation.split(//)
      @Activation = ""
      for i in 0...name_array.size-1
        @Activation += name_array[i]
      end
      @index -= 1
      refresh
      update_cursor_rect
    end
  end
  def refresh
    self.contents.clear
    name_array = @Activation.split(//)
    for i in 0...@max_char
      c = name_array[i]
      if c == nil
        c = "_"
      end
      x = (i + 1) * 32
      self.contents.draw_text(x, 32, 28, 32, c, 1)
    end
  end
  def update_cursor_rect
    x = (@index + 1) * 32
    self.cursor_rect.set(x, 32, 28, 32)
  end
  def update
    super
    update_cursor_rect
  end
end

class Window_ActivationInput < Window_Base
  CHARACTER_TABLE =
  [
    "A","B","C","D","E",
    "F","G","H","I","J",
    "K","L","M","N","O",
    "P","Q","R","S","T",
    "U","V","W","X","Y",
    "Z"," "," "," "," ",
    "+","-","*","/","!",
    "1","2","3","4","5",
    "" ,"" ,"" ,"" ,"" ,
    "a","b","c","d","e",
    "f","g","h","i","j",
    "k","l","m","n","o",
    "p","q","r","s","t",
    "u","v","w","x","y",
    "z"," "," "," "," ",
    "#","$","%","&","@",
    "6","7","8","9","0",
    "" ,"" ,"" ,"" ,"" ,
  ]
  def initialize
    super(0, 128, 640, 352)
    self.contents = Bitmap.new(width - 32, height - 32)
    @index = 0
    refresh
    update_cursor_rect
  end
  def character
    return CHARACTER_TABLE[@index]
  end
  def refresh
    self.contents.clear
    for i in 0...90
      x = 140 + i / 5 / 9 * 180 + i % 5 * 32
      y = i / 5 % 9 * 32
      self.contents.draw_text(x, y, 32, 32, CHARACTER_TABLE[i], 1)
    end
    self.contents.draw_text(428, 9 * 32, 48, 32, "OK", 1)
  end
  def update_cursor_rect
    if @index >= 90
      self.cursor_rect.set(428, 9 * 32, 48, 32)
    else
      x = 140 + @index / 5 / 9 * 180 + @index % 5 * 32
      y = @index / 5 % 9 * 32
      self.cursor_rect.set(x, y, 32, 32)
    end
  end
  def update
    super
    if @index >= 90
      if Input.trigger?(Input::DOWN)
        $game_system.se_play($data_system.cursor_se)
        @index -= 90
      end
      if Input.repeat?(Input::UP)
        $game_system.se_play($data_system.cursor_se)
        @index -= 90 - 40
      end
    else
      if Input.repeat?(Input::RIGHT)
        if Input.trigger?(Input::RIGHT) or
           @index / 45 < 3 or @index % 5 < 4
          $game_system.se_play($data_system.cursor_se)
          if @index % 5 < 4
            @index += 1
          else
            @index += 45 - 4
          end
          if @index >= 90
            @index -= 90
          end
        end
      end
      if Input.repeat?(Input::LEFT)
        if Input.trigger?(Input::LEFT) or
           @index / 45 > 0 or @index % 5 > 0
          $game_system.se_play($data_system.cursor_se)
          if @index % 5 > 0
            @index -= 1
          else
            @index -= 45 - 4
          end
          if @index < 0
            @index += 90
          end
        end
      end
      if Input.repeat?(Input::DOWN)
        $game_system.se_play($data_system.cursor_se)
        if @index % 45 < 40
          @index += 5
        else
          @index += 90 - 40
        end
      end
      if Input.repeat?(Input::UP)
        if Input.trigger?(Input::UP) or @index % 45 >= 5
          $game_system.se_play($data_system.cursor_se)
          if @index % 45 >= 5
            @index -= 5
          else
            @index += 90
          end
        end
      end
      if Input.repeat?(Input::L) or Input.repeat?(Input::R)
        $game_system.se_play($data_system.cursor_se)
        if @index < 45
          @index += 45
        else
          @index -= 45
        end
      end
    end
    update_cursor_rect
  end
end
Setup(for your game):
1. Copy both scene_titles to ur game from the demo. (Delete the normal Scene_Title already in ur game!)

2. Copy the File_Test script as well.

3. Make a new map and copy the event in map004 not labeled S int o a new map u create called intro! Copy the S now and paste it in that map. (DO NOT EDIT MAP!!).

4. Copy picture files in game to ur game under the pictures folder)

5. If you want too make a new serial you can do so by adding this:
Code:
if @Activation_word == "your serial here"
file = File.open("your serial here.txt","w")
file.write("Activation Demo V2")
file.write("         Activation Key:")
file.write("your serial here")
  print("Activation Successful!")

Under
Code:
if @Activation_word == "987654321"
file = File.open("987654321.txt","w")
file.write("Activation Demo V2")
file.write("         Activation Key:")
file.write("987654321")
  print("Activation Successful!")
    
      elsif @Activation_word == "135792468"
file = File.open("135792468.txt","w")
file.write("Activation Demo V2")
file.write("         Activation Key:")
file.write("135792468")
  print("Activation Successful!")
    

    elsif @Activation_word == "123456789"
file = File.open("123456789.txt","w")
file.write("Activation Demo V2")
file.write("         Activation Key:")
file.write("123456789")
  print("Activation Successful!")
    
  
    elsif @Activation_word == "246813579"
file = File.open("246813579.txt","w")
file.write("Activation Demo V2")
file.write("         Activation Key:")
file.write("246813579")
  print("Activation Successful!")

If you dont want a new serial use one of these: 246813579, 987654321, 135792468, 123456789, or 246813579.

6. If u made a new serial go to Scene_Title and add this

Code:
  elsif FileTest.exist? ("serial u added.txt")

under this:

Code:
  for i in 0...3
      if FileTest.exist? ("246813579.txt")
      elsif  FileTest.exist? ("123456789.txt")
      elsif FileTest.exist? ("135792468.txt")
        elsif FileTest.exist? ("987654321.txt")

If you didnt make your own code your done!

7. (Only if you added your own code) Now in the event u copied from the demo copy the code at the very end from "Show picture check45" all the way to script: Print...

8. Delete it after you copy it and Press the new event page button and paste it the new page for the time being!


9. Now copy the code from conditional branch: Script: Filetest.exist? ("135792468.txt") then paste that code under the else at the very bottom of the code.

10. Now change the 135792468 to the serial u created(dont change both 1257 codes.)

11. Go back to the new event page and copy the code again!

12. Paste the code under the other else code at the bottom! Now you are finneshed!

It is best if every person u give the game too the activation # changes :D just change the serial number u added if u added one each time and everythign else that says ur serial here :D to the new serial, if u knwo what i mean :D

If you have any ?'s or need help please post below!

Frequently asked ?'s:

Q1: Can u delete:
Code:
if @Activation_word == "987654321"
file = File.open("987654321.txt","w")
file.write("Activation Demo V2")
file.write("         Activation Key:")
file.write("987654321")
  print("Activation Successful!")
    
      elsif @Activation_word == "135792468"
file = File.open("135792468.txt","w")
file.write("Activation Demo V2")
file.write("         Activation Key:")
file.write("135792468")
  print("Activation Successful!")
    

    elsif @Activation_word == "123456789"
file = File.open("123456789.txt","w")
file.write("Activation Demo V2")
file.write("         Activation Key:")
file.write("123456789")
  print("Activation Successful!")
    
  
    elsif @Activation_word == "246813579"
file = File.open("246813579.txt","w")
file.write("Activation Demo V2")
file.write("         Activation Key:")
file.write("246813579")
  print("Activation Successful!")

and just add:
elsif @Activation_word == "(your serial here)"
file = File.open("your serial here.txt","w")
file.write("Activation Demo V2")
file.write(" Activation Key:")
file.write("246813579")
print("your serial here")

so each game only has one serial and u can change that every time!

A1: Yes you can and it would be easier! But u need to do alot of fixing! :D


~P.S.~ The File_Test script is not mine but the Title_Screen and the demo is !! The sript was made by: danjchau from creation assylum!
 
Hello. Sorry for this Really really late reply. No, I'm not just from creeation asylum and please ask permission before you post my scripts.
 
This is a really cool script, but I don't like the code input. It's just like the name input thing and its not that great looking with it. And also, if one person knows a key, then they could put it somewhere on the internet and people could use a single key and get it pretty much for free.
 
ya for some reason (maybe campability issues the checking for activation gets stuck in a loop even though it says activation found
 
great script, but you need to make it, so that the script makes random numbers to input, in order to activate it, else, people will be software piracing your games, a few sites have a bunch of codes such as http://www.dailykeys.com but hey, i aint say nuthing, that website is an example of software piracy, and people could get busted by law enforcement for doing that. Note: I thought it was file sharing, doesnt help. ;)
 
well, couldn't you also set the script up to check for the file in an online location? like for instance, the game-seller's website? If this was the case, then the game-seller would have the option of ALSO granting a CHMOD 777 to a certain file and through a script, automatically log the entry of the activation key (as well as maybe the MAC address) and see which computers are re-using the same old code?

Or am I just an idiot with delusions of grandeur?
 
Let the creater decide when and where the script is released. If you dont get a reply, you just wait. And if he doesnt reply at all, you dont post it!
 
I read talk of selling games... I think people are not thinking things through here. You're making this game in an already commercially sold program that, to my knowledge, hasn't given people permission to resell. If you sold your game, you would be illegally selling something.

This script has other practical uses most likely, but I wanted to give a heads up before people started to try this for selling...
 
Wandering Otaku said:
You're making this game in an already commercially sold program that, to my knowledge, hasn't given people permission to resell. If you sold your game, you would be illegally selling something.

RPGXP was made specifically to sell games. Look at Lambchop's Aveyond. And that's only one example. I think you should "think things through" before you say things.
 
samboy":2nq8fouv said:
RPGXP was made specifically to sell games. Look at Lambchop's Aveyond. And that's only one example. I think you should "think things through" before you say things.

There is no reason to be rude, I wasn't. I was misinformed, I never knew it was allowed to make shareware for the game.

Well, back on topic, if anyone actually does use this to sell games, just make sure not to use any copywrited stuff.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top