Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
shadow7396

ScriptChange Help!

Recommended Posts

Hey i need help with the following script:

 

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
# [Xp/Vx-VxA] Automatic Door
# Version: 2.00
# Author : LiTTleDRAgo
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#==============================================================================
# â–  Game_Event
#------------------------------------------------------------------------------
#  イベントを扱ã†ã‚¯ãƒ©ã‚¹ã§ã™ã€‚æ¡ä»¶åˆ¤å®šã«ã‚ˆã‚‹ã‚¤ãƒ™ãƒ³ãƒˆãƒšãƒ¼ã‚¸åˆ‡ã‚Šæ›¿ãˆã‚„ã€ä¸¦åˆ—処ç†
# イベント実行ãªã©ã®æ©Ÿèƒ½ã‚’æŒã£ã¦ãŠã‚Šã€Game_Map クラスã®å†…部ã§ä½¿ç”¨ã•ã‚Œã¾ã™ã€‚
#==============================================================================
class Game_Event < Game_Character

VX = defined?(Window_ActorCommand)
VXA = defined?(Window_BattleActor)
DOOR_SOUND = ["Audio.se_play('Audio/SE/Open1', 90, 100)", # Opened Door
"Audio.se_play('Audio/SE/Close1', 90, 100)"] # Closed Door
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias :drg145_upd :update unless method_defined?(:drg145_upd)
def update
drg145_upd
update_autodoor
end
#--------------------------------------------------------------------------
# ◠ドアã®å…¨ã¦
#--------------------------------------------------------------------------
def update_autodoor
interpreter = VX ? $game_map.interpreter.running? :
$game_system.map_interpreter.running?
if @event.name =~ /Door/i && @page.through && !interpreter
distance,type = ($game_player.real_x-@real_x).abs+
($game_player.real_y-@real_y).abs, 0
number = VXA ? [0.5,1.0,1.5] : VX ? [216,232,248] : [128,132,148]
distance = [distance-32,0].max if !VXA
case distance
when 0...number[0]
return if @direction == 8
door_se(type * 2) if @direction == 2
turn_up
@wait_count = 6
when number[0]...number[1]
return if @direction == 6
if @direction > 6 && @wait_count > 0
@wait_count -= 1
elsif @direction == 8
turn_right
@wait_count = 6
else
door_se(type * 2) if @direction == 2
turn_right
@wait_count = 6
end
when number[1]...number[2] #
return if @direction == 4
if @direction > 4 && @wait_count > 0
@wait_count -= 1
elsif @direction == 8
turn_right
@wait_count = 6
elsif @direction == 6
turn_left
@wait_count = 6
else
door_se(type * 2) if @direction == 2
turn_left
@wait_count = 6
end
else
return if @direction == 2
if @direction > 2 and @wait_count > 0
@wait_count -= 1
elsif @direction == 8
turn_right
@wait_count = 6
elsif @direction == 6
turn_left
@wait_count = 6
elsif @direction == 4
door_se(type * 2 + 1)
turn_down
end
end
end
end
#--------------------------------------------------------------------------
# ◠セト ヂレクシオン
#--------------------------------------------------------------------------
if VXA
def turn_up() set_direction(8) end
def turn_right()set_direction(6) end
def turn_left() set_direction(4) end
def turn_down() set_direction(2) end
end
#--------------------------------------------------------------------------
# ◠ドア㮠SE 設定
#--------------------------------------------------------------------------
def door_se(type)
case type
when 2 then eval(DOOR_SOUND[0]) rescue nil
when 3 then eval(DOOR_SOUND[1]) rescue nil
end
end
end

 

 

As you can see, this is an automatic door script that activates when you approach it. Well I want to change that. I want it to activate by pressing a button when you're right in front of it facing upwards only. can anyone help?

Share this post


Link to post
Share on other sites

If you want a locked door, just don't check the "Though" option in the event page.

Share this post


Link to post
Share on other sites

ok another question. But first let me post the event:

 

@>Set Move Route: Player
: :$>Through ON
: :$>Move Up

@>Wait for Move's Completion
@>Change Transparent Flag: Transparency
@>Set Move Route: Player
: :$>Wait: 5 frame(s)

@>Wait for Move's Completion
@>Set Move Route: [Door]
: :$>Graphic: "170-Door01', 0, 6, 0
: :$>Wait: 2 frame(s)
: :$>Graphic: "170-Door01', 0, 4, 0
: :$>Wait: 2 frame(s)
: :$>Graphic: "170-Door01', 0, 2, 0
: :$>Wait: 5 frame(s)

@>Wait for Move's Completion
@>Change Screen Color Tone: (-255,-255,-255,0), @10
@>Set Move Route: Player
: :$>Wait: 15 frame(s)

@>Wait for Move's Completion
@>Set Move Route: Player
: :$>Through OFF

@>Play BGM:'Potion Shop', 100, 100
@>Transfer Player:[], (010,016), No Fade
@>Change Transparency: Normal
@>Change Screen Color Tone: (0,0,0,0), @0

 

Is there a way i can run these event commands along with the script?

Edited by shadow7396

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...