Status
Not open for further replies.
Joined
Sep 9, 2015
Messages
297
Reaction score
29
First Language
English
Primarily Uses
Hi! :rock-left: :rock-right:

As simple as it sounds, I'm hoping someone can shed a light on my issue please ;_;

I'm trying to have the actors move towards the target instead of jumping to the target as a move type in Schala BS. https://atelierrgss.wordpress.com/download-page-5/

After doing some print tests(and thanks to Tsukihime...I'm gonna make u a star! =D), I've found that this method is called right before the actor jumps towards the target.
 

#-------------------------------------------------------------------------- # ● Move To Target #-------------------------------------------------------------------------- def move_to_target if self.battler.is_a?(Game_Enemy) self.orig_pos_x = self.x self.orig_pos_y = self.y end self.action_movement[3] = 60 self.priority_type = 2 self.jump_count = 0 self.jump_peak = 0 jump_position_target end And then it goes to here:

#-------------------------------------------------------------------------- # ● Jump_position target #-------------------------------------------------------------------------- def jump_position_target return if self.action_movement[4] == nil turn_toward_character(self.action_movement[4]) target_x = self.action_movement[4].x target_y = self.action_movement[4].y self.jump_count = 0 self.jump_peak = 0 nx = self.action_movement[4].x - self.x ny = self.action_movement[4].y - self.y jump_high(nx ,ny ,10) turn_toward_character(self.action_movement[4]) end and then it finally jumps towards the target

def jump_high(x_plus,y_plus,high = 10) @x += x_plus @y += y_plus distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round @jump_peak = high + distance - @move_speed @jump_count = @jump_peak * 2 @stop_count = 0 make_pose("", 0) $game_temp.event_wait_movement = @jump_count straighten endAny idea where I can edit to make the actor move towards the target instead of jumping? I've been doing trials and errors for days but still havent figured it out. I tried changing the @jump_count to values of like up to 1000 and that threw the actors in a weird motion. But, I think I may have found some light with this below code:

#-------------------------------------------------------------------------- # ● Move Position #-------------------------------------------------------------------------- def moveto_target(px = 0 , py = 0,jump = false ) jump_count = 0 jump_peak = 0 nx = user_target.x + px ny = user_target.y + py nx = real_cx_max if nx > real_cx_max nx = real_cx if nx < real_cx ny = real_cy_max if ny > real_cy_max ny = real_cy if ny < real_cy self.jump_high(0,0,10) if jump self.x = nx self.y = ny endNot sure if this is the solution but I figured it could be a help taking it that its not a jump movement cuz of "self.jump_high(0,0,10) if jump". However, I have no clue how to call it or use it. :(
 
Joined
Sep 9, 2015
Messages
297
Reaction score
29
First Language
English
Primarily Uses
Bumping this up please and I was wondering if a pathfinder script would help in makin this work?
 

mjshi

Jack of Most Trades
Veteran
Joined
Feb 16, 2013
Messages
991
Reaction score
838
First Language
English
Primarily Uses
N/A
So do you want all the jumping to be gone?
 
Joined
Sep 9, 2015
Messages
297
Reaction score
29
First Language
English
Primarily Uses
Oh sorry didnt see this one :X

I'd like to keep the jump one but just add the move towards target(run/dash)
 

mjshi

Jack of Most Trades
Veteran
Joined
Feb 16, 2013
Messages
991
Reaction score
838
First Language
English
Primarily Uses
N/A
Being the low-level coder that I am, I am unable to help further past this point:
Sorry that I can't help too much...

Code:
# implement a module that allows user to input the IDs of actors# that they don't want jumpingclass Game_Character  def execute_turn_active    self.battler.guard_effect = false    if self.battler.is_a?(Game_Enemy)      execute_set_enemy_action if can_execute_set_enemy_action?    else         # need to somehow store the "active" actor's ID here-- no idea how to do       # that in Schala BS      execute_actor_command_turn if can_execute_Actor_command?    end    end    def jump_high(x_plus,y_plus,high = 10)        @x += x_plus    @y += y_plus        # if id matches input in module:    distance = x_plus + y_plus    # else, if the character jumps:    # distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round        @jump_peak = high + distance - @move_speed          @jump_count = @jump_peak * 2    @stop_count = 0    $game_temp.event_wait_movement = @jump_count    straighten  endend
 
Joined
Sep 9, 2015
Messages
297
Reaction score
29
First Language
English
Primarily Uses
def jump_high(x_plus,y_plus,high = 10) @x += x_plus @y += y_plus # if id matches input in module: distance = x_plus + y_plus # else, if the character jumps: # distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round @jump_peak = high + distance - @move_speed @jump_count = @jump_peak * 2 @stop_count = 0 $game_temp.event_wait_movement = @jump_count straighten endI'm sorry but this doesn't work. It jumps to its target when a target is 5 and up tiles away. I believe u can start noticing the little jump at 3 tiles and away but at 5, it just jumps all over again =(

Solution, cut his legs off XD

EDIT:

Since last post was closed down cuz my question regarding it was relevant to what I'm doing here.

My question is how can I pass an instance variable that has a value in it from another method to be used as the px and py value as in below method?

def moveto_target(px = 0 , py = 0,jump = false )I tried this below and threw me the "Formal argument cannot be an instance variable

def moveto_target(@movetox , @movetoy,jump = false )I hope I get my point in what I'm trying to convey XD
 
Last edited by a moderator:
Joined
Sep 9, 2015
Messages
297
Reaction score
29
First Language
English
Primarily Uses
Nevermind. I figured it out!

I answered my own question within the question! Duh! Slap myself on the face(hard) for that one XD

You can close this post now after what it seems to be in years in thoughts... my goly, don'cha hate it when u overlook things when the solution is right under ur nose ;D
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

just beat ff7 original for the first time since 2010. having played remake last year, I have a much better appreciation for the original oddly enough. I still like some of the character presentation in remake more, but the original's got a lot going for it.
Ever reach that moment in your life when your juggling a dozen or more projects that you know will never be made but don't have the heart to delete them? Ugh, I hate those moments...
:kaosigh: Why must you hurt me so?
my main character isn't the warrior of light or the chosen one, he's a self righteous, invasive try hard who gets ahead of himself and makes a critical error, resulting in a downward moral spiral that, eventually, leads him to truths that make him a better man, and im DAMN proud of that.
Generate Actors, Dark Fantasy Monsters, & I Heard There Was a Chosen One, | RPG Maker News #42

Forum statistics

Threads
111,448
Messages
1,061,175
Members
144,813
Latest member
SCLemon
Top