Help with KGC_RankConception script
#6
Actually, my first step it to grab the whole code, kanji text included, and use an online translator to go through each comment one at a time. It's boring and time consuming.... especially with 1000+ line scripts. Even then, the syntax is so messed up, you gotta hit your head against a desk fifty times to figure out what the translation means.

But hey. I think I got something for you. No translator used...

First, take a look at this:

Code:
module KGC
  
  # WHATEVER THE HECK THIS IS... RANGE
  RC_DEFAULT_RANGE = 4

  # Graphic File that holds the 3 rank position images
  # Stored within the "Graphics/Pictures" folder
  RC_RANK_IMAGE = "position"
  
  # Rank Offset Setting
  # Defaulted to 120 pixels
  # to the left of the character's name
  RC_RANK_OFFSET = 0
  
end

and this...

Code:
# Create a Move Position element...   FrontMove, MiddleMove, RearMove
$game_special_elements["move_rank"] = /(Front|Middle|Rear)Move/
These are changes I made to the top of the script.

Not exactly translations, but my own personal pseudo-translations of what these functions do.


Insofar as the RC_RANK_IMAGE, I trust you downloaded the position.png from the site you obtained the script. It is nothing more than a 96x32 image. The file is supposed to hold the 3 32x32 icons used to show your position in your formation (front, middle, rear).

Now let me get back to one of the code sections I showed above...

Code:
# Create a Move Position element...   FrontMove, MiddleMove, RearMove
$game_special_elements["move_rank"] = /(Front|Middle|Rear)Move/
Now this is important.

This bit of code lets you create three elements in your database: FrontMove, MiddleMove and RearMove. You need to create these elements in the same section of the database where you hold the Fire, vs Undead and the other elements. Spelling and capitalization are important. And this had to be translated into English so the feature would work on your Western system.

Now you can create 3 skills. One skill that lets you move your actor into the Front Position, one the lets you move your actor into the Middle position, and etc. Each skill must have an element tagged to it that represents the position. IE; the rear position skill would be tagged with the RearMove element.

BUT..... I am not done yet. There is a change in the lower part of the script that I haven't shown you. It is this:

Code:
# Change Battler Position -----------------------------------------------
      case move_position
      when "Front"
        if self.is_a?(Game_Actor)
          self.position = 0
        else
          self.element_ranks[$game_special_elements["rank"]] = 1
        end
      when "Middle"
        if self.is_a?(Game_Actor)
          self.position = 1
        else
          self.element_ranks[$game_special_elements["rank"]] = 3
        end
      when "Rear"
        if self.is_a?(Game_Actor)
          self.position = 2
        else
          self.element_ranks[$game_special_elements["rank"]] = 4
        end
      end
      # End Method ------------------------------------------------------------
This bit of code is located around line 230 on down in the script. It is merely a change to the values checked with the when statements. Now in English, it will obtain the position and adjust your player's position accordingly.



Now one more thing.....

I don't know how the whole RANK and RANGE system works. I don't know if you do either. If you do... woohoo!!! If not, well, I guess you don't need to worry about tagging enemies/actors/skills or whatnot with those.

But if that's the case, then the position system changes I showed only do a cosmetic change to your system. I will not affect gameplay. The enemy's decision who to attack is still based on their initial 'class position' as it only reads it straight from the class database.

So I did this little scriptette for you:

Code:
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party. It includes information on amount of gold
#  and items. Refer to "$game_party" for the instance of this class.
#==============================================================================

class Game_Party
  #--------------------------------------------------------------------------
  # * Random Selection of Target Actor
  #     hp0 : limited to actors with 0 HP
  #--------------------------------------------------------------------------
  def random_target_actor(hp0 = false)
    # Initialize roulette
    roulette = []
    # Loop
    for actor in @actors
      # If it fits the conditions
      if (not hp0 and actor.exist?) or (hp0 and actor.hp0?)
        # Get actor [position] for new version
        position = actor.position
        # Front guard: n = 4; Mid guard: n = 3; Rear guard: n = 2
        n = 4 - position
        # Add actor to roulette n times
        n.times do
          roulette.push(actor)
        end
      end
    end
    # If roulette size is 0
    if roulette.size == 0
      return nil
    end
    # Spin the roulette, choose an actor
    return roulette[rand(roulette.size)]
  end
end

This replaces the original 'random_target_actor' routine. Paste this below the KGC script and it will read from the actor's position rather than from the fixed position from the class database.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }


Messages In This Thread
Help with KGC_RankConception script - by Keyren - 04-16-2012, 10:13 AM
RE: Help with KGC_RankConception script - by DerVVulfman - 04-17-2012, 05:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Plugin or Script help with Item menu, SKill menu, and Equip menu JayRay 2 64 11-20-2024, 03:09 AM
Last Post: JayRay
   Script compatibility help Lord Vectra 3 4,605 07-25-2021, 11:42 PM
Last Post: DerVVulfman
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 15,854 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   "Wait" in the script Whisper 13 16,171 04-28-2020, 04:06 PM
Last Post: Whisper
   Skill Cooldown script Fenriswolf 11 16,450 12-10-2019, 11:10 AM
Last Post: Fenriswolf
   Help iwth script (RGSS Player crash) Whisper 3 8,535 06-17-2017, 05:03 PM
Last Post: Whisper
   Help modifying a script Keeroh 7 10,221 06-11-2017, 04:43 PM
Last Post: DerVVulfman
Question  Mog Menu script: help me stop the crazy picture movement during transitions Zachariad 4 9,859 05-31-2017, 05:10 AM
Last Post: Zachariad
   Actor names in Quest Script jreagan406 5 8,643 03-07-2017, 08:06 AM
Last Post: JayRay
   Bizarre issue with Lanzer counter script. Steel Beast 6Beets 2 7,249 10-04-2016, 11:46 AM
Last Post: Steel Beast 6Beets



Users browsing this thread: 1 Guest(s)