User Tools

Site Tools


developer_center:developer_editor:script:varlib

VarLib Class

Class For VarLib Interface

Return To Previous Page


API list

Class:apiName(parameters) Return Description
VarLib2:setGlobalVarByName(actionattr:number, msg:string, val:number) ErrorCode.OK Set the global variables in the variable library
VarLib2:getGlobalVarByName(actionattr:number, msg:string) ErrorCode.OK val:any Get the global variables of the variable library
VarLib2:setPlayerVarByName(object:number, actionattr:number, msg:string, val:number) ErrorCode.OK Set private variables in the variable library
VarLib2:getPlayerVarByName(object:number, actionattr:number, msg:string) ErrorCode.OK val:any Get private variables in the variable library

Valuegroup API list

Taken from Valuegroup

Class:apiName(parameters) Return Description
Valuegroup:getAllGroupItem(vartype:VARTYPE, libname:string, playerid:number) ErrorCode.OK ret:table Get all the values in the variable group
Valuegroup:insertInGroupByName(vartype:VARTYPE, libvarid:string, value:number, playerid:number) ErrorCode.OK Add any value to any group, and add it to the last digit of the group
Valuegroup:removeValueIndexByName(vartype:VARTYPE, libvarid:string, indx:number, playerid:number) ErrorCode.OK Remove the value of the specified number from any group, become nil, and the number will not be removed
Valuegroup:removeValueByName(vartype:VARTYPE, libvarid:string, value:number, playerid:number) ErrorCode.OK Remove any value of nil from any group
Valuegroup:clearGroupByName(vartype:VARTYPE, libvarid:string, playerid:number) ErrorCode.OK Clear any group, number, and content are all cleared
Valuegroup:getGrouplengthByName(vartype:VARTYPE, libvarid:string, playerid:number) ErrorCode.OK number:number Get the length of the array
Valuegroup:getValueNoByName(vartype:VARTYPE, libvarid:string, indx:number, playerid:number) ErrorCode.OK libvarid:number Get the value of the specified number in the group
Valuegroup:setValueNoByName(vartype:VARTYPE, libvarid:string, indx:number, value:number, playerid:number) ErrorCode.OK Set the value of the number index in the group
Valuegroup:getRandomValueByName(vartype:VARTYPE, libvarid:string) ErrorCode.OK value:number Randomly obtain the value in the array
Valuegroup:insertValueByName(vartype:VARTYPE, libvarid:string, no:number, value:number, playerid:number) ErrorCode.OK Insert any value at any numbered position in any group
Valuegroup:deleteNoByName(vartype:VARTYPE, libvarid:string, no:number, playerid:number) ErrorCode.OK Clear the value of the specified number from any group
Valuegroup:deleteValueByName(vartype:VARTYPE, libvarid:string, val:number, playerid:number) ErrorCode.OK Clear the specified value from any group
Valuegroup:addGroupByName(vartype:VARTYPE, libvarid:string, libvarid2:string, playerid1:number, playerid2:number) ErrorCode.OK Add the value of group 2 at the end of group 1
Valuegroup:removeGroupByName(vartype:VARTYPE, libvarid:string, libvarid2:string, playerid1:number, playerid2:number) ErrorCode.OK Compare group 1 and group 2, if group 1 has the same value as group 2, set it to nil
Valuegroup:deleteGroupByName(vartype:VARTYPE, libvarid:string, libvarid2:string, playerid1:number, playerid2:number) ErrorCode.OK Compare group 1 and group 2, and clear if there is the same value in group 1 as group 2
Valuegroup:insertGroupByName(vartype:VARTYPE, libvarid:string, no:number, libvarid2:string, playerid1:number, playerid2:number) ErrorCode.OK Insert the value of group 2 at the specified number position of group 1
Valuegroup:replaceValueByName(vartype:VARTYPE, libvarid:string, oldval:number, newval:number, playerid:number) ErrorCode.OK Replace any value in any group with a new value
Valuegroup:sortGroupByName(vartype:VARTYPE, libvarid:string, sortType:number, playerid1:number) ErrorCode.OK Sort any set of values
Valuegroup:hasValueByName(vartype:VARTYPE, libvarid:string, val:number, playerid:number) ErrorCode.OK Whether any group has any value, if there is a result return 0
Valuegroup:hasNoByName(vartype:VARTYPE, libvarid:string, no:number, playerid:number) ErrorCode.OK Whether there is a value in any group position, if there is, the result returns 0
Valuegroup:getValueCountByName(vartype:VARTYPE, libvarid:string, val:number, playerid:number) ErrorCode.OK libvarid:number Get the number of any value of any group
Valuegroup:getGroupNoByValue(vartype:VARTYPE, libvarid:string, val:number, playerid:number) ErrorCode.OK libvarid:number Get the number of any value in any group, if there are multiple same values, only return the first one
Valuegroup:getSpcialValueByName(libvarid:string, type:number) ErrorCode.OK Obtain the maximum and minimum values in the group

ActionAttr List

Name Value Description
Position 1 Position
AreaIns 2 Area
Number 3 Value
String 4 String
Boolean 5 Boolean
Player 6 Player
PlayerGrout 7 Player Set
BlockType 8 Block type
ItemType 9 Prop type
Creature 10 Creature
ActorID 11 Actor type
CreatureGroup 12 Creature Set
Timer 13 Timer
EffectType 14 Special effect type
SiteGroup 15 Location group
AreaGroup 16 Area group
NumberGroup 17 Value group
StringGroup 18 String group
BooleanGroup 19 Boolean group
BlockTypeGroup 20 Block type group
ItemTypeGroup 21 Prop type group
CreatureTypeGroup 22 Creature type group
TimerGroup 23 Timer group
EffectTypeGroup 24 Effect type group

1) 2)

2)
The actionattr is the type of the trigger variable
developer_center/developer_editor/script/varlib.txt · Last modified: 2024/08/04 15:06 by notsopro