Project1
标题:
XP脚本如何改成VX可用?
[打印本页]
作者:
2855595
时间:
2011-7-13 20:11
标题:
XP脚本如何改成VX可用?
本帖最后由 2855595 于 2012-4-23 06:51 编辑
脚本 是XP的
跟NPC(下图是用XP开启 跟NPC对话完毕之后 就可以玩的图片)
[attach]64190[/attach]
[attach]64171[/attach]
但是用VX把脚本代码用上之后 就出现错误
[attach]64172[/attach]
他的代码如下
#=====================================================
#Der Einarmige Bandit fur das Casino cNintendo (Made by Itachihro)
#=====================================================
class Scene_Slots
def initialize(usedcoins=0,slot1=nil,slot2=nil,slot3=nil)
#Initialisierung des Spiels
#Ubernehmen der Parameter (alle optional)
@content1=slot1#Inhalt von @Slot1
@content2=slot2#Inhalt von @Slot2
@content3=slot3#Inhalt von @Slot3
@usedcoins=usedcoins
#Initialisierung der Variablen
@FrameCount=0
@GameActive=false
@RedSevenWin=[1,1,1]
@BlueSevenWin=[2,2,2]
@GreenWin=[5,5,5]
@BlueWin=[4,4,4]
@ReplayWin=[3,3,3]
@AppleWin=[6,6]
@BigAppleWin=[6,6,6]
@SmallRedBonus=[1,1,2]
@SmallBlueBonus=[2,2,1]
@Gewinn=0
#Pfade furs Support Fenster (schwarzes Fenster rechts)
#Fall: Insert (eingeworfene Munzen=0)
@Insert_01=RPG::Cache.picture("Insert_01")
@Insert_02=RPG::Cache.picture("Insert_02")
#Fall: Insert (eingeworfene Munzen=1-3)
@Insert_03=RPG::Cache.picture("Insert_03")
@Insert_06=RPG::Cache.picture("Insert_06")
#Fall: Stop (Spiel lauft)
@Stop_01=RPG::Cache.picture("Stop_01")
@Stop_02=RPG::Cache.picture("Stop_02")
@Stop_03=RPG::Cache.picture("Stop_03")
@Stop_04=RPG::Cache.picture("Stop_04")
@Stop_05=RPG::Cache.picture("Stop_05")
@Stop_06=RPG::Cache.picture("Stop_06")
#Fall: Gewonnen
@Win_01=RPG::Cache.picture("Win_01")
@Win_02=RPG::Cache.picture("Win_02")
@Win_03=RPG::Cache.picture("Win_03")
@Win_03=RPG::Cache.picture("Win_04")
#Fall: Verloren
@Lose_01=RPG::Cache.picture("Lose_01")
@Lose_02=RPG::Cache.picture("Lose_02")
#Pfad fur den Hintergrund
@BackgroundIMG=RPG::Cache.picture("Cornerslots")
#Pfad fur die leuchtenden Lampchen
@Light_01=RPG::Cache.picture("Line_Active_01")
@Light_02=RPG::Cache.picture("Line_Active_02")
@Light_03=RPG::Cache.picture("Line_Active_03")
#Pfade fur Zahlen Bilder
@Credit0=RPG::Cache.picture("Credit_Number_00")
@Credit1=RPG::Cache.picture("Credit_Number_01")
@Credit2=RPG::Cache.picture("Credit_Number_02")
@Credit3=RPG::Cache.picture("Credit_Number_03")
@Credit4=RPG::Cache.picture("Credit_Number_04")
@Credit5=RPG::Cache.picture("Credit_Number_05")
@Credit6=RPG::Cache.picture("Credit_Number_06")
@Credit7=RPG::Cache.picture("Credit_Number_07")
@Credit8=RPG::Cache.picture("Credit_Number_08")
@Credit9=RPG::Cache.picture("Credit_Number_09")
#Array fur die Zahlen Bilder
@Credit_Numbers=[@Credit0,@Credit1,@Credit2,@Credit3,@Credit4,@Credit5,@Credit6,
@Credit7,@Credit8,@Credit9]
end
def main
#============================
#Erstellung der Sprites
#==========================
#Hintergrund
@Background=Sprite.new
@Background.bitmap=@BackgroundIMG
#Schwarzes Fenster rechts
@SupportWindow=Sprite.new
@SupportWindow.bitmap=@Insert_01
#Creditfelder
@Creditfield1=Sprite.new
@Creditfield1.x=470
@Creditfield1.y=54
@Creditfield2=Sprite.new
@Creditfield2.x=490
@Creditfield2.y=54
@Creditfield3=Sprite.new
@Creditfield3.x=510
@Creditfield3.y=54
@Creditfield4=Sprite.new
@Creditfield4.x=530
@Creditfield4.y=54
#Gewinnfelder
@Gewinnfield1=Sprite.new
@Gewinnfield1.x=558
@Gewinnfield1.y=54
@Gewinnfield2=Sprite.new
@Gewinnfield2.x=576
@Gewinnfield2.y=54
@Gewinnfield3=Sprite.new
@Gewinnfield3.x=594
@Gewinnfield3.y=54
@Gewinnfield4=Sprite.new
@Gewinnfield4.x=613
@Gewinnfield4.y=54
#Slots erstellen
if @content1!=nil
@Slot1=Slot.new(86,@content1[0],@content1[1],@content1[2])
else
@Slot1=Slot.new(86)
end
if @content2!=nil
@Slot2=Slot.new(192,@content2[0],@content2[1],@content2[2])
else
@Slot2=Slot.new(192)
end
if @content3!=nil
@Slot3=Slot.new(302,@content3[0],@content3[1],@content3[2])
else
@Slot3=Slot.new(302)
end
#Lampen erstellen
@Light=Sprite.new
#Transition
Graphics.transition
#Starte Main Loop
loop do
Graphics.update
Input.update
update
#Loopbreak bei Szenenwechsel
if $scene!=self
break
end
end
#Graphiken einfrieren, Objekte loschen
Graphics.freeze
@SupportWindow.dispose
@Background.dispose
@Creditfield1.dispose
@Creditfield2.dispose
@Creditfield3.dispose
@Creditfield4.dispose
@Gewinnfield1.dispose
@Gewinnfield2.dispose
@Gewinnfield3.dispose
@Gewinnfield4.dispose
@Slot1.dispose
@Slot2.dispose
@Slot3.dispose
@Light.dispose
end
#============================================================
#Mehr oder weniger alles be- und verarbeiten sowie auswerten
#============================================================
def update
@FrameCount=@FrameCount+1
if !(@GameActive)
@ausgewertet=false
end
#=====================================================================
#Bei Spielende (Win oder Lose) Support Window und Coins verarbeiten
#=====================================================================
if (@GameActive) &&!(@Slot3.active)
if !@ausgewertet
self.auswerten
end
if @Win
case @FrameCount
when 10
@SupportWindow.bitmap=@Win_01
when 20
@SupportWindow.bitmap=@Win_02
when 30
@SupportWindow.bitmap=@Win_03
when 40
@SupportWindow.bitmap=@Win_04
when 45
@FrameCount=0
end
if ((@FrameCount%5)==0)&&@Gewinn>0
@Gewinn=@Gewinn-1
$coins=$coins+1
end
if (@Gewinn==0)&&!(@Replay)
@GameActive=false
@FrameCount=0
@Line2_Active=false
@Line3_Active=false
@Light.bitmap=nil
end
if (@Gewinn==0)&&(@Replay)&&(@FrameCount==40)
@Slot1.active=true
@Slot2.active=true
@Slot3.active=true
@Replay=false
end
else
case @FrameCount
when 10
@SupportWindow.bitmap=@Lose_01
when 20
@SupportWindow.bitmap=@Lose_02
when 30
@SupportWindow.bitmap=@Lose_01
when 40
@SupportWindow.bitmap=@Lose_02
@FrameCount=0
@GameActive=false
@Line2_Active=false
@Line3_Active=false
@Light.bitmap=nil
end
end
end
#================================================
#Inputs Verarbeiten
#===============================================
@content1=[@Slot1.TopVal,@Slot1.MidVal,@Slot1.DownVal]
@content2=[@Slot2.TopVal,@Slot2.MidVal,@Slot2.DownVal]
@content3=[@Slot3.TopVal,@Slot3.MidVal,@Slot3.DownVal]
if (Input.trigger?(Input::C))&&(@GameActive)
if @Slot1.active
@Slot1.active=false
else
if @Slot2.active
@Slot2.active=false
else
if @Slot3.active
@Slot3.active=false
end# of if Slot3.active
end#of if @Slot2.active
end#of if @Slot1.active
end#of if (Input.trigger?(Input::C)&&(@GameActive)
if (Input.trigger?(Input::CTRL))&&!(@GameActive)
$scene=Scene_Slots_Help.new(@usedcoins,@content1,@content2,@content3)
end
if (Input.trigger?(Input::DOWN))&&!(@GameActive)&&$coins>0
@usedcoins=@usedcoins+1
$coins=$coins-1
if @usedcoins==1
@Light.bitmap=@Light_01
end
if @usedcoins==2
@Line2_Active=true
@Light.bitmap=@Light_02
end
if @usedcoins==3
@Light.bitmap=@Light_03
@Line3_Active=true
@GameActive=true
@Slot1.active=true
@Slot2.active=true
@Slot3.active=true
@FrameCount=0
end
end
if (Input.trigger?(Input::B))&&!(@GameActive)
$coins=$coins+@usedcoins
$scene=Scene_Map.new
end
if (Input.trigger?(Input::C))&&!(@GameActive)&&(@usedcoins>0)
@GameActive=true
@Slot1.active=true
@Slot2.active=true
@Slot3.active=true
@FrameCount=0
end
#=================================================
#@SupportWindow updaten
#=================================================
# Fall: Keine Munzen eingeworfen
if @usedcoins==0&&!(@GameActive)
if @FrameCount==30
@SupportWindow.bitmap=@Insert_02
end
if @FrameCount==60
@SupportWindow.bitmap=@Insert_01
@FrameCount=0
end
end
# Fall: Eine oder mehrere Munzen eingeworfen (und Spiel ist noch nicht aktiv)
if (@usedcoins > 0) && !(@GameActive)
case @FrameCount
when 30
@SupportWindow.bitmap=@Insert_03
when 60
@SupportWindow.bitmap=@Insert_06
@FrameCount=0
end
end
#Fall: Spiel lauft
if (@GameActive)&&(@Slot3.active)
case @FrameCount
when 8
@SupportWindow.bitmap=@Stop_01
when 16
@SupportWindow.bitmap=@Stop_02
when 24
@SupportWindow.bitmap=@Stop_03
when 32
@SupportWindow.bitmap=@Stop_04
when 40
@SupportWindow.bitmap=@Stop_05
when 48
@SupportWindow.bitmap=@Stop_06
@FrameCount=0
end
end
#==================================================
#Credit updaten
#==================================================
@Creditfield1.bitmap=@Credit_Numbers[$coins/1000]
@Creditfield2.bitmap=@Credit_Numbers[($coins%1000)/100]
@Creditfield3.bitmap=@Credit_Numbers[(($coins%1000)%100)/10]
@Creditfield4.bitmap=@Credit_Numbers[(($coins%1000)%100)%10]
#==========================================================
#Gewinn updaten
#==========================================================
@Gewinnfield1.bitmap=@Credit_Numbers[@Gewinn/1000]
@Gewinnfield2.bitmap=@Credit_Numbers[(@Gewinn%1000)/100]
@Gewinnfield3.bitmap=@Credit_Numbers[((@Gewinn%1000)%100)/10]
@Gewinnfield4.bitmap=@Credit_Numbers[((@Gewinn%1000)%100)%10]
#=================================================
#Slots laufen lassen
#=================================================
if @GameActive&&(@FrameCount%2)==0
if @Slot1.active
@Slot1.run
end#of if
if @Slot2.active
@Slot2.run
end#of if
if @Slot3.active
@Slot3.run
end#of if
end#of if @GameActive
end#of Method
#=================================
#Gewinn Uberprufen
#=================================
def auswerten
@ausgewertet=true
@FrameCount=0
@Gewinn=0
@Line1=[@Slot1.MidVal,@Slot2.MidVal,@Slot3.MidVal]
@Line2a=[@Slot1.TopVal,@Slot2.TopVal,@Slot3.TopVal]
@Line2b=[@Slot1.DownVal,@Slot2.DownVal,@Slot3.DownVal]
@Line3a=[@Slot1.TopVal,@Slot2.MidVal,@Slot3.DownVal]
@Line3b=[@Slot1.DownVal,@Slot2.MidVal,@Slot3.TopVal]
@usedcoins=0
#Gewinn auf Line 1 uberprufen
@Replay=false
case @Line1
when @RedSevenWin
@Gewinn=@Gewinn+300
when @BlueSevenWin
@Gewinn=@Gewinn+300
when @SmallRedBonus
@Gewinn=@Gewinn+90
when @SmallBlueBonus
@Gewinn=@Gewinn+90
when @BigAppleWin
@Gewinn=@Gewinn+4
when @BlueWin
@Gewinn=@Gewinn+12
when @GreenWin
@Gewinn=@Gewinn+6
when @ReplayWin
@Replay=true
else
if @AppleWin==[@Line1[0],@Line1[1]]
@Gewinn=@Gewinn+2
end
end
#Gewinn auf Line 2 uberprufen
if @Line2_Active
case @Line2a
when @RedSevenWin
@Gewinn=@Gewinn+300
when @BlueSevenWin
@Gewinn=@Gewinn+300
when @SmallRedBonus
@Gewinn=@Gewinn+90
when @SmallBlueBonus
@Gewinn=@Gewinn+90
when @BigAppleWin
@Gewinn=@Gewinn+4
when @BlueWin
@Gewinn=@Gewinn+12
when @GreenWin
@Gewinn=@Gewinn+6
when @ReplayWin
@Replay=true
else
if @AppleWin==[@Line2a[0],@Line2a[1]]
@Gewinn=@Gewinn+2
end
end
case @Line2b
when @RedSevenWin
@Gewinn=@Gewinn+300
when @BlueSevenWin
@Gewinn=@Gewinn+300
when @SmallRedBonus
@Gewinn=@Gewinn+90
when @SmallBlueBonus
@Gewinn=@Gewinn+90
when @BigAppleWin
@Gewinn=@Gewinn+4
when @BlueWin
@Gewinn=@Gewinn+12
when @GreenWin
@Gewinn=@Gewinn+6
when @ReplayWin
@Replay=true
else
if @AppleWin==[@Line2b[0],@Line2b[1]]
@Gewinn=@Gewinn+2
end
end
end
#Gewinn auf Line 3 uberprufen
if @Line3_Active
case @Line3a
when @RedSevenWin
@Gewinn=@Gewinn+300
when @BlueSevenWin
@Gewinn=@Gewinn+300
when @SmallRedBonus
@Gewinn=@Gewinn+90
when @SmallBlueBonus
@Gewinn=@Gewinn+90
when @BigAppleWin
@Gewinn=@Gewinn+4
when @BlueWin
@Gewinn=@Gewinn+12
when @GreenWin
@Gewinn=@Gewinn+6
when @ReplayWin
@Replay=true
else
if @AppleWin==[@Line3a[0],@Line3a[1]]
@Gewinn=@Gewinn+2
end
end
case @Line3b
when @RedSevenWin
@Gewinn=@Gewinn+300
when @BlueSevenWin
@Gewinn=@Gewinn+300
when @SmallRedBonus
@Gewinn=@Gewinn+90
when @SmallBlueBonus
@Gewinn=@Gewinn+90
when @BigAppleWin
@Gewinn=@Gewinn+4
when @BlueWin
@Gewinn=@Gewinn+12
when @GreenWin
@Gewinn=@Gewinn+6
when @ReplayWin
@Replay=true
else
if @AppleWin==[@Line3b[0],@Line3b[1]]
@Gewinn=@Gewinn+2
end
end
end
@Win= (@Gewinn>0)||(@Replay)
end
end
class Scene_Slots_Help
def initialize(usedcoins,content1,content2,content3)
#Parameter an Variablen ubergeben (zwecks zuruckgehen zu Scene_Slots)
@usedcoins=usedcoins
@content1=content1
@content2=content2
@content3=content3
#Credit_Number Pfade festlegen
@Credit0=RPG::Cache.picture("Credit_Number_00")
@Credit1=RPG::Cache.picture("Credit_Number_01")
@Credit2=RPG::Cache.picture("Credit_Number_02")
@Credit3=RPG::Cache.picture("Credit_Number_03")
@Credit4=RPG::Cache.picture("Credit_Number_04")
@Credit5=RPG::Cache.picture("Credit_Number_05")
@Credit6=RPG::Cache.picture("Credit_Number_06")
@Credit7=RPG::Cache.picture("Credit_Number_07")
@Credit8=RPG::Cache.picture("Credit_Number_08")
@Credit9=RPG::Cache.picture("Credit_Number_09")
@Credit_Numbers=[@Credit0,@Credit1,@Credit2,@Credit3,@Credit4,@Credit5,@Credit6,
@Credit7,@Credit8,@Credit9]
end
def main
#Hintergrundbild erstellen
@Background=Sprite.new
@Background.bitmap=RPG::Cache.picture("Cornerslots_help.png")
#Creditfelder erstellen
@Creditfield1=Sprite.new
@Creditfield1.x=470
@Creditfield1.y=54
@Creditfield2=Sprite.new
@Creditfield2.x=490
@Creditfield2.y=54
@Creditfield3=Sprite.new
@Creditfield3.x=510
@Creditfield3.y=54
@Creditfield4=Sprite.new
@Creditfield4.x=530
@Creditfield4.y=54
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene!=self
break
end
end
Graphics.freeze
@Background.dispose
@Creditfield1.dispose
@Creditfield2.dispose
@Creditfield3.dispose
@Creditfield4.dispose
end
def update
if Input.trigger?(Input::CTRL)
$scene=Scene_Slots.new(@usedcoins,@content1,@content2,@content3)
end
if Input.trigger?(Input::B)
#Spiel beenden, bereits eingeworfene aber nicht benutzte Coins zuruckgeben
$coins=$coins+@usedcoins
$scene=Scene_Map.new
end
#Creditfelder updaten
@Creditfield1.bitmap=@Credit_Numbers[$coins/1000]
@Creditfield2.bitmap=@Credit_Numbers[($coins%1000)/100]
@Creditfield3.bitmap=@Credit_Numbers[(($coins%1000)%100)/10]
@Creditfield4.bitmap=@Credit_Numbers[(($coins%1000)%100)%10]
#Gewinnfelder updaten
end
end
class Slot
attr_accessor :TopVal
attr_accessor :MidVal
attr_accessor :DownVal
attr_accessor :active
def initialize(x, topValue=nil,midValue=nil, downValue=nil)
#Bildpfade
@Apple_Down=RPG::Cache.picture("Slot_Apple_Down")
@Apple_Middle=RPG::Cache.picture("Slot_Apple_Middle")
@Apple_Top=RPG::Cache.picture("Slot_Apple_Top")
@Blue_Down=RPG::Cache.picture("Slot_Blue_Down")
@Blue_Middle=RPG::Cache.picture("Slot_Blue_Middle")
@Blue_Top=RPG::Cache.picture("Slot_Blue_Top")
@BlueSeven_Top=RPG::Cache.picture("Slot_BlueSeven_Top")
@BlueSeven_Middle=RPG::Cache.picture("Slot_BlueSeven_Middle")
@BlueSeven_Down=RPG::Cache.picture("Slot_BlueSeven_Down")
@Green_Down=RPG::Cache.picture("Slot_Green_Down")
@Green_Middle=RPG::Cache.picture("Slot_Green_Middle")
@Green_Top=RPG::Cache.picture("Slot_Green_Top")
@RedSeven_Down=RPG::Cache.picture("Slot_RedSeven_Down")
@RedSeven_Middle=RPG::Cache.picture("Slot_RedSeven_Middle")
@RedSeven_Top=RPG::Cache.picture("Slot_RedSeven_Top")
@Replay_Down=RPG::Cache.picture("Slot_Replay_Down")
@Replay_Middle=RPG::Cache.picture("Slot_Replay_Middle")
@Replay_Top=RPG::Cache.picture("Slot_Replay_Top")
#Y Koordinaten der Bilder
@y1=124
@y2=194
@y3=268
#Bild Positionen
@Top=Sprite.new
@Top.x=x
@Top.y=@y1
@Middle=Sprite.new
@Middle.x=x
@Middle.y=@y2
@Down=Sprite.new
@Down.x=x
@Down.y=@y3
#SlotInhalt festlegen (1= Rote 7, 2= Blaue 7,
#3= Replay, 4= Blaues Dingens, 5= Grunes Dingens, 6= Pokeballe)
@SlotInhalt=[1,6,6,4,3,4,5,2,5,6,4,5,3,5,6]
#Wenn Werte fur die Slots per Parameter ubergeben wurde, diese benutzen
#Ansonsten, zufallig festlegen
if topValue!=nil
self.TopVal=topValue
self.MidVal=midValue
self.DownVal=downValue
else
self.setValues
end
#Aktiv auf false setzen
self.active=false
#Graphiken darstellen
@i=0
@j=1
@k=2
update
end
def setValues
@RndNr=rand(@SlotInhalt.size)
self.TopVal=@SlotInhalt[@RndNr]
if @RndNr==(@SlotInhalt.size-1)
@RndNr=0
else
@RndNr=@RndNr+1
end
self.MidVal=@SlotInhalt[@RndNr]
if @RndNr==(@SlotInhalt.size-1)
@RndNr=0
else
@RndNr=@RndNr+1
end
self.DownVal=@SlotInhalt[@RndNr]
end
def update
case self.TopVal
when 1
@Top.bitmap=@RedSeven_Top
when 2
@Top.bitmap=@BlueSeven_Top
when 3
@Top.bitmap=@Replay_Top
when 4
@Top.bitmap=@Blue_Top
when 5
@Top.bitmap=@Green_Top
when 6
@Top.bitmap=@Apple_Top
end
case self.MidVal
when 1
@Middle.bitmap=@RedSeven_Middle
when 2
@Middle.bitmap=@BlueSeven_Middle
when 3
@Middle.bitmap=@Replay_Middle
when 4
@Middle.bitmap=@Blue_Middle
when 5
@Middle.bitmap=@Green_Middle
when 6
@Middle.bitmap=@Apple_Middle
end
case self.DownVal
when 1
@Down.bitmap=@RedSeven_Down
when 2
@Down.bitmap=@BlueSeven_Down
when 3
@Down.bitmap=@Replay_Down
when 4
@Down.bitmap=@Blue_Down
when 5
@Down.bitmap=@Green_Down
when 6
@Down.bitmap=@Apple_Down
end
end
def run
self.TopVal=@SlotInhalt[@i]
self.MidVal=@SlotInhalt[@j]
self.DownVal=@SlotInhalt[@k]
@i=@i+1
@j=@j+1
@k=@k+1
if @
[email protected]
@i=0
end
if @
[email protected]
@j=0
end
if @
[email protected]
@k=0
end
update
end
def dispose
@Top.dispose
@Middle.dispose
@Down.dispose
end
end
复制代码
想请教高手 该如何修改可以让VX可以运用......我脚本完全不懂@@ 不知道错在哪
范例 在附件
[attach]64183[/attach]
[attach]64184[/attach]
[attach]64185[/attach]
[attach]64187[/attach]
[attach]64189[/attach] dsu_plus_rewardpost_czw
作者:
秋庭里香
时间:
2011-7-15 12:13
http://rpg.blue/home.php?mod=spa ... rward=1&id=8846
主要是要把RPG::Cache改为Cache,以及640*480的排版改为VX的排版。
作者:
忧雪の伤
时间:
2011-7-15 18:04
本帖最后由 忧雪の伤 于 2011-7-15 18:04 编辑
RPG::Cache = Cache
复制代码
开头加多这段= =。
排版不负责。
作者:
2855595
时间:
2011-7-16 02:27
感谢两位高手出手 药到命除.....
困扰了几天的烦恼 没想到高手一个方向就克服了.....
2855595于2011-7-16 02:27补充以下内容:
感谢两位高手出手 药到命除.....
困扰了几天的烦恼 没想到高手一个方向就克服了.....
2855595于2011-7-16 02:27补充以下内容:
感谢两位高手出手 药到命除.....
困扰了几天的烦恼 没想到高手一个方向就克服了.....
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1