Per 2016, RMID pindah ke RMID Discord (Invite link dihapus untuk mencegah spambot -Theo @ 2019). Posting sudah tidak bisa dilakukan lagi.
Mohon maaf atas ketidaknyamanannya dan mohon kerjasamanya.

Share | 
 

 Editin Script Movement character

Topik sebelumnya Topik selanjutnya Go down 
Editin Script Movement character Empty2011-09-17, 13:33
PostEditin Script Movement character
#1
fachiru 
Sherlockian
fachiru

Level 5
Posts : 634
Thanked : 6
Engine : RMXP
Skill : Beginner
Type : Writer

Editin Script Movement character Vide
ehm
all para scripters, minta bantuannya dong
aku mau minta tolong buat edit script ini (Script Kyros Movement XP)

Code:
#=========================================================================
===
# *MrTerrawatt's Kryos Movement*
#----------------------------------------------------------------------------
# By MrTerrawatt
# January 21, 2011
#----------------------------------------------------------------------------
# This will allow you to detach turning from the arrow keys and use
# WASD to turn instead. Also: you can switch the arrow keys with WASD
# by, in an event, using the command "$game_player.toggle" .
#============================================================================
class Game_Player < Game_Character
def toggle
if @inverted = false
@inverted == true
else
@inverted == false
end
end
def update
@inverted = false
last_moving = moving?
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
if @inverted = true
case Input.dir4
when 2
turn_down
when 4
turn_left
when 6
turn_right
when 8
turn_up
end
if Input.press?(Input::R)
move_up
else
if Input.press?(Input::X)
move_left
else
if Input.press?(Input::Y)
move_down
else
if Input.press?(Input::Z)
move_right
end
end
end
end
else
case Input.dir4
when 2
move_down
when 4
move_left
when 6
move_right
when 8
move_up
end
if Input.press?(Input::R)
turn_up
else
if Input.press?(Input::X)
turn_left
else
if Input.press?(Input::Y)
turn_down
else
if Input.press?(Input::Z)
turn_right
end
end
end
end
end
end
last_real_x = @real_x
last_real_y = @real_y
super
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
$game_map.scroll_down(@real_y - last_real_y)
end
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
$game_map.scroll_left(last_real_x - @real_x)
end
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
$game_map.scroll_right(@real_x - last_real_x)
end
if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
$game_map.scroll_up(last_real_y - @real_y)
end
unless moving?
if last_moving
result = check_event_trigger_here([1,2])
if result == false
unless $DEBUG and Input.press?(Input::CTRL)
if @encounter_count > 0
@encounter_count -= 1
end
end
end
end
if Input.trigger?(Input::C)
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
end
end
end
end
class Game_Character
def move_down(turn_enabled = true)
if passable?(@x, @y, 2)
@y += 1
increase_steps
else
check_event_trigger_touch(@x, @y+1)
end
end
def move_left(turn_enabled = true)
if passable?(@x, @y, 4)
@x -= 1
increase_steps
else
check_event_trigger_touch(@x-1, @y)
end
end
def move_right(turn_enabled = true)
if passable?(@x, @y, 6)
@x += 1
increase_steps
else
check_event_trigger_touch(@x+1, @y)
end
end
def move_up(turn_enabled = true)
if passable?(@x, @y, 8)
@y -= 1
increase_steps
else
check_event_trigger_touch(@x, @y-1)
end
end
end

nah di script itu kan dia bisa hadap ke kanan/kiri/depan/belakang kalo mencet WASD, nah aku minta tolong ubahin, begini:
Misalkan kita sebelumnya lagi hadap ke depan
> setelah 2 detik kita ga ngapa2in terus pencet kanan dia hadap kanan dulu ga langsung jalan ke kanan
> kalo belum 2 detik bisa jalan langsung ke kanan
begitu juga buat kalo lagi hadap kanan/kiri/depan/belakang
terus hadap yg mencetnya WASD itu ga usah

gmn? ada yg bisa? help please :sembah:

EDIT:
versi notepadnya http://filebin.gamedevid.org/view/100tu/
Editin Script Movement character Empty2011-09-17, 15:31
PostRe: Editin Script Movement character
#2
hart 
Senior
Senior
avatar

