VX 스크립트

TagNote
Provides a means for pulling tag/value pairs out the notes field for anything. This enables simple storage of extra parameters for other scripts in a way that won't work at cross-purposes with itself or other uses for the notes field.

Note that you will probably need to put this script before any others that use it.

In any notes field, you can write: <tag_name tag_value> to store tag_value under the name tag_name. You can also store nothing, if no value is needed, through <tag_name> in the notes field. This slightly updated version supports additional parameters in the tag name.

Download: http://chthonic.150m.com/scratch/Queex_scripts.zip
여기서부터
###############
# 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
Comment '5'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
537 기타 Modified Advanced Weather Script VX 1.1 3 file Alkaid 2010.10.08 1966
536 변수/스위치 맵에 변수와 스위치 설정하기.. 5 정의로운녀석 2008.07.22 1984
» 기타 TagNote v2.0 5 Man... 2008.10.28 1996
534 장비 Equipment Constraints 2.5b by Modern Algebra 3 Alkaid 2010.09.17 2001
533 전투 Requiem ABS Hero Edition by Falcao 습작 2013.05.13 2004
532 기타 みんと씨의 RMVX 샘플 프로젝트 1.11 (2009-11-05) 6 Alkaid 2010.09.13 2005
531 기타 Lock Screen 3 비극ㆍ 2010.04.19 2012
530 스킬 Learn Skills By Use 10 비극ㆍ 2010.04.19 2037
529 전투 VX_SRPG2 by tomoaky 1 습작 2013.05.13 2050
528 장비 카드 슬롯 장비 스크립트[수정] 2 빙하 2012.11.11 2058
527 기타 스크린샷 기능 14 비극ㆍ 2010.04.19 2090
526 기타 앞에있는 이벤트 아이디 찾기 6 허걱 2009.08.21 2091
525 기타 적 선택시 스킬창 비표시 + 타겟 플래쉬 7 훈덕 2009.06.14 2094
524 기타 이벤트 위치 저장 스크립트 10 Tofuman 2008.12.11 2096
523 전투 Animated Battlers VX 3.7 by DerVVulfman Alkaid 2012.09.07 2098
522 전투 Team_Ilias's_Old_Project_Demo 4 습작 2012.07.11 2099
521 오디오 사운드테스트 스크립트 13 file 카르와푸딩의아틀리에 2009.08.19 2106
520 기타 RMVX Patcher 1.2.0 by Yeyinde 5 file Alkaid 2010.11.12 2117
519 More SaveFlies(대박) 2 Man... 2008.10.28 2125
518 기타 스크립트강좌 4 아하!잘봤어요. 2009.05.04 2158
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 32 Next
/ 32