The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Yawgmothsbud on May 17, 2007, 12:15:10 AM

Title: Re-Post: Pixel Movement Script
Post by: Yawgmothsbud on May 17, 2007, 12:15:10 AM
This is a repost of my last pathetic plea for help. I'm trying to find a script which allows for complete pixel-by-pixel movement, i.e press arrow key for a split second, move one pixel, press key for 2 split seconds ( ;)) move two pixels, etcetera. I have one, but it seems to be very incompatible with many of my scripts and also has about 8 features I don't need that I can;t disable...

The other half of my request is for an 8-directional movement system that DOESN'T create massive graphical bugs...the last one I tried cause your sprite to appear OVER almost any wall when moving towards it diagonally unless I added an event of the tile over it...

Please know that I'm only begging as a last resort: I've spent weeks looking on my own and turned up nothing.
Title: Re: Re-Post: Pixel Movement Script
Post by: Kokowam on May 17, 2007, 12:17:21 AM
This script is 8-directional without the use of extra sprites. At least it should be... If not, I'll take the time to edit it. If you need it with extra sprites, I'll edit it. :D
Title: Re: Re-Post: Pixel Movement Script
Post by: Yawgmothsbud on May 17, 2007, 02:44:35 AM
Thats the one I had before that was full of graphical glitches:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi207.photobucket.com%2Falbums%2Fbb252%2Fyawgmothsbud%2FGraphicalGlitch.png&hash=c3c380312dd2e8bc974395076cabd31aa8df7a05)
I guess this is something users of the script are expected to live with? I can't think of ay way to fix it, which is why I was looking for a better script.

Edit: sorry if that seemed kinda harsh. I'm pretty frustrated getting this whole system to work, and on top of this I'm now getting hell trying to get slipknot's latest scrolling text script to work, AND I'm being buried under school work...I'm a bit flustered and I appreciate you trying to help out  ;)
Title: Re: Re-Post: Pixel Movement Script
Post by: Yawgmothsbud on May 18, 2007, 04:09:19 PM
thanks, ill test that out tomorrow  ;D
Title: Re: Re-Post: Pixel Movement Script
Post by: Irock on May 18, 2007, 04:21:17 PM
Poser, that script is broken. It has smilies in it.

Repost it in a code box.Code box
Title: Re: Re-Post: Pixel Movement Script
Post by: poser7 on May 18, 2007, 06:22:59 PM
haha don't worry it works.
Title: Re: Re-Post: Pixel Movement Script
Post by: Irock on May 18, 2007, 06:24:21 PM
Not with the smilies. It takes out some of the script.
Title: Re: Re-Post: Pixel Movement Script
Post by: Irock on May 18, 2007, 06:46:21 PM
Now the script is shorter. Just use a code box. :mad:
Title: Re: Re-Post: Pixel Movement Script
Post by: Irock on May 18, 2007, 06:57:28 PM
Code block. Not spoiler. [code][/code]
Title: Re: Re-Post: Pixel Movement Script
Post by: poser7 on May 18, 2007, 07:08:07 PM
haha ok I think I have it this time.

#==============================================================================
#@++ graphic modification 8 traverse ver. 1.01 ++
#@@Script by Para Dog
#@@http://2d6.parasite.jp/
#------------------------------------------------------------------------------
# Tilt movement is made possible by pushing the top and bottom key and the left and right key simultaneously,
# In gGraphics/Charactersh folder
# When g(the first character name) +_quarterh there is a file of the name which is said,
# You use as graphics of the slanted portable time. (Example: 001-Fighter01_quarter)
#------------------------------------------------------------------------------
#[Note in regard to installation]
#When it jointly uses with ggraphic modification dashh, this script
# The dash script compared to please put under.
# As for graphics file name of slanted direction dash g(the first character name)+_dash_quarterh
# It becomes.
#==============================================================================

#==============================================================================
# ¡ Game_Player
#==============================================================================

class Game_Player < Game_Character
#--------------------------------------------------------------------------
# - Frame renewal
#--------------------------------------------------------------------------
alias update_para_quarter update
def update
update_para_quarter
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
# •ûŒüƒ{ƒ^ƒ",ª‰Ÿ,³,ê,Ä,¢,ê,΁A,»,Ì•ûŒü,ÖƒvƒŒƒCƒ,,[,ðˆÚ"®
case Input.dir8
when 1 # ‰º,ɈÚ"®
move_lower_left
when 3 # ‰E‰º,ɈÚ"®
move_lower_right
when 7 # ã,ɈÚ"®
move_upper_left
when 9 # ‰Eã,ɈÚ"®
move_upper_right
end
end
end
end

#==============================================================================
# ¡ Sprite_Character
#==============================================================================

