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.
|
|
| [ReQ]Level Restriction Script | |
| 2009-11-09, 21:55 | [ReQ]Level Restriction Script |
---|
Oscar Senior
Posts : 830 Thanked : 13 Engine : RMVX Skill : Beginner Type : Writer
| Kalo boleh minta bantuan lagi, ada yang bisa buatin script " level restriction" untuk RMVX ? kasusnya seperti ini: Actor hanya bisa menggunakan equipment tertentu jika sudah mencapai suatu lvl. contoh: Ralph yang masih lvl 5, bisa membawa Iron Sword tapi tidak bisa membawa Mithril Sword untuk lvl 25. Mungkin ada para scripter disini bisa membantu, atau mungkin bagi-bagi link buat script ini ? Thx, sebelumnya. nb: jika ada kesalahan penempatan thread mohon dipindahkan dan mohon saia diperingatkan |
| | | 2009-11-09, 22:11 | Re: [ReQ]Level Restriction Script |
---|
CrimsonSeas Novice
Posts : 106 Thanked : 9 Engine : RMVX
| Nih kk hasilnya, tp harus pake script tambahan TagNote buatan Queex Ini TagNote-nya (credits to Queex): - Spoiler:
- Code:
-
############### # TagNote # ###################################################################### # Version 2.0 # # Author: Queex # # Licence: Creative Commons non-commercial attributive # ###################################################################### # Allows the easy use of tags in the note field for # # objects to store data. Syntax is simple, and the system ignores # # any lines in the notes field that don't match the syntax. # # # # Version history: # # 1.2 Final 1.x version # # 2.0 Changed to follow Ruby naming conventions # # # # Usage: # # get_tag(<notes field>,<tag name>) # # has_tag?(<notes field>,<tag name>) # # has_tag_value?(<notes field>,<tag name>,<tag value>) # # get_additional_tag(<notes field>,<tag name>,<index> # # get_additional_tag_by_value(<notes field>,<tag name>,<tag value> # # ,<index> # # # # Syntax in the note field: # # <tag_name tag_value> # # <tag_name> # # <tag_name tag_value param1 param2 ...> # ######################################################################
module TAGNOTE
########### # get_tag # ################################################################### # Gets the stored value of the first occurrence of the named tag # # in the notes field. # # <tag_name tag_value tag_value2> will return 'tag_value' # # <tag_name tag_value> will return 'tag_value' # # <tag_name> will return true # # if no tag with tag_name, returns nil # ################################################################### def get_tag(note_field, tag_name) lines=note_field.split("\n") for line in lines #process line by line if line[0,1].eql?("<") #this line has a tag line2=line.split(/[<> ]/) if line2[1].eql?(tag_name) if(line2.length==2) #there is actually no value return true else return line2[2] end end end end return nil end
############ # has_tag? # ################################################################## # Indicates whether the given note field has a tag of that name. # # <tag_name tag_value tag_value2> and # # <tag_name tag_value> and # # <tag_name> will both return true # # if no tag with tag_name, returns false # ################################################################## def has_tag?(note_field,tag_name) lines=note_field.split("\n") for line in lines if line[0,1].eql?("<") line2=line.split(/[<> ]/) if line2[1].eql?(tag_name) return true end end end return false end
################## # has_tag_value? # ################################################################# # Indicates whether the note field has a tag of a given name # # with a certain value. # # <tag_name tag_value> returns true # # <tag_name wrong_tag_value> returns false # # <tag_name> returns false # # if no tag with tag_name has the correct value, returns false. # # tag_value2 is ignored # ################################################################# def has_tag_value?(note_field,tag_name,tag_value) lines=note_field.split("\n") for line in lines if line[0,1].eql?("<") line2=line.split(/[<> ]/) if line2[1].eql?(tag_name) and line2[2].eql?(tag_value) return true end end end return false end
###################### # get_additional_tag # ###################################################################### # Gets additional parameters for a tag of a given name. # # Calling with an index of 1 returns # # the first value after the tag name. # # Returns nil if the index is higher than the last parameter. # # Returns false if no match for the tag name is found. # ###################################################################### def get_additional_tag(note_field,tag_name,index) lines=note_field.split("\n") for line in lines if line[0,1].eql?("<") line2=line.split(/[<> ]/) if line2[1].eql?(tag_name) if(line2.length<index+2) #Actually no value to get return nil else return line2[index+1] end end end end return false end
############################### # get_additional_tag_by_value # ###################################################################### # Gets additional parameters for a tag of a given name # # with a certain value. Calling with an index of 1 returns # # the first value after the tag name. # # Returns nil if the index is higher than the last parameter. # # Returns false if no match for the tag name and tag value is found. # ###################################################################### def get_additional_tag_by_value(note_field,tag_name,tag_value,index) lines=note_field.split("\n") for line in lines if line[0,1].eql?("<") line2=line.split(/[<> ]/) if line2[1].eql?(tag_name) and line2[2].eql?(tag_value) if(line2.length<index+2) #Actually no value to get return nil else return line2[index+1] end end end end return false end
end
Nah ini Script buat level restictionnya: - Spoiler:
- Code:
-
#============================================================================= #Weapon level restriction script #By: CrimsonSeas #Credits to: Queex for the TagNote #============================================================================= #Once again a request at RMID, this script can be used to give equipments #a required level to be equipped #This version disables the unequippable equipment to be equipped, but once the #level requirement is met, the equipment can be equipped. #============================================================================= #INSTRUCTIONS(IMPORTANT!!) #To define an equipments level requirement, please write this line to the note #box: #<level_req x> #where x is the requirement level. #============================================================================= module RPG class Weapon include TAGNOTE def level_requirement return 0 unless has_tag?(self.note, "level_req") return get_tag(self.note, "level_req").to_i end end class Armor include TAGNOTE def level_requirement return 0 unless has_tag?(self.note, "level_req") return get_tag(self.note, "level_req").to_i end end end
class Scene_Equip def update_item_selection if Input.trigger?(Input::B) Sound.play_cancel @equip_window.active = true @item_window.active = false @item_window.index = -1 elsif Input.trigger?(Input::C)&& @actor.level >= @item_window.item.level_requirement Sound.play_equip @actor.change_equip(@equip_window.index, @item_window.item) @equip_window.active = true @item_window.active = false @item_window.index = -1 @equip_window.refresh for item_window in @item_windows item_window.refresh end elsif Input.trigger?(Input::C) && @actor.level < @item_window.item.level_requirement Sound.play_buzzer end end end
class Window_EquipItem def enable?(item) return true if @actor.level >= item.level_requirement return false end end
|
| | | 2009-11-09, 23:16 | Re: [ReQ]Level Restriction Script |
---|
Oscar Senior
Posts : 830 Thanked : 13 Engine : RMVX Skill : Beginner Type : Writer
| wow, seems helpful. Tq ya kk CrimsonSeas |
| | | | Re: [ReQ]Level Restriction Script |
---|
Sponsored content
| | | | | [ReQ]Level Restriction Script | |
|
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 ]
|
|
|
|
|
|