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
988
Reaction score
832
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
988
Reaction score
832
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 Posts

Latest Profile Posts

unknown.png

A sketch of a character for an upcoming chapter. I am pre-preparing the heck out of this one and future chapters, don't want to spend time figuring the story out again. :blush:
Today *Fix the game UI
RMMZ maxRows make me tired.
The game supports real-time language switching (really interesting).
8laFKAa.png


jBYDFzZ.png


lYbvPth.png

mY99lgU.png

Swag collecting in the new randomly generated area. Now the mini map also shows the randomly generated features... And even illustrates the whole "bubble" system" that I made to manage memory... Though that part's inadvertent. We'll just call that "the fog of war"... Yes, that's what we'll do. Nobody will be the wiser! :kaopride:
not me being not lazy for 5 seconds and drawing another char portrait (her name is hazel)
its_hazel.png
Been a while since the last time I made a song remix. Had a blast making this

Forum statistics

Threads
110,458
Messages
1,053,478
Members
143,554
Latest member
Cabbage-Man
Top