Help with KGC_RankConception script
#1
Hi!!I found this Japanese script, which lets you change the position of the character in battle(front, middle and back) is the option you choose in the database ]in the section class.The script works, but I do not know how to change the position in battle, as I understandwe need to create a skill and some attibuti in the System section of the database, but after many attempts did not succeed. Maybe a more experienced person can understand something =) thanks in advance^^

DerVVulfman's edit:
Code removed per terms by original author's website.

Reply }
#2
I took a look and hoped to remedy your dilemma quickly, but alas... not yet. Perhaps another scripter if I cannot.

You see, I am familiar with KDC scripts and the forum whereby their scripts originate. It is a Japanese forum which has very strict forum rules and terms of service. In essence, their scripts are exclusive to their site and they state that the scripts are not to be posted anywhere else. Nor are direct links to individual scripts permitted. And if you use their scripts, they are not for commercial (sellable) games. I translated their terms of service personally.

Sucks...

I will leave the script available until the posting of the next forum gazette Sunday night. But that is the only amount of time that can be afforded due to the terms that the KDC scripts allow.
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 }
#3
sorry I did not know O.o, I had taken for granted that we could do, if the post it must delete patience but I hope someone can help me before, I really tried in various ways, but nothing =(
Reply }
#4
Yeah... well, it's not like everyone reads Japanese. Winking I use a translator myself.
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 }
#5
this is obvious, also because I see no other way to understand somethingxD, however, the difference between me and an expert script is that the expert can understand something also looking at lines of code, maybe it do not understand everything, but the idea is , or am I wrong?
Reply }
#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 }
#7
Wow DerVV, you've been busy.
Reply }
#8
That was last night when I was partyin' with you guys in IRC
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 }
#9
WOW I do not know how to thank you^__^, I tried and it works perfectly, I could not understand the part " /(Front|Middle|Rear)Move/ " I created the database also the attributes of rank and range. Anyway, thanks very much for your help and time that you have dedicated me. Thank you for the final script that I've posted, but by problems with the Battle System enemies do not attack, but do not worry, The script also manages targets based on the position(front,middle,rear), I did some tests and it seems to be so,thanks again ^__^
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Plugin or Script help with Item menu, SKill menu, and Equip menu JayRay 3 125 11-22-2024, 07:02 PM
Last Post: JayRay
   Script compatibility help Lord Vectra 3 4,607 07-25-2021, 11:42 PM
Last Post: DerVVulfman
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 15,864 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   "Wait" in the script Whisper 13 16,179 04-28-2020, 04:06 PM
Last Post: Whisper
   Skill Cooldown script Fenriswolf 11 16,472 12-10-2019, 11:10 AM
Last Post: Fenriswolf
   Help iwth script (RGSS Player crash) Whisper 3 8,536 06-17-2017, 05:03 PM
Last Post: Whisper
   Help modifying a script Keeroh 7 10,236 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,874 05-31-2017, 05:10 AM
Last Post: Zachariad
   Actor names in Quest Script jreagan406 5 8,648 03-07-2017, 08:06 AM
Last Post: JayRay
   Bizarre issue with Lanzer counter script. Steel Beast 6Beets 2 7,254 10-04-2016, 11:46 AM
Last Post: Steel Beast 6Beets



Users browsing this thread: 1 Guest(s)