Level 5
Posts : 805
Thanked : 38
Engine : Other
Skill : Very Beginner
Type : Developer

Editin Script Movement character Vide
nih, pakailah produk lokal XD

Code:

#===============================================================================
# Fach Move
#-------------------------------------------------------------------------------
# Script aneh yang akan membuat pergerakan player jadi aneh.
#-------------------------------------------------------------------------------
module Fach_Move
#-------------------------------------------------------------------------------
# Konfigurasi:
# - TurningDelay = angka yang menunjukkan berapa detik delay agar karakter dapat
#                  menghadap ke arah lain.
#-------------------------------------------------------------------------------
TurningDelay = 2 
#-------------------------------------------------------------------------------
end
#-------------------------------------------------------------------------------
# END OF BLABLABLA
#===============================================================================
class Game_Player < Game_Character
  include Fach_Move
 
  def initialize
    super
    @last_move_time = Time.now
    @can_move = false
  end
 
  def update
    last_moving = moving?
    unless moving? or $game_system.map_interpreter.running? or
          @move_route_forcing or $game_temp.message_window_showing
     
      if Input.press?(Input::DOWN)
        if Time.now - @last_move_time > TurningDelay && self.direction != 2
          turn_down
          @can_move = false
        else
          move_down if @can_move
        end
        @last_move_time = Time.now
      elsif Input.press?(Input::LEFT)
        if Time.now - @last_move_time > TurningDelay && self.direction != 4
          turn_left
          @can_move = false
        else
          move_left if @can_move
        end
        @last_move_time = Time.now
      elsif Input.press?(Input::RIGHT)
        if Time.now - @last_move_time > TurningDelay && self.direction != 6
          turn_right
          @can_move = false
        else
          move_right if @can_move
        end
        @last_move_time = Time.now
      elsif Input.press?(Input::UP)
        if Time.now - @last_move_time > TurningDelay && self.direction != 8
          turn_up
          @can_move = false
        else
          move_up if @can_move
        end
        @last_move_time = Time.now
      else
        @can_move = true
      end
    end
    last_real_x = @real_x
    last_real_y = @real_y
    super
    if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
      $game_map.scroll_down(@real_y - last_real_y)
    end
    if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
      $game_map.scroll_left(last_real_x - @real_x)
    end
    if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
      $game_map.scroll_right(@real_x - last_real_x)
    end
    if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
      $game_map.scroll_up(last_real_y - @real_y)
    end
    unless moving?
      if last_moving
        result = check_event_trigger_here([1,2])
        if result == false
          unless $DEBUG and Input.press?(Input::CTRL)
            if @encounter_count > 0
              @encounter_count -= 1
            end
          end
        end
      end
      if Input.trigger?(Input::C)
        check_event_trigger_here([0])
        check_event_trigger_there([0,1,2])
      end
    end
  end
end
kalau ngebug atau gk sesuai yang diinginkan silahkan cium dinding rumah anda terus lapor ke saya ya... XD
Editin Script Movement character Empty2011-09-17, 15:54
PostRe: Editin Script Movement character
#3
fachiru 
Sherlockian
fachiru

Level 5
Posts : 634
Thanked : 6
Engine : RMXP
Skill : Beginner
Type : Writer

Editin Script Movement character Vide
yeaaay XD akhirnya jadi juga XD
makasih ya hart :hug:
uuh seneng XD
makasih sekali lagi XD
cendol sended XD

btw mod, lock aja ;) XD XD XD
Editin Script Movement character Empty2011-09-17, 23:55
PostRe: Editin Script Movement character
#4
Garry Laly 
Senior
Senior
Garry Laly

Level 5
Posts : 651
Thanked : 3
Engine : Multi-Engine User
Skill : Beginner

Editin Script Movement character Vide
Yang buat RMVX ada apa gak kk? :D
Editin Script Movement character Empty
PostRe: Editin Script Movement character
#5
Sponsored content 




Editin Script Movement character Vide
 

Editin Script Movement character

Topik sebelumnya Topik selanjutnya Kembali Ke Atas 

Similar topics

+
Halaman 1 dari 1

Permissions in this forum:Anda tidak dapat menjawab topik
RPGMakerID :: Scripts & Event Systems :: RMXP Scripts :: RGSS Support :: RGSS Support Archive-