8,452
edits
Paradox-01 (talk | contribs) mNo edit summary |
Paradox-01 (talk | contribs) m (scripting: decrypting merged integer flags) |
||
Line 301: | Line 301: | ||
| [26] getting the rotation and position of selected objects | | [26] getting the rotation and position of selected objects | ||
| [27] getting the rotation and position of not selected objects | | [27] getting the rotation and position of not selected objects | ||
|- | |||
| [28] decrypting merged integer flags | |||
| | |||
| | |||
|} | |} | ||
Line 719: | Line 723: | ||
logmessage GetValue("pelvis.kine.global.posy") | logmessage GetValue("pelvis.kine.global.posy") | ||
logmessage GetValue("pelvis.kine.global.posz") | logmessage GetValue("pelvis.kine.global.posz") | ||
' '''[28] decrypting merged integer flags''' | |||
' for example the [[OBD_talk:BINA/OBJC/TRGV|BINACJBOTrigger Volume.xml]] file has flags as strings for the <Flags> tag | |||
' and integer values for the <Teams> tag whereby the values are merged to one value | |||
' so if <Teams> tag holds "101" we have to think what flags it holds, the flags can be broken down with following code | |||
' x: hypothetical value of <Teams> | |||
x=101 | |||
' 101 = 64 + 32 + 4 + 1 | |||
x_255 | |||
sub x_255 | |||
if x > 255 then | |||
msgbox "Flags bigger than 255 are not allowed.", ,"error" | |||
exit sub | |||
end if | |||
if x >= 128 and x <= 255 then | |||
logmessage "128" | |||
x = x - 128 | |||
end if | |||
if x >= 64 and x < 128 then | |||
logmessage "64" | |||
x = x - 64 | |||
end if | |||
if x >= 32 and x < 64 then | |||
logmessage "32" | |||
x = x - 32 | |||
end if | |||
if x >= 16 and x < 32 then | |||
logmessage "16" | |||
x = x - 16 | |||
end if | |||
if x >= 8 and x < 16 then | |||
logmessage "8" | |||
x = x - 8 | |||
end if | |||
if x >= 4 and x < 8 then | |||
logmessage "4" | |||
x = x - 4 | |||
end if | |||
if x >= 2 and x < 4 then | |||
logmessage "2" | |||
x = x - 2 | |||
end if | |||
if x = 2 then | |||
logmessage "2" | |||
x = x - 2 | |||
end if | |||
if x = 1 then | |||
logmessage "1" | |||
x = x - 1 | |||
end if | |||
if x = 0 then | |||
logmessage "finished check" | |||
end if | |||
end sub | |||
' INFO : 64 | |||
' INFO : 32 | |||
' INFO : 4 | |||
' INFO : 1 | |||
' INFO : finished check | |||
edits