14 days down (18th July – 24th July).

July 24, 2009

No big updates, I was busy at the weekend, and got a new game Thursday, that coupled with work means I didn’t get much done, but in all likely hood I will finish combat by the end of next week, I’d say I’m about a third done.


Rough Skin (XP)

July 20, 2009

Inspired by Poke’mon should an enemy have rough skin or spikes etc then they will hurt attackers.

class Game_Enemy < Game_Battler

  alias enemy_rough_skin_initialize initialize
  def initialize(troop_id, member_index)
    enemy_rough_skin_initialize(troop_id, member_index)

    if @enemy_id == 1
      @rough_skin = true
    end

  end
end

class Game_Battler

  attr_accessor :rough_skin
  attr_accessor :rough_skin_damage
  attr_accessor :rough_skin_damage_percent

  alias rough_skin_initialize initialize
  def initialize
    rough_skin_initialize
    @rough_skin = false
    @rough_skin_damage = 0
    @rough_skin_damage_percent = 50
  end

  alias rough_skin_attack_effect attack_effect
  def attack_effect(attacker)
    attack = rough_skin_attack_effect(attacker)
    if self.rough_skin == true
      attacker.rough_skin_damage = (self.damage.to_i * self.rough_skin_damage_percent)/100
    end
    return attack
  end
end

class Scene_Battle

  alias rough_skin_update_phase4_step5 update_phase4_step5
  def update_phase4_step5
    rough_skin_update_phase4_step5
    if @active_battler.rough_skin_damage != 0
      @active_battler.damage = @active_battler.rough_skin_damage
      @active_battler.hp -= @active_battler.damage
      @active_battler.rough_skin_damage = 0
      @active_battler.damage_pop = true
      @active_battler.white_flash = true
      @wait_count = 8
    end
  end

end

The if statement beginning “if @enemy_id == 1″ shows how to make an enemy have rough skin. To make an enemie’s skin rougher/smoother use: @rough_skin_damage_percent = X Where X is the percent of damage inflicted on the attacker


7 days down (11th July – 17th July).

July 17, 2009

Today is the 7th day I’ve worked on Another Pointless Adventure, I thought I’d catalogue what I did on each day.

Day Accomplished Comments
Saturday
  • Login/Register System
  • Character Framework
Whenever I say framework that generally means, I did the database side of it.
Sunday
  • Leaderboards
  • Character Creation
  • Classes and Passive Skills
  • Adventures
  • Shops
  • Item Framework
By passive skills I mean things like “White Magic Tier 1″ which are automatically added to characters upon creation, mostly database work but some coding aswell. Adventures consisted of a lot of coding at this point but now it is really easy to add an adventure. The shop was quickly written and needed rewriting so not to be specific.
Monday
  • Turn System
  • Inventory
  • Item Usage
  • Shop Update
The shop was updated to put items in the inventory.
Tuesday
  • Equipment (bar un/equipping)
Equipment could be worn, but I had to equip/unequip from the database.
Wednesday
  • Complete shop overhaul
  • Unequip Items
After this update adding/changing shops is pretty trivial. Also did a bit of the equipment code.
Thursday
  • Equipment complete
Equipment can be fully equipped and unequipped.
Friday
  • Quests
  • Lots of little things (like really minor graphical bugs)
Yeah lot’s of little bugs here and there.

Which I think is a good accomplishment given a week. Next up combat and then an overhaul on the map, no more paint drawings.


Another Pointless Adventure

July 15, 2009

Over the last few days (nearly a week) I’ve been working on an online browser based game, in my opinion it’s coming along quite nicely, I’m updating it daily, sadly at the moment I’m still adding what I would consider the essentials, for example today I completely overhauled the item shop’s code also introducing equipment (outside of where I edit the character table in the database). Tomorrow I will finish the code to allow item equipping. Currently I’m going for a Final Fantasy theme (the original) which means all your favourite classes are there, Black Mage, Red Mage, White Mage, Fighter, Thief and Blackbelt (in descending order). I’ll hold the link to it for the moment, because I’d rather it be more complete for when I reveal it.


Twitter

July 12, 2009

Just used Twitter for the first time. Most peoples’ complaints are to do with what do you use it for. Me I had a use in mind for it, when I signed up. It now is effectively my news feed on a website I’m working on. Saves me a bit of hassle, but not entirely 100% sure about Twitter yet; I’ll probably mention it in future.

My Twitter: http://twitter.com/Cobb_Tocs


Blue Mage (XP)

July 11, 2009

First put the ids of the characters that are blue mages in icd_blue_mages (you can add/remove characters mid game if you want). Next icd_blue_mages_all_skills means that if set to true the blue mages will learn any skill s/he is hit with – but being as I’m sure you don’t really want that you can set it to true and enter the skills you want the character to learn in icd_blue_mages_skills and these can all be changed in game.

#==============================================================================
# Individual Character Development - Blue Mage by Fomar0153
#==============================================================================
class Game_Party

  attr_accessor :icd_blue_mages
  attr_accessor :icd_blue_mages_all_skills
  attr_accessor :icd_blue_mages_skills

  alias fomar_icd_blue_mage_initialize initialize
  def initialize
    fomar_icd_blue_mage_initialize
    @icd_blue_mages = []
    @icd_blue_mages_all_skills = false
    @icd_blue_mages_skills = []
  end
end

class Game_Actor < Game_Battler

  def skill_effect(user, skill)
    super(user, skill)
    if $game_party.icd_blue_mages.include?(self.id)
      unless $game_party.icd_blue_mages_all_skills == true
        if $game_party.icd_blue_mages_skills.include?(skill.id)
          self.learn_skill(skill.id)
        end
      else
        self.learn_skill(skill.id)
      end
    end
  end

end

Guest Party Members (VX)

July 10, 2009

Inspired by Final Fantasy 3, this allows you to have people travel with your party and aid you in battles without them having to join the real party.

=begin
Guest Party Members
by Fomar0153
Version 1.0.0

Instructions
To set the guest members:
$game_party.guests = []
With the ids in the [] e.g. [1] is Ralph , [6, 7] is Oscar and Vera etc
To add:
$game_party.guests.push(i)
Where i is the id
To remove:
$game_party.guests.delete(i)
Where i is the id

To see how I set up the guests actions look for the line:
def make_guest_action
(it's near the top) and then read through the method.
Hopefully it's clear enough.

=end

class Game_Party < Game_Unit

  attr_accessor :guests

  alias ffiii_initialize initialize
  def initialize
    ffiii_initialize
    @guests = [5, 6]
  end

end

class Game_Actor < Game_Battler

  def make_guest_action
    self.action.clear
    case @actor_id
    when 5
      if rand(99) < 60 # 60%
        self.recover_all
        self.action.kind = 0
        self.action.basic = 0
        self.action.decide_random_target
        return true
      end
    when 6
      x = rand(99)
      if x < 20 # 20%
        self.recover_all
        self.action.kind = 1
        self.action.skill_id = 56
        self.action.decide_random_target
        return true
      end
      if x < 40 # 20%
        self.recover_all
        self.action.kind = 1
        self.action.skill_id = 44
        self.action.decide_random_target
        return true
      end
      if x < 60 # 20%
        self.recover_all
        self.action.kind = 1
        self.action.skill_id = 55
        self.action.decide_random_target
        return true
      end
      if x < 80 # 20%
        self.recover_all
        self.action.kind = 1
        self.action.skill_id = 79
        self.action.decide_random_target
        return true
      end
    end
    return false
  end

end

class Scene_Battle < Scene_Base

  alias ffiii_make_action_orders make_action_orders
  def make_action_orders
    ffiii_make_action_orders

    unless $game_troop.surprise
      action_battlers2 = @action_battlers.clone
      @action_battlers = []
      for guest in $game_party.guests
        if $game_actors[guest].make_guest_action
          @action_battlers.push($game_actors[guest])
        end
      end
      for battler in action_battlers2
        @action_battlers.push(battler)
      end
    end
  end

  def set_next_active_battler
    loop do
      if $game_troop.forcing_battler != nil
        @active_battler = $game_troop.forcing_battler
        @action_battlers.delete(@active_battler)
        $game_troop.forcing_battler = nil
      else
        @active_battler = @action_battlers.shift
      end
      return if @active_battler == nil
      return if @active_battler.index != nil
      return if $game_party.guests.include?(@active_battler.id)
    end
  end

end

Enemies use items (XP)

July 7, 2009

One of my favourite scripts, this let’s enemies use items, I always wanted to update it to include a stealing system of sorts but I never did at the time anyway here’s the script:

class Game_Enemy < Game_Battler

  Item_Use_Skill = 1

  alias item_initialize initialize
  def initialize(troop_id, member_index)
    item_initialize(troop_id, member_index)
    @items = [1]

    if self.id == 2
      @items = [1, 2]
    end

  end

  alias item_make_action make_action
  def make_action
    item_make_action
    if Item_Use_Skill == self.current_action.skill_id
      self.current_action.kind = 2
      self.current_action.item_id = @items[rand(@items.size)]
      self.current_action.decide_random_target_for_enemy
    end
  end

end

class Scene_Battle

  def make_item_action_result
    # Get item
    @item = $data_items[@active_battler.current_action.item_id]
    # If unable to use due to items running out
    unless $game_party.item_can_use?(@item.id)
      # Shift to step 1
      @phase4_step = 1
      return
    end

    # MODIFIED SECTION IF YOU ARE MERGING THIS SCRIPT
    # ORIGINALLY
    ## If consumable
    #if @item.consumable
    #  # Decrease used item by 1
    #  $game_party.lose_item(@item.id, 1)
    #end

    if @item.consumable and @active_battler.is_a?(Game_Actor)
      $game_party.lose_item(@item.id, 1)
    end

    # END OF MODIFIED SECTION IF YOU ARE MERGING THIS SCRIPT

    # Display item name on help window
    @help_window.set_text(@item.name, 1)
    # Set animation ID
    @animation1_id = @item.animation1_id
    @animation2_id = @item.animation2_id
    # Set common event ID
    @common_event_id = @item.common_event_id
    # Decide on target
    index = @active_battler.current_action.target_index
    target = $game_party.smooth_target_actor(index)
    # Set targeted battlers
    set_target_battlers(@item.scope)
    # Apply item effect
    for target in @target_battlers
      target.item_effect(@item)
    end
  end

end

Epic Monster Deaths (VX)

July 6, 2009

I stumbled across an interesting script over at gameclover: http://rmvx.gameclover.com/s/epic-battle-defeated/ and quite liked it, a couple of people complained however how the results screen didn’t wait for the animation to finish so I made a little fix.

Remember you need to credit Enu a japanese scripter and I believe sandgolem.

#Stick this below the rest of the script

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Determine Win/Loss Results
  #--------------------------------------------------------------------------
  def judge_win_loss
    if $game_temp.in_battle
      if $game_party.all_dead?
        process_defeat
        return true
      elsif $game_troop.all_dead?
        wait(300) if $game_troop.boss?
        process_victory
        return true
      else
        return false
      end
    else
      return true
    end
  end
end

class Game_Troop < Game_Unit

  def boss?
    for enemy in @enemies
      return true if GameBaker::EpicBattleMonsters.include?(enemy.enemy_id)
    end
    return false
  end

end

Blue Magic (VX)

July 5, 2009

I’m going to “back-up” my scripts here over time, probably a few time’s a week until I’m done.
Anyway Sunday’s script was blue magic for rpg maker VX:

Blue Magic

Blue Magic

=begin
Blue Mage
by Fomar0153
Version 1.0.0

Instructions
Ok this is pretty simple, you copy the script and paste it below Materials
in the script editor at which point you need to find the two lines:
  BlueMages = [1, 2, 3, 4]
  BlueMagic = [1, 2, 3, 4, 5, 6, 7, 8]
Which are the lines you need to edit the first line tells the script
who the blue mage/s are, the numbers refer the actor's id in the database
for example:
  BlueMages = [1, 2, 3, 4]
means Ralph, Ulrika, Bennett and Ylva are blue mages
  BlueMages = [4]
means Ylva is the only blue mage
The other line:
    @bluemagic = [1, 2, 3, 4, 5, 6, 7, 8]
Tells the script which skills can be learnt by the blue mage the numbers once
again reference the skill's id in the database.
You can edit the blue mages and the skills they can learn during the course
of the game by using the script event for example to add a mage:
$game_party.bluemages.push(5)
To remove a mage:
$game_party.bluemages.delete(5)
To add magic:
$game_party.bluemagic.push(9)
To remove magic:
$game_party.bluemagic.delete(9)

And that's all my instructions so I hope you found them useful and enjoy using
this script.
=end

class Game_Party < Game_Unit

  attr_accessor :bluemages
  attr_accessor :bluemagic

  alias blue_mage_initialize initialize
  def initialize
    blue_mage_initialize
    @bluemages = [1, 2, 3, 4]
    @bluemagic = [1, 2, 3, 4, 5, 6, 7, 8]
  end

  def blue_mage?(id)
    return @bluemages.include?(id)
  end

  def blue_magic?(id)
    return @bluemagic.include?(id)
  end

end

class Scene_Battle

  alias blue_mage_execute_action_skill execute_action_skill
  def execute_action_skill
    blue_mage_execute_action_skill
    skill = @active_battler.action.skill
    targets = @active_battler.action.make_targets
    for target in targets
      if target.actor?
        if $game_party.blue_mage?(target.id) and $game_party.blue_magic?(skill.id)
          unless target.skill_learn?(skill)
            target.learn_skill(skill.id)
            wait(10)
            @message_window.add_instant_text(target.name + " learns " + skill.name)
            wait(60)
          end
        end
      end
    end
  end

end