The ability to tune a meta file directly in the text file can save lots of time i believe. I made a simple meta to try to break it apart into each line of the GUI ingame.
This is how the text appears in the file in your virinditank folder. My goal is to know where to cut from and then how to paste between to adjust my meta without having to do it ingame. Adding commands can become quite daunting when you have ideas for more commands than one really needs.
Someone care to put breaks in it so we can see how its seperated?
1
CondAct
5
CType
AType
CData
AData
State
n
n
n
n
n
8
i
4
i
1
s
^.*().* (say|says|tells you), \"!fulljumpforward\"$
s
fulljumpforward
s
Default
i
4
i
1
s
^.*().* (say|says|tells you), \"!fullshiftjump\"$
s
fullshiftjump
s
Default
i
4
i
1
s
^.*().* (say|says|tells you), \"!jump\"$
s
jump
s
Default
i
4
i
1
s
^.*().* (say|says|tells you), \"!quickshiftjump\"$
s
quickshiftjump
s
Default
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt jumpw 1500
i
1
s
Default
s
fulljumpforward
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt sjumpw 1500
i
1
s
Default
s
fullshiftjump
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt send space
i
1
s
Default
s
jump
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt sjumpw 100
i
1
s
Default
s
quickshiftjump
Anatomy of a meta file
broke it apart and gonna add some stuff then try ingame to see what breaks
1
CondAct
5
CType
AType
CData
AData
State
n
n
n
n
n
8 <! this number is the number of entries you have in the meta.
i
4
i
1
--------
s
^.*().* (say|says|tells you), \"!fulljumpforward\"$
s
fulljumpforward
s
Default
i
4
i
1
----------
----------
s
^.*().* (say|says|tells you), \"!fullshiftjump\"$
s
fullshiftjump
s
Default
i
4
i
1
---------
---------
s
^.*().* (say|says|tells you), \"!jump\"$
s
jump
s
Default
i
4
i
1
----------
---------
s
^.*().* (say|says|tells you), \"!quickshiftjump\"$
s
quickshiftjump
s
Default
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt jumpw 1500
i
1
s
Default
s
fulljumpforward
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt sjumpw 1500
i
1
s
Default
s
fullshiftjump
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt send space
i
1
s
Default
s
jump
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt sjumpw 100
i
1
s
Default
s
quickshiftjump
1
CondAct
5
CType
AType
CData
AData
State
n
n
n
n
n
8 <! this number is the number of entries you have in the meta.
i
4
i
1
--------
s
^.*().* (say|says|tells you), \"!fulljumpforward\"$
s
fulljumpforward
s
Default
i
4
i
1
----------
----------
s
^.*().* (say|says|tells you), \"!fullshiftjump\"$
s
fullshiftjump
s
Default
i
4
i
1
---------
---------
s
^.*().* (say|says|tells you), \"!jump\"$
s
jump
s
Default
i
4
i
1
----------
---------
s
^.*().* (say|says|tells you), \"!quickshiftjump\"$
s
quickshiftjump
s
Default
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt jumpw 1500
i
1
s
Default
s
fulljumpforward
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt sjumpw 1500
i
1
s
Default
s
fullshiftjump
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt send space
i
1
s
Default
s
jump
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt sjumpw 100
i
1
s
Default
s
quickshiftjump
Sorry; close but wrong
The actual entries are defined in the header
Condition Type
Action Type
Condition Data
Action Data
State
each of those are 1 of 3 (or more) data types; indicated by an "i" for integer, "s" for string, or "TABLE" for table.
Every condition/action type has a different amount of entries in the Data section.
Data Types:
Integer:
i
3
String:
s
blah
Table:
TABLE
2
K
V
n
n
2 <== number of blocks of expected type in the table (either Action, or Condition, not Both)
[AType]
[Adata]
[AType]
[Adata]
...
If you are familiar with VBScript; attached is my .hta that I was working on, decoding the format, IOT make my own editor. Save it as a .hta file to actually run it. -EDIT- The forums do not seem to allow any attachments other than .met :/
The actual entries are defined in the header
Condition Type
Action Type
Condition Data
Action Data
State
each of those are 1 of 3 (or more) data types; indicated by an "i" for integer, "s" for string, or "TABLE" for table.
Every condition/action type has a different amount of entries in the Data section.
Data Types:
Integer:
i
3
String:
s
blah
Table:
TABLE
2
K
V
n
n
2 <== number of blocks of expected type in the table (either Action, or Condition, not Both)
[AType]
[Adata]
[AType]
[Adata]
...
If you are familiar with VBScript; attached is my .hta that I was working on, decoding the format, IOT make my own editor. Save it as a .hta file to actually run it. -EDIT- The forums do not seem to allow any attachments other than .met :/
Code: Select all
1
CondAct
5
CType
AType
CData
AData
State
n
n
n
n
n
8 <== number of blocks
--------
i
4
i
1
s
^.*().* (say|says|tells you), \"!fulljumpforward\"$
s
fulljumpforward
s
Default
--------
i
4
i
1
s
^.*().* (say|says|tells you), \"!fullshiftjump\"$
s
fullshiftjump
s
Default
--------
i
4
i
1
s
^.*().* (say|says|tells you), \"!jump\"$
s
jump
s
Default
--------
i
4
i
1
s
^.*().* (say|says|tells you), \"!quickshiftjump\"$
s
quickshiftjump
s
Default
--------
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt jumpw 1500
i
1
s
Default
s
fulljumpforward
--------
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt sjumpw 1500
i
1
s
Default
s
fullshiftjump
--------
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt send space
i
1
s
Default
s
jump
--------
i
1
i
3
i
0
TABLE
2
K
V
n
n
2
i
2
s
/mt sjumpw 100
i
1
s
Default
s
quickshiftjump
Last edited by Command on February 1st, 2014, 9:02 pm, edited 1 time in total.
so the act on variables are from 0 - 21
the commands are 0 - 4
the variable is either 0 or user set or a table(multiple user settings)
i
X (0 thru 21, starting at Never being 0 and Not being 21)
i
Y (0 thru 4, starting at None being 0 and Load Embedded Nav Route being 4)
i
Z (variables, 0's seem to be static for 'act on's that dont require a number input by user. 'act on chat' doesnt even have this integer, and if an Any, All, or Not is used this will be TABLE)
s
[text] will be the state Y points to if Y=1(set meta state) ; will be the chat command if Y=2(chat command)
s
[text] this is the current state that is active
X list
0: Never
1: Always
2: All
3: Any
4: Chat Message
5: Pack Slots <=
6: Second in state >=
7: Navroute empty
8: Character Death
9: Any Vendor Open
10: Vendor Closed
11: Inventory Item Count <=
12: Inventory Item Count >=
13: Monster Name Count Within Distance
14: Monster Priority Count Within Distance
15: Need to Buff
16: No Monsters Within Distance
17: Landblock ==
18: Landcell ==
19: Portalspace Entered
20: Portalspace Exited
21: Not
Y List
0: None
1: Set Meta State
2: Chat Command
3: All
4: Load Embedded Nav Route
///below is a
i
2
i
3
which is an all triggering an all
i
2
i
3
TABLE
2
K
V
n
n
0
TABLE
2
K
V
n
n
0
s
Default
gonna put some commands in it and see what happens
the commands are 0 - 4
the variable is either 0 or user set or a table(multiple user settings)
i
X (0 thru 21, starting at Never being 0 and Not being 21)
i
Y (0 thru 4, starting at None being 0 and Load Embedded Nav Route being 4)
i
Z (variables, 0's seem to be static for 'act on's that dont require a number input by user. 'act on chat' doesnt even have this integer, and if an Any, All, or Not is used this will be TABLE)
s
[text] will be the state Y points to if Y=1(set meta state) ; will be the chat command if Y=2(chat command)
s
[text] this is the current state that is active
X list
0: Never
1: Always
2: All
3: Any
4: Chat Message
5: Pack Slots <=
6: Second in state >=
7: Navroute empty
8: Character Death
9: Any Vendor Open
10: Vendor Closed
11: Inventory Item Count <=
12: Inventory Item Count >=
13: Monster Name Count Within Distance
14: Monster Priority Count Within Distance
15: Need to Buff
16: No Monsters Within Distance
17: Landblock ==
18: Landcell ==
19: Portalspace Entered
20: Portalspace Exited
21: Not
Y List
0: None
1: Set Meta State
2: Chat Command
3: All
4: Load Embedded Nav Route
///below is a
i
2
i
3
which is an all triggering an all
i
2
i
3
TABLE
2
K
V
n
n
0
TABLE
2
K
V
n
n
0
s
Default
gonna put some commands in it and see what happens
Mostly correct; but the different actions and conditions have a specific list of variables...
One note- in inventory item count tables, the k and v are lowercase; all other are upper case.
First, I read the CType and Atype (always 4 lines) then I run the subs below, with the number read for CType in intCond and AType in intAct
Here is my VBS code for Actions; expectM() just reads the line and verifies that it's what it should be
And my code for Conditions:
*Some of the conditions are not completed yet; The un finished ones are all set to log as "(u)Condition"
V/r,
Command/FF
One note- in inventory item count tables, the k and v are lowercase; all other are upper case.
First, I read the CType and Atype (always 4 lines) then I run the subs below, with the number read for CType in intCond and AType in intAct
Here is my VBS code for Actions; expectM() just reads the line and verifies that it's what it should be
Code: Select all
Sub selectAct()
Select Case intAct
Case 0
strAct = "None"
expectM("i")
expectM("0")
logM("- Action: None")
Case 1
strAct = "Set Meta State"
expectM("s")
strC = objFile.ReadLine
logM("- Action: Set Meta State: " & strC)
Case 2
strAct = "Chat Command"
expectM("s")
strC = objFile.ReadLine
logM("- Action: Chat Command: " & strC)
Case 3
strAct = "All"
expectM("TABLE")
expectM("2")
expectM("K")
expectM("V")
expectM("n")
expectM("n")
intBlks = objFile.ReadLine
logM("- Action: ALL:")
For n = 1 to intBlks
expectM("i")
intAct = objFile.ReadLine
selectAct()
next
Case 4
strAct = "Load Embedded Nav Route"
expectM("ba")
intLen = objFile.ReadLine
strNam = objFile.ReadLine
intBlks = objFile.ReadLine
objFile.Skip(intLen - (Len(strNam)+Len(intBlks)+4))
logM("- Action: Load Embedded Nav Route: " & strNam & " (" & intBlks & "pts, " & intLen & "b)")
Case else
strAct = "ERROR"
End Select
End Sub
And my code for Conditions:
Code: Select all
Sub selectCond()
Select Case intCond
Case 0
strCond = "Never"
expectM("i")
expectM("0")
logM("- Condition: Never")
Case 1
strCond = "Always"
expectM("i")
expectM("0")
logM("- Condition: Always")
Case 2
strCond = "All"
expectM("TABLE")
expectM("2")
expectM("K")
expectM("V")
expectM("n")
expectM("n")
intBlks = objFile.ReadLine
logM("- Condition: ALL:")
For n = 1 to intBlks
expectM("i")
intCond = objFile.ReadLine
selectCond()
next
Case 3
strCond = "Any"
expectM("TABLE")
expectM("2")
expectM("K")
expectM("V")
expectM("n")
expectM("n")
intBlks = objFile.ReadLine
logM("- Condition: ANY:")
For n = 1 to intBlks
expectM("i")
intCond = objFile.ReadLine
selectCond()
next
Case 4
strCond = "Chat Message"
expectM("s")
strC = objFile.ReadLine
logM("- Condition: Chat Message: " & strC)
Case 5
strCond = "Pack Slots <="
logM("- (u)Condition: " & strCond)
Case 6
strCond = "Seconds in State >="
expectM("i")
intC = objFile.ReadLine
logM("- Condition: Seconds in State >=: " & intC)
Case 7
strCond = "Navroute Empty"
expectM("i")
expectM("0")
logM("- Condition: " & strCond)
Case 8
strCond = "Character Death"
expectM("i")
expectM("0")
logM("- Condition: " & strCond)
Case 9
strCond = "Any Vendor Open"
expectM("i")
expectM("0")
logM("- Condition: " & strCond)
Case 10
strCond = "Vendor Closed"
expectM("i")
expectM("0")
logM("- Condition: " & strCond)
Case 11
strCond = "Inventory Item Count <="
expectM("TABLE")
expectM("2")
expectM("k")
expectM("v")
expectM("n")
expectM("n")
expectM("2")
expectM("s")
expectM("n")
expectM("s")
strC = objFile.ReadLine
expectM("s")
expectM("c")
expectM("i")
intC = objFile.ReadLine
logM("- Condition: Inventory Item Count: " & strC & " <= " & intC)
Case 12
strCond = "Inventory Item Count >="
logM("- (u)Condition: " & strCond)
Case 13
strCond = "Monster Name Count Within Distance"
logM("- (u)Condition: " & strCond)
Case 14
strCond = "Monster Priority Count Within Distance"
logM("- (u)Condition: " & strCond)
Case 15
strCond = "Need to Buff"
expectM("i")
expectM("0")
logM("- Condition: " & strCond)
Case 16
strCond = "No Monsters Within Distance"
logM("- (u)Condition: " & strCond)
Case 17
strCond = "Landblock =="
expectM("i")
intC = objFile.ReadLine
logM("- Condition: " & strCond & ": " & intC)
Case 18
strCond = "Landcell =="
expectM("i")
intC = objFile.ReadLine
logM("- Condition: " & strCond & ": " & intC)
Case 19
strCond = "Portal Space Entered"
expectM("i")
expectM("0")
logM("- Condition: " & strCond)
Case 20
strCond = "Portal Space Exited"
expectM("i")
expectM("0")
logM("- Condition: " & strCond)
Case 21
strCond = "NOT"
expectM("TABLE")
expectM("2")
expectM("K")
expectM("V")
expectM("n")
expectM("n")
intBlks = objFile.ReadLine
logM("- Condition: NOT:")
For n = 1 to intBlks
expectM("i")
intCond = objFile.ReadLine
selectCond()
next
Case else
strCond = "ERROR"
End Select
End Sub
V/r,
Command/FF
VTank uses a common data file format for character profiles, meta, and the gameinfo database. It works like this:
----
Table Count
[Tables]
--Tables are:--
Table Name
Column Count
[Column Names]
[Is column indexed? y/n]
Record count
[Records]
--Records are:--
----
Table Count
[Tables]
--Tables are:--
Table Name
Column Count
[Column Names]
[Is column indexed? y/n]
Record count
[Records]
--Records are:--
- --Fields are:--
Data type code
Value
----------------
Data type codes options are:
d: double
i: integer
u: unsigned integer
f: float
s: string
b: boolean
0: unassigned (null)
ba: length-prefixed ascii blob (this is for strings that might contain a newline)
TABLE: a nested database table, encoded the same as above.
Indexing does not change anything in the file, it just tells the plugin that when the file is loaded it should build a runtime index for that column. Indexed columns cannot have duplicates.
Internally, condition and action meta classes are asked to save and they return a dbfield. For simple ones, it is a single value. For others, it is a table containing multiple options.
How well does vTank handle this format?
Will it re-write it, blindly? IE, can I add a 6th column to that table; and expect vTank to read it (and ignore it), and re-write it... or is there anywhere in the file where I can add some data, that vTank won't just delete when it re-saves it?
V/r,
Command
Will it re-write it, blindly? IE, can I add a 6th column to that table; and expect vTank to read it (and ignore it), and re-write it... or is there anywhere in the file where I can add some data, that vTank won't just delete when it re-saves it?
V/r,
Command
Not for meta files. It loads meta files and uses them to construct internal classes.Command wrote:Will it re-write it, blindly? IE, can I add a 6th column to that table; and expect vTank to read it (and ignore it), and re-write it