Moving with only Left and Right sprite?

● ARCHIVED · READ-ONLY
Started by konomaru 12 posts View original ↗
  1. I was wondering if theres a simple script that let you only use 2 sprites direction thats works with 8 direction movement?, so even when moving up and down, the left or right sprite is still in use depending on the direction it is moving (left or right), meaning I can't just switch the back and front sprite with left/right cause it will be facing only 1 direction.....

    An example would be like YU-GI-OH Tag force games example: 



    .
    I've been searching all over, so if anyone knows, can you please help?
  2. You might be able to do this without scripting if you create a common event running off of a parallel process that changes the Actor's Graphic when moving left or right, and dedicate a sprite set to all walking left or all walking right. 

    It would look something like this.  Capture.PNG You would just have to activate the switch before movement is allowed.
  3. Thanks! it worked, but it seem to have cancel out Galv's character animation script, which changes the sprite animation when not moving, and changes the sprite from walking to running sprites too. http://galvs-scripts.com/galvs-character-animations/

    So I'm guessing, I have to edit the script itself to make this happen?
  4. Well, each script is going to play with something like this differently, and your best bet might be to modify an 8-directional script.  But here's a scriptlet I created for you that will work perfectly in the "standard" setup: your character can move in any of the 8 directions (as in the standard setup, only Move Routes will actually let you move diagonally) but will only turn left or right.

    As long as none of your scripts overwrite the set_direction method, it should be compatible with all your scripts.  Place it at the end of your Materials section.  If you notice any funny behavior, try it at the beginning of your Materials sections instead.

    Code:
    class Game_CharacterBase    #--------------------------------------------------------------------------  # * Change Direction to Designated Direction  #     d : Direction (2,4,6,8)  #--------------------------------------------------------------------------  def set_direction(d)    if (d == 3 or d == 6 or d == 9)      @direction = 6 if !@direction_fix      @stop_count = 0    end    if (d == 1 or d == 4 or d == 7)      @direction = 4 if !@direction_fix      @stop_count = 0    end  end  end
  5. Thanks a bunch  :D  this will do, I guess 8-dir movement hove to wait until, I learn a bit of scripting.
  6. Just wondering, but if this is always the way the sprite looks, can't you just change the sprite's character set itself? (the graphic, I mean?)
  7. GrandmaDeb said:
    Just wondering, but if this is always the way the sprite looks, can't you just change the sprite's character set itself? (the graphic, I mean?)
    Not exactly, as the intent is to not have upwards and downwards facing sprites but instead to maintain the last direction be it right or left while moving up and down.

    konomaru said:
    Thanks! it worked, but it seem to have cancel out Galv's character animation script, which changes the sprite animation when not moving, and changes the sprite from walking to running sprites too. http://galvs-scripts.com/galvs-character-animations/

    So I'm guessing, I have to edit the script itself to make this happen?
    As Galv's script requires you to have an individual document per character, perhaps if you instead change file instead of simply alternating sprite sets in the file, it would work more like the way you want it to. Using the method i suggested.
  8. konomaru said:
    Thanks a bunch  :D  this will do, I guess 8-dir movement hove to wait until, I learn a bit of scripting.
    No problem.  Find some diagonal/8-dir movement scripts and check for any overwrite methods on "set_direction".  If there aren't any, there's a good chance my scriptlet will still work.

    By the way, there are probably some Parallax scripts out there that will help complete the aesthetic for you, with the foreground and background "framing" the level where the characters walk.
  9. Wavelength said:
    Well, each script is going to play with something like this differently, and your best bet might be to modify an 8-directional script.  But here's a scriptlet I created for you that will work perfectly in the "standard" setup: your character can move in any of the 8 directions (as in the standard setup, only Move Routes will actually let you move diagonally) but will only turn left or right.

    As long as none of your scripts overwrite the set_direction method, it should be compatible with all your scripts.  Place it at the end of your Materials section.  If you notice any funny behavior, try it at the beginning of your Materials sections instead.

    class Game_CharacterBase #-------------------------------------------------------------------------- # * Change Direction to Designated Direction # d : Direction (2,4,6,8) #-------------------------------------------------------------------------- def set_direction(d) if (d == 3 or d == 6 or d == 9) @direction = 6 if !@direction_fix @stop_count = 0 end if (d == 1 or d == 4 or d == 7) @direction = 4 if !@direction_fix @stop_count = 0 end end end
    Thanks this script is just what I needed!  But it is proving a problem when I need to turn it off during events.  Could you possibly add a way to disable it with an event scripted call?  Then it would be perfect!  I am using certain facing positions for poses, but since it is locked to left/right I cannot use them.  That is my problem.
  10. Spearnear said:
    Thanks this script is just what I needed!  But it is proving a problem when I need to turn it off during events.  Could you possibly add a way to disable it with an event scripted call?  Then it would be perfect!  I am using certain facing positions for poses, but since it is locked to left/right I cannot use them.  That is my problem.
    Easy to do with an Aliased method.  It can call the new behavior under a certain condition, and call the old behavior otherwise.

    Use the following modification to turn it ON or OFF any time during the game by setting a switch (in this case 26 but you can change it to any other switch).  Just be careful about using this alongside other scripts that modify set_direction, since you will sometimes be calling their behavior (but sometimes not).

    Code:
    class Game_CharacterBase    #--------------------------------------------------------------------------  # * Change Direction to Designated Direction  #     d : Direction (2,4,6,8)  #--------------------------------------------------------------------------  alias :set_dir_sometimes :set_direction  def set_direction(d)    if $game_switches[26] == true      if (d == 3 or d == 6 or d == 9)        @direction = 6 if !@direction_fix        @stop_count = 0      end      if (d == 1 or d == 4 or d == 7)        @direction = 4 if !@direction_fix        @stop_count = 0      end    else      set_dir_sometimes(d)    end  end  end
  11. I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


    If you need it to be compatible with existing scripts, please post links to the scripts (this does not mean copy and paste the script into your post)
  12. EchoingClock said:
    You might be able to do this without scripting if you create a common event running off of a parallel process that changes the Actor's Graphic when moving left or right, and dedicate a sprite set to all walking left or all walking right.

    It would look something like this. View attachment 15915 You would just have to activate the switch before movement is allowed.

    Thank you from future! You literally saved ma time so much xD