Character Position variable?

Started by Trainer Zydragon, March 07, 2010, 09:35:24 am

Previous topic - Next topic

Trainer Zydragon

Which section of script in which script edits, changes or defines character position? Or how would I go about defining it within a script?

I'm looking for this particular section of script for an options edit, yaknow so I can change char position like FF7 style.

Thanks for any help :)

lilbrudder917

So, basically you're asking how to move a player with a script call?

That would be this:
$game_map.setup(MAP ID)
$game_player.moveto(X, Y)

Trainer Zydragon

No no no, player positions in battle :P
Sorry if I didnt make that clear lol

Basically I want to make an option which changes their position if you want to, like forward middle and behind.

If you look at one of the battle scripts, theres a part that mentions a roulette depending on the players position in battle, which shows the chances of monsters attacking and stuff. So I want people effectively able to choose which characters they want to put further into the battle or further back (archers and such).

lilbrudder917

March 07, 2010, 12:30:30 pm #3 Last Edit: March 07, 2010, 12:36:26 pm by Breloom Trainer Brudder
Oh, this thing?
Spoiler: ShowHide


Yeah, I just searched and found what you said, this:
Spoiler: ShowHide
  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 class [position]
       position = $data_classes[actor.class_id].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


I'm not sure, but you could probably do this:

Spoiler: ShowHide
class Game_System
 attr_accessor :Position

 alias position initialize
 def initialize
   @Position  = 1
   position
 end
end


and then rewrite the random_target_actor from before, and change this line:
position = $data_classes[actor.class_id].position

to:
position = $game_system.position

Of course, using this would require you do this for each actor...

Otherwise, you could make it change the players class instead?

EDIT: Sorry, I'm not the best at Battle Systems.  :(

Trainer Zydragon

Lol I dunno if I'll be installing it into a battle system, but I'll defo be adding it to a CMS along with several other edits :)
Thanks for the help tho, I'll chuck you a level for that one lol

Fantasist

Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews