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.
|
|
| 2010-02-21, 17:08 | Variable Gauges v1.1 |
---|
wltr3565 Senior
Posts : 870 Thanked : 28 Engine : RMVX Skill : Skilled Type : Scripter
Awards:
| Variable Gauges Versi: 1.1 Tipe: Eventer Tools PengenalanOne of my "assignments" as my team's scripter. He needs a script for showing variables. So I made this one. Fitur- Very high control in mid-game. - Easy to use, maybe. - Animative gauge HUD. - Can be more than one, in a bulking way! Screenshots DemoLazy. You can do it yourself, right? Scripts- Spoiler:
- Code:
-
=begin ================================================================================ Variable Gauges v1.1 by wltr3565 ================================================================================ One of my "assignments" as my team's scripter. He needs a script for showing variables. So I made this one. ================================================================================ Features: - Very high control in mid-game. - Easy to use, maybe. - Animative gauge HUD. - Can be more than one, in a bulking way! ================================================================================ How it will work: The gauge you called will adapt with the assigned variable. ================================================================================ How to Use:
First, to make the gauge to pop out, enter this in the script command: $game_system.make_new_gauge(id, color, max, x, y, width, height) The id represents the variable's id. Color represents the color of the gauge in this format: Color.new(red, green, blue) The red, green, and blue are the usement for the colors.
Max represents the maximum value for the gauge to be full. x represents the gauge's x position. y represents the gauge's y position. width represents the gauge's width. height represents the gauge's tall.
You can alter the gauge's property by entering this in the script command: $game_system.gauge_list[id].property = new_value The id is the variable id of the gauge. Property is the gauge's property like color, max, x, y, width, and height. They can change in real time. The new value is the new value of the assigned property. Example: $game_system.gauge_list[8].height = 416 The code above will make the existing gauge for variable 8 to fill the entire screen vertically.
To make the gauge to disappear, enter this: $game_system.gauge_list[id].gauge_dispose That will get rid of gauge for variable with id. Example: $game_system.gauge_list[8].gauge_dispose That will get rid of gauge for variable id 8. ================================================================================ Install: Insert this above main. ================================================================================ Terms of Use: Credit me, wltr3565, or not is up to you. Just don't claim that this is made by you, and crediting me will be nice. ================================================================================ Thanks: Kuro Creator: My boss. ================================================================================ =end #=============================================================================== # COMMENCING COMPATIBILITY FLAG #=============================================================================== $imported = {} if $imported == nil $imported["wltr3565's_Variable_Gauges"] = true #=============================================================================== # END COMPATIBILITY FLAG #=============================================================================== module WLTR module VARIABLE_GAUGES #=============================================================================== # Configure the gauge's increasing and decreasing speed here. The bigger the # value, the faster it will change per frame. ALTER_SPEED = 3 end end
#=============================================================================== # Touching below will be dangerous without proper skill of scripting. Therefor, # edit and read at your own risk. #===============================================================================
class Game_System attr_accessor :gauge_list alias gauges_initialize initialize def initialize gauges_initialize @gauge_list = [] $gauges = [] end def make_new_gauge(id, color, max, x, y, width, height) @gauge_list[id] = Game_Variable_List.new(id, color, max, x, y, width, height) end end
class Scene_Map < Scene_Base alias gauge_repop start def start gauge_repop for i in $game_system.gauge_list next if i == nil i.refresh(i.id, i.color, i.max, i.x, i.y, i.width, i.height) end end alias update_gauges_hud update def update update_gauges_hud for i in $game_system.gauge_list next if i == nil i.update end end alias reupdate_gauges update_transfer_player def update_transfer_player return unless $game_player.transfer? reupdate_gauges for i in $game_system.gauge_list next if i == nil i.refresh(i.id, i.color, i.max, i.x, i.y, i.width, i.height) end end end
class Game_Variable_List def initialize(id, color, max, x, y, width, height) refresh(id, color, max, x, y, width, height) end def id return @id end def id=(value) @id = value refresh(@id, @color, @max, @x, @y, @width, @height) end def color return @color end def color=(value) @color = value refresh(@id, @color, @max, @x, @y, @width, @height) end def x return @x end def x=(value) @x = value refresh(@id, @color, @max, @x, @y, @width, @height) end def y return @y end def y=(value) @y = value refresh(@id, @color, @max, @x, @y, @width, @height) end def max return @max end def max=(value) @max = value refresh(@id, @color, @max, @x, @y, @width, @height) end def width return @width end def width=(value) @width = value refresh(@id, @color, @max, @x, @y, @width, @height) end def height return @height end def height=(value) @height = value refresh(@id, @color, @max, @x, @y, @width, @height) end def refresh(id, color, max, x, y, width, height) @id = id @color = color @max = max @y = y @x = x @width = width @height = height $gauges[@id] = Sprite_Variable.new(@id, @color, @max, @x, @y, @width, @height) end def update return if $gauges == nil $gauges[@id].update end def dispose_gauge $gauges[@id].dispose end end
class Sprite_Variable < Sprite def initialize(id, color, max, x, y, width, height) super(Viewport.new(0, 0, 544, 416)) refresh(id, color, max, x, y, width, height) end def id return @id end def id=(value) @id = value refresh(@id, @color, @max, @x, @y, @width, @height) end def color return @color end def color=(value) @color = value refresh(@id, @color, @max, @x, @y, @width, @height) end def x return @x end def x=(value) @x = value refresh(@id, @color, @max, @x, @y, @width, @height) end def y return @y end def y=(value) @y = value refresh(@id, @color, @max, @x, @y, @width, @height) end def max return @max end def max=(value) @max = value refresh(@id, @color, @max, @x, @y, @width, @height) end def width return @width end def width=(value) @width = value refresh(@id, @color, @max, @x, @y, @width, @height) end def height return @height end def height=(value) @height = value refresh(@id, @color, @max, @x, @y, @width, @height) end def refresh(id, color, max, x, y, width, height) @gauge_skin.dispose if @gauge_skin != nil @gauge.dispose if @gauge != nil @id = id @color = color @max = max @y = y @x = x @width = width @height = height @gauge_skin = Sprite.new(Viewport.new(0, 0, 544, 416)) @gauge_skin.bitmap = Bitmap.new(@width, @height) @gauge_skin.bitmap.fill_rect(Rect.new(0, 0, @width, @height), Color.new(0,0,0)) @gauge_skin.x = @x @gauge_skin.y = @y @gauge_skin.z = 1000 @gauge = Sprite.new(Viewport.new(0, 0, 544, 416)) @gauge.bitmap = Bitmap.new(@width, @height) @gauge.bitmap.fill_rect(Rect.new(0, 0, @width, @height), @color) gauge_width = @gauge.bitmap.width * $game_variables[@id] / @max gauge_width.round @gauge.src_rect.width = gauge_width @gauge.x = @x @gauge.y = @y @gauge.z = 1001 update end
def dispose @gauge_skin.dispose @gauge.dispose super end
def update gauge_width = @gauge.bitmap.width * $game_variables[@id] / @max gauge_width.round return if @gauge.disposed? if @gauge.width < gauge_width boost = WLTR::VARIABLE_GAUGES::ALTER_SPEED @gauge.src_rect.width += boost @gauge.src_rect.width = gauge_width.round if @gauge.src_rect.width > gauge_width elsif @gauge.width > gauge_width boost = WLTR::VARIABLE_GAUGES::ALTER_SPEED @gauge.src_rect.width -= boost @gauge.src_rect.width = gauge_width.round if @gauge.src_rect.width < gauge_width end end end #=============================================================================== # # END OF SCRIPT # #===============================================================================
Terms of UseCredit me, wltr3565, or not is up to you. Just don't claim that this is made by you, and crediting me will be nice. Thanks Author's NoteSori kalo inggris. Males sih |
| | | 2010-02-21, 17:19 | Re: Variable Gauges v1.1 |
---|
Tamu Tamu
| bisa pk neo gauge gag nih ? |
| | | 2010-02-21, 17:33 | Re: Variable Gauges v1.1 |
---|
wltr3565 Senior
Posts : 870 Thanked : 28 Engine : RMVX Skill : Skilled Type : Scripter
Awards:
| @^: Gak. Perlu modif lebih kalo mau. |
| | | 2010-02-21, 17:35 | Re: Variable Gauges v1.1 |
---|
Tamu Tamu
| @wltr ga perlu sih , selama bisa di atifkan dan di nonaktifkan on the fly itu ga jadi masalah |
| | | 2010-02-21, 18:30 | Re: Variable Gauges v1.1 |
---|
Kuro Ethernite The Creator
Posts : 1631 Thanked : 24 Engine : RMVX Ace Skill : Masterful Type : Jack of All Trades
Awards:
| Awww...... Akhirnya d publikasikan...... - Gni.... Kalo d project MiniGames Pack, wktu q pake, bisa sih.... Cuman waktu d dispose langsung sript error gtu.... - Gni.... Kan gauge ny kalau berkurang dari kanan k kiri, bisa ga, d biqin supaya kta bisa mngntrol dri arah mana gauge ny berkurang? seperti dari kiri k kanan, atas k bawah, dll, dll..... Yow! THX !!! |
| | | 2010-07-17, 21:52 | Re: Variable Gauges v1.1 |
---|
Kuro Ethernite The Creator
Posts : 1631 Thanked : 24 Engine : RMVX Ace Skill : Masterful Type : Jack of All Trades
Awards:
| I see..... ampe 5 month, prtnyaan q ga prnah trblaskan..... klo bgtu, lemme necroposting! (necro yg nie brsipat important!) n mnjwab problem q ndri! mgapa dri q brmslah wktu dispose? itu krena, pda komenny trtulis tuk dispose pggil script nie..... game_system.gauge_list(id).gauge_dispose yg mna stlah q tliti shrusny.... game_system.gauge_list(id).dispose_gauge (untung q bljar nkript dkit2, jdi tau....) anyway, pling prahny...... rupany aq make yg v1.0 (rupany dah v1.1 ya.....) q blom nyoba v1.1 , so nie q da lporan BUG pda v1.0 .... - klo aq dah dispose tu gauge, lalu script scene = scene_map.new gauge ny jdi mncul lgi.... (cek dah d demo KD2 ) - variableny overdoze....I mean, klo max var ny 5, variableny ttap bsa d atas max var.... cba buatny.... var = max var if var (bigger than) max var var = 0 if var (smaller than) 0 gtu doank..... hope d v1.1 ga da BUG yg bru q sbtin..... NB : q make hape, yg ga bsa nlis simbol dolar, krung kotak, lbih kcil, lbih bsar, n ga bsa bka spoiler..... (hape aneh....) |
| | | 2010-07-23, 20:32 | Re: Variable Gauges v1.1 |
---|
wltr3565 Senior
Posts : 870 Thanked : 28 Engine : RMVX Skill : Skilled Type : Scripter
Awards:
| @kuro: Aku lupa, ada kesalahan manual dan belum kuperbaikin disini Kesalahan yang dispose segala itu dah dijelasin di trid yang di rmvx.net. |
| | | | Re: Variable Gauges v1.1 |
---|
Sponsored content
| | | | Similar topics | |
|
Similar topics | |
| |
Halaman 1 dari 1 | |
| Permissions in this forum: | Anda tidak dapat menjawab topik
| |
| |
Latest 10 Topics | [Web Novel] Gloria Infidelis 2016-11-17, 21:27 by LightNightKnight
[Announcement] Forum baru untuk RMID 2016-08-25, 16:39 by TheoAllen
Where I'm Wrong ? 2016-07-24, 16:10 by ReydVires
flakeheartnet's Resources part III 2016-07-08, 14:30 by flakeheartnet
Keira's Art Warehouse 2016-06-28, 19:27 by KeiraBlaze
Theo Core Time System + Bingung 2016-06-27, 16:24 by Lockin
Error Script, Maybe ? 2016-06-27, 16:20 by Lockin
Nusaimoe @ RMID Lounge 2016-06-21, 05:02 by Jihad Bagas
Call Random Battle 2016-06-15, 17:04 by Lockin
Flakeheartnet Resources Part II [come back gift] 2016-06-07, 15:51 by flakeheartnet
|
Statistics
|
Members: [ 4947 ]
Topics: [ 8258 ]
Posts: [ 112606 ]
Newest member: [ https://rmid.forumotion.net/u4968 ]
|
|
|
|
|
|