class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
# - Frame renewal
#--------------------------------------------------------------------------
alias update_para_quarter update
def update
update_para_quarter
if @tile_id == 0
if (@character.direction - 2) % 2 == 1
# ŽÎ,߉æ'œ,Ì—L–³,ðƒ`ƒFƒbƒN
if quarter_graphic_exist?(@character)
# ŽÎ,߉æ'œ,ðƒZƒbƒg
if character.dash_on and dash_quarter_graphic_exist?(@character)
@character_name = @character.character_name + "_dash_quarter"
else
@character_name = @character.character_name + "_quarter"
end
self.bitmap = RPG::Cache.character(@character_name,
@character.character_hue)
# Œü,«,ðŽæ"¾
case @character.direction
when 1
n = 0
when 3
n = 2
when 7
n = 1
when 9
n = 3
end
else
@character.direction = @character.sub_direction
# ŽÎ,߉æ'œ,ª'Ý,µ,È,¢,Æ,«,ÌŒü,«
n = (@character.direction - 2) / 2
end
# "]'—Œ³,Ì‹éŒ`,ðÝ'è
sx = @character.pattern * @cw
sy = n * @ch
self.src_rect.set(sx, sy, @cw, @ch)
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
# "]'—Œ³,Ì‹éŒ`,ðÝ'è
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
end
end
#--------------------------------------------------------------------------
# › ŽÎ,߉æ'œ,Ì—L–³,ðƒ`ƒFƒbƒN
#--------------------------------------------------------------------------
def quarter_graphic_exist?(character)
# "Ç,ݍž,݃eƒXƒg
begin
RPG::Cache.character(character.character_name.to_s + "_quarter", character.character_hue)
rescue
return false
end
return true
end
#--------------------------------------------------------------------------
# › ŽÎ,߃_ƒbƒVƒ...‰æ'œ,Ì—L–³,ðƒ`ƒFƒbƒN
#--------------------------------------------------------------------------
def dash_quarter_graphic_exist?(character)
# "Ç,ݍž,݃eƒXƒg
begin
RPG::Cache.character(character.character_name.to_s + "_dash_quarter", character.character_hue)
rescue
return false
end
return true
end
end

#==============================================================================
# ¡ Game_Character
#==============================================================================

class Game_Character
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ"ƒXƒ^ƒ"ƒX•ϐ"
#--------------------------------------------------------------------------
attr_accessor :direction # Œü,«
attr_accessor :sub_direction # ŽÎ,߉æ'œ,ª'Ý,µ,È,¢,Æ,«,ÌŒü,«
#--------------------------------------------------------------------------
# œ ‰º,ɈÚ"®
#--------------------------------------------------------------------------
def move_lower_left
# Œü,«ŒÅ'è,Å,È,¢ê‡
unless @direction_fix
@sub_direction = @direction
@direction = 1
# ‰EŒü,«,¾,Á,½ê‡,͍,ðAãŒü,«,¾,Á,½ê‡,͉º,ðŒü,
@sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 8 ? 2 : @sub_direction)
end
# ‰º¨A¨‰º ,Ì,Ç,¿,ç,©,̃R[ƒX,ª'ʍs‰Â"\,ȏꍇ
if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or
(passable?(@x, @y, 4) and passable?(@x - 1, @y, 2))
# À•W,ðXV
@x -= 1
@y += 1
# •à"'‰Á
increase_steps
end
end
#--------------------------------------------------------------------------
# œ ‰E‰º,ɈÚ"®
#--------------------------------------------------------------------------
def move_lower_right
# Œü,«ŒÅ'è,Å,È,¢ê‡
unless @direction_fix
@sub_direction = @direction
@direction = 3
# Œü,«,¾,Á,½ê‡,͉E,ðAãŒü,«,¾,Á,½ê‡,͉º,ðŒü,
@sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 8 ? 2 : @sub_direction)
end
# ‰º¨‰EA‰E¨‰º ,Ì,Ç,¿,ç,©,̃R[ƒX,ª'ʍs‰Â"\,ȏꍇ
if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
(passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
# À•W,ðXV
@x += 1
@y += 1
# •à"'‰Á
increase_steps
end
end
#--------------------------------------------------------------------------
# œ ã,ɈÚ"®
#--------------------------------------------------------------------------
def move_upper_left
# Œü,«ŒÅ'è,Å,È,¢ê‡
unless @direction_fix
@sub_direction = @direction
@direction = 7
# ‰EŒü,«,¾,Á,½ê‡,͍,ðA‰ºŒü,«,¾,Á,½ê‡,͏ã,ðŒü,
@sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 2 ? 8 : @sub_direction)
end
# ã¨A¨ã ,Ì,Ç,¿,ç,©,̃R[ƒX,ª'ʍs‰Â"\,ȏꍇ
if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or
(passable?(@x, @y, 4) and passable?(@x - 1, @y, 8))
# À•W,ðXV
@x -= 1
@y -= 1
# •à"'‰Á
increase_steps
end
end
#--------------------------------------------------------------------------
# œ ‰Eã,ɈÚ"®
#--------------------------------------------------------------------------
def move_upper_right
# Œü,«ŒÅ'è,Å,È,¢ê‡
unless @direction_fix
@sub_direction = @direction
@direction = 9
# Œü,«,¾,Á,½ê‡,͉E,ðA‰ºŒü,«,¾,Á,½ê‡,͏ã,ðŒü,
@sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 2 ? 8 : @sub_direction)
end
# ã¨‰EA‰E¨ã ,Ì,Ç,¿,ç,©,̃R[ƒX,ª'ʍs‰Â"\,ȏꍇ
if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or
(passable?(@x, @y, 6) and passable?(@x + 1, @y, 8))
# À•W,ðXV
@x += 1
@y -= 1
# •à"'‰Á
increase_steps
end
end
#--------------------------------------------------------------------------
# › ƒ_ƒbƒVƒ...ƒXƒNƒŠƒvƒg"±"ü"»'è
#--------------------------------------------------------------------------
def dash_on
if @dash_on != nil
return @dash_on
else
return false
end
end
end




Ok maybe it's right this time and thanks for your patience.
Title: Re: Re-Post: Pixel Movement Script
Post by: Kokowam on May 18, 2007, 07:13:41 PM
This is a 8-way direction thing...XP I already posted one of these.