|
| Script Ga Boleh Jual | |
|
+3wltr3565 mbahnoname Notorius 7 posters | Pengirim | Message |
---|
Notorius Veteran
Posts : 1408 Thanked : 0 Engine : RMVX Skill : Intermediate Type : Event Designer
| Subyek: Script Ga Boleh Jual 2009-09-04, 20:43 | |
| NO SELL SHOP Versi: 2 Tipe: SHOP SYSTEM atau apalah PengenalanNotorius pergi ke warung terus ngejual permen ke Tokonya. Emg Notorius apaan?! Broker permen loli?Karena kepikiran aja... Fitur
- Membuat player tidak bisa menjual apa-apa
- Dapet Ide: Script ini bisa di-aktif dan di-nonaktif dgn switch...
ScreenshotsEmm pas pake langsung nyala, jadi dicoba aja tapi boleh lah before: - Spoiler:
after: - Spoiler:
DemoSkrip Notorius selalu simpel Scripts - Code:
-
module N_SHOP SWITCH = 5 #switch id untuk mengaktifkan No Sell Shop BELI = "Beli" # Tulisan untuk Beli JUAL = "Jual"# Tulisan untuk Jual BALIK = "Bakekok" # Tulisan untuk Kembali end
#============================================================================== # Notorius No Sell Shop #------------------------------------------------------------------------------ # Script ini membuat player tidak bisa menzual apa2 di Shop ini #==============================================================================
class Scene_Shop include N_SHOP #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make help window @help_window = Window_Help.new # Make command window @command_window = Window_ShopCommand.new # Make gold window @gold_window = Window_Gold.new @gold_window.x = 480 @gold_window.y = 64 # Make dummy window @dummy_window = Window_Base.new(0, 128, 640, 352) # Make buy window @buy_window = Window_ShopBuy.new($game_temp.shop_goods) @buy_window.active = false @buy_window.visible = false @buy_window.help_window = @help_window # Make sell window unless switch is onn @sell_window = Window_ShopSell.new unless $game_switches[SWITCH] @sell_window.active = false unless $game_switches[SWITCH] @sell_window.visible = false unless $game_switches[SWITCH] @sell_window.help_window = @help_window unless $game_switches[SWITCH] # Make quantity input window @number_window = Window_ShopNumber.new @number_window.active = false @number_window.visible = false # Make status window @status_window = Window_ShopStatus.new @status_window.visible = false # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of windows @help_window.dispose @command_window.dispose @sell_window.dispose unless $game_switches[SWITCH] @gold_window.dispose @dummy_window.dispose @buy_window.dispose @number_window.dispose @status_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @help_window.update @command_window.update @gold_window.update @dummy_window.update @buy_window.update @sell_window.update unless $game_switches[SWITCH] @number_window.update @status_window.update # If command window is active: call update_command if @command_window.active update_command return end # If buy window is active: call update_buy if @buy_window.active update_buy return end # If sell window is active and Switch is off: call update_sell if @sell_window.active and $game_switches[SWITCH] == false update_sell return end # If quantity input window is active: call update_number if @number_window.active update_number return end end #-------------------------------------------------------------------------- # * Frame Update (when command window is active) #-------------------------------------------------------------------------- def update_command # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to map screen $scene = Scene_Map.new return end # If C button was pressed if Input.trigger?(Input::C) and $game_switches[SWITCH] == false # Branch by command window cursor position case @command_window.index when 0 # buy # Play decision SE $game_system.se_play($data_system.decision_se) # Change windows to buy mode @command_window.active = false @dummy_window.visible = false @buy_window.active = true @buy_window.visible = true @buy_window.refresh @status_window.visible = true when 1 # sell # Play decision SE $game_system.se_play($data_system.decision_se) # Change windows to sell mode @command_window.active = false @dummy_window.visible = false @sell_window.active = true @sell_window.visible = true @sell_window.refresh when 2 # quit # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to map screen $scene = Scene_Map.new end return end # If C button was pressed & Switch == on if Input.trigger?(Input::C) and $game_switches[SWITCH] == true # Branch by command window cursor position case @command_window.index when 0 # buy # Play decision SE $game_system.se_play($data_system.decision_se) # Change windows to buy mode @command_window.active = false @dummy_window.visible = false @buy_window.active = true @buy_window.visible = true @buy_window.refresh @status_window.visible = true when 1 # quit # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to map screen $scene = Scene_Map.new end return end end #-------------------------------------------------------------------------- # * Frame Update (when buy window is active) #-------------------------------------------------------------------------- def update_buy # Set status window item @status_window.item = @buy_window.item # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Change windows to initial mode @command_window.active = true @dummy_window.visible = true @buy_window.active = false @buy_window.visible = false @status_window.visible = false @status_window.item = nil # Erase help text @help_window.set_text("") return end # If C button was pressed if Input.trigger?(Input::C) # Get item @item = @buy_window.item # If item is invalid, or price is higher than money possessed if @item == nil or @item.price > $game_party.gold # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Get items in possession count case @item when RPG::Item number = $game_party.item_number(@item.id) when RPG::Weapon number = $game_party.weapon_number(@item.id) when RPG::Armor number = $game_party.armor_number(@item.id) end # If 99 items are already in possession if number == 99 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Calculate maximum amount possible to buy max = @item.price == 0 ? 99 : $game_party.gold / @item.price max = [max, 99 - number].min # Change windows to quantity input mode @buy_window.active = false @buy_window.visible = false @number_window.set(@item, max, @item.price) @number_window.active = true @number_window.visible = true end end #-------------------------------------------------------------------------- # * Frame Update (when sell window is active) #-------------------------------------------------------------------------- def update_sell # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Change windows to initial mode @command_window.active = true @dummy_window.visible = true @sell_window.active = false @sell_window.visible = false @status_window.item = nil # Erase help text @help_window.set_text("") return end # If C button was pressed if Input.trigger?(Input::C) # Get item @item = @sell_window.item # Set status window item @status_window.item = @item # If item is invalid, or item price is 0 (unable to sell) if @item == nil or @item.price == 0 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Get items in possession count case @item when RPG::Item number = $game_party.item_number(@item.id) when RPG::Weapon number = $game_party.weapon_number(@item.id) when RPG::Armor number = $game_party.armor_number(@item.id) end # Maximum quanitity to sell = number of items in possession max = number # Change windows to quantity input mode @sell_window.active = false @sell_window.visible = false @number_window.set(@item, max, @item.price / 2) @number_window.active = true @number_window.visible = true @status_window.visible = true end end #-------------------------------------------------------------------------- # * Frame Update (when quantity input window is active) #-------------------------------------------------------------------------- def update_number # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Set quantity input window to inactive / invisible @number_window.active = false @number_window.visible = false # Branch by command window cursor position case @command_window.index when 0 # buy # Change windows to buy mode @buy_window.active = true @buy_window.visible = true when 1 # sell # Change windows to sell mode @sell_window.active = true @sell_window.visible = true @status_window.visible = false end return end # If C button was pressed if Input.trigger?(Input::C) # Play shop SE $game_system.se_play($data_system.shop_se) # Set quantity input window to inactive / invisible @number_window.active = false @number_window.visible = false # Branch by command window cursor position case @command_window.index when 0 # buy # Buy process $game_party.lose_gold(@number_window.number * @item.price) case @item when RPG::Item $game_party.gain_item(@item.id, @number_window.number) when RPG::Weapon $game_party.gain_weapon(@item.id, @number_window.number) when RPG::Armor $game_party.gain_armor(@item.id, @number_window.number) end # Refresh each window @gold_window.refresh @buy_window.refresh @status_window.refresh # Change windows to buy mode @buy_window.active = true @buy_window.visible = true when 1 # sell # Sell process $game_party.gain_gold(@number_window.number * (@item.price / 2)) case @item when RPG::Item $game_party.lose_item(@item.id, @number_window.number) when RPG::Weapon $game_party.lose_weapon(@item.id, @number_window.number) when RPG::Armor $game_party.lose_armor(@item.id, @number_window.number) end # Refresh each window @gold_window.refresh @sell_window.refresh @status_window.refresh # Change windows to sell mode @sell_window.active = true @sell_window.visible = true @status_window.visible = false end return end end end
class Window_ShopCommand < Window_Selectable include N_SHOP def initialize super(0, 64, 480, 64) self.contents = Bitmap.new(width - 32, height - 32) @item_max = 3 unless $game_switches[SWITCH] @item_max = 2 if $game_switches[SWITCH] @column_max = 3 @commands = [BELI, BALIK] if $game_switches[SWITCH] @commands = [BELI, JUAL, BALIK] unless $game_switches[SWITCH] refresh self.index = 0 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # * Draw Item # index : item number #-------------------------------------------------------------------------- def draw_item(index) x = 8 + index * 160 self.contents.draw_text(x, 0, 256, 32, @commands[index]) if $game_switches[SWITCH] self.contents.draw_text(x, 0, 128, 32, @commands[index]) unless $game_switches[SWITCH] end end Credits
- Enterbrain (Modifikasi Scene_Shop dan WIndow_ShopCommand)
- Notorius
Terakhir diubah oleh Notorius tanggal 2009-09-06, 13:16, total 1 kali diubah | |
| | | mbahnoname Senior
Posts : 670 Thanked : 0 Engine : RMVX Skill : Very Beginner Type : Mapper
Trophies
Awards:
| | | | Notorius Veteran
Posts : 1408 Thanked : 0 Engine : RMVX Skill : Intermediate Type : Event Designer
| Subyek: Re: Script Ga Boleh Jual 2009-09-05, 10:01 | |
| Tepat sekali Silahkan membuat player miskin | |
| | | mbahnoname Senior
Posts : 670 Thanked : 0 Engine : RMVX Skill : Very Beginner Type : Mapper
Trophies
Awards:
| Subyek: Re: Script Ga Boleh Jual 2009-09-05, 10:24 | |
| | |
| | | Notorius Veteran
Posts : 1408 Thanked : 0 Engine : RMVX Skill : Intermediate Type : Event Designer
| Subyek: Re: Script Ga Boleh Jual 2009-09-05, 10:46 | |
| OH asiiik!!! heheehehe yahoo google lah ! Soalnya ak bikin barang keramat utk player, eh takutnya ntar dijual wkwkwk jadi kubuat aja gini, lagian rada aneh kalo ngejual sesuatu ke warung | |
| | | wltr3565 Senior
Posts : 870 Thanked : 28 Engine : RMVX Skill : Skilled Type : Scripter
Trophies
Awards:
| Subyek: Re: Script Ga Boleh Jual 2009-09-06, 00:59 | |
| @Notorius: Bukannya bisa dicegah dengan nge nol-in harga barangnya? Masalahnya banyak banget overridnya. Kasian untuk pengguna custom shop system . kagak ada alias ya? Lagipula, hanya ini yang dirubah: - Code:
-
def update_command # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to map screen $scene = Scene_Map.new return end # If C button was pressed if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 0 # buy # Play decision SE $game_system.se_play($data_system.decision_se) # Change windows to buy mode @command_window.active = false @dummy_window.visible = false @buy_window.active = true @buy_window.visible = true @buy_window.refresh @status_window.visible = true when 1 # quit # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to map screen $scene = Scene_Map.new end return end end
Lalu window seleksi jual-beli-quit nya kagak diubah? Yah, walaupun gitu sih, good job | |
| | | Randomasta Senior
Posts : 661 Thanked : 6 Engine : RMVX
| Subyek: Re: Script Ga Boleh Jual 2009-09-06, 01:26 | |
| Kalo dinolin harganya, nanti ga cuma ga bisa jual barang... tapi juga ga bisa beli!!! @_@ gemnya jadi kaya apa nanti kira2? | |
| | | wltr3565 Senior
Posts : 870 Thanked : 28 Engine : RMVX Skill : Skilled Type : Scripter
Trophies
Awards:
| Subyek: Re: Script Ga Boleh Jual 2009-09-06, 01:32 | |
| - _|^656 wrote:
- Kalo dinolin harganya, nanti ga cuma ga bisa jual barang... tapi juga ga bisa beli!!! @_@ gemnya jadi kaya apa nanti kira2?
Ya juga sih, tapi kan kalo itu key item. Lagipula, ini script bisa ada switchnya untuk buat beberapa toko bisa ngebiarin ngejual item gak? | |
| | | Notorius Veteran
Posts : 1408 Thanked : 0 Engine : RMVX Skill : Intermediate Type : Event Designer
| Subyek: Re: Script Ga Boleh Jual 2009-09-06, 12:34 | |
| - wltr3565 wrote:
- _|^656 wrote:
- Kalo dinolin harganya, nanti ga cuma ga bisa jual barang... tapi juga ga bisa beli!!! @_@ gemnya jadi kaya apa nanti kira2?
Ya juga sih, tapi kan kalo itu key item. Lagipula, ini script bisa ada switchnya untuk buat beberapa toko bisa ngebiarin ngejual item gak? Oh di-Switch gtu? Bisa, saya* usahain. Tapi ntar, kalo di kmptr yg ada RM-nya... | |
| | | M4nz Advance
Posts : 309 Thanked : 6 Engine : RMXP Skill : Intermediate Type : Artist
Trophies
Awards:
| Subyek: Re: Script Ga Boleh Jual 2009-09-06, 14:32 | |
| wah script gak boleh jual ya? tp bagus koq... klo pas herony nyampe ke kota miskin, terus gak nerima jual... klo nggak pas nyampe kota pelit... jdi klo jual barang tuh susahny minta ampun... | |
| | | Notorius Veteran
Posts : 1408 Thanked : 0 Engine : RMVX Skill : Intermediate Type : Event Designer
| Subyek: Re: Script Ga Boleh Jual 2009-09-06, 15:26 | |
| Wakakak, silahkan dipakai, dibuang, dibakar, diduruk, dll... | |
| | | Gary PoL Newbie
Posts : 81 Thanked : 2 Engine : RMVX Skill : Very Beginner Type : Jack of All Trades
Trophies
Awards: | Subyek: Re: Script Ga Boleh Jual 2010-05-02, 21:53 | |
| bukan-nya itu bisa di buat tanpa script...? Tapi Nggak Papa Klo Orang Yg Nggak Ngerti Buat Eventnya Kan Bisa Pake Scriptnya... Bisa Aotu No Sale...!!!
^.^ | |
| | | Vsio Xutix Xox
Posts : 2377 Thanked : 18 Engine : Multi-Engine User Skill : Advanced Type : Developer
| Subyek: Re: Script Ga Boleh Jual 2010-05-02, 22:05 | |
| X @eashule: Maaf ya, tp thread berumur lebih dari 3 bulan dan sudah tidak aktif lagi, tidak boleh lagi direply. - Quote :
Necropost Forum ini tidak memperbolehkan RMer untuk melakukan Necropost. Apa itu necropost? Necropost adalah kegiatan membangkitkan thread yang sudah lama tidak aktif. Thread berumur lebih dari 3 bulan dan sudah tidak aktif akan kami anggap necropost. Silahkan PM sang pemilik thread jika anda hanya sekadar memberikan pujian, kritikan atau bug reporting
Agar tidak terjadi kesalahan yang sama, baca dulu peraturannya ya https://rmid.forumotion.net/boardrules-h1.htmKarena masih newbie, untuk kali ini dimaafkan . Tp, jika terjadi lagi, mungkin akan ditindaklanjuti. X | |
| | | Sponsored content
| Subyek: Re: Script Ga Boleh Jual | |
| |
| | | | Script Ga Boleh Jual | |
|
Similar topics | |
|
| Permissions in this forum: | Anda tidak dapat menjawab topik
| |
| |
| Latest topics | » [Web Novel] Gloria Infidelis by LightNightKnight 2016-11-17, 21:27
» [Announcement] Forum baru untuk RMID by TheoAllen 2016-08-25, 16:39
» Where I'm Wrong ? by ReydVires 2016-07-24, 16:10
» flakeheartnet's Resources part III by flakeheartnet 2016-07-08, 14:30
» Keira's Art Warehouse by KeiraBlaze 2016-06-28, 19:27
» Theo Core Time System + Bingung by Lockin 2016-06-27, 16:24
» Error Script, Maybe ? by Lockin 2016-06-27, 16:20
» Nusaimoe @ RMID Lounge by Jihad Bagas 2016-06-21, 05:02
» Call Random Battle by Lockin 2016-06-15, 17:04
» Flakeheartnet Resources Part II [come back gift] by flakeheartnet 2016-06-07, 15:51
|
Statistics
|
Members: [ 4947 ]
Topics: [ 8258 ]
Posts: [ 112606 ]
Newest member: [ https://rmid.forumotion.net/u4968 ]
|
|
|
|