Mod Tool: Difference between revisions

533 bytes added ,  8 July 2013
m
redoing code piece "read xml file"
m (another useful link for vbs)
m (redoing code piece "read xml file")
Line 306: Line 306:
* [http://softimage.wiki.softimage.com/index.php?title=Scripting_Tips_and_Tricks_%28XSISDK%29 xsi wiki page about scripting]
* [http://softimage.wiki.softimage.com/index.php?title=Scripting_Tips_and_Tricks_%28XSISDK%29 xsi wiki page about scripting]
* '''[http://softimage.wiki.softimage.com/sdkdocs/scriptsdb/scriptsdb/scrdb_vbscript.htm many vbscript examples]'''
* '''[http://softimage.wiki.softimage.com/sdkdocs/scriptsdb/scriptsdb/scrdb_vbscript.htm many vbscript examples]'''
* '''[http://ss64.com/vb/ vbs functions]'''
* '''[http://ss64.com/vb/ vbs commands]'''
* [http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/filesfolders/files/ objFSO/objWSHShell: Scripts to manage Files] (replace "Wscript.Echo" with "logmessage")
* [http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/filesfolders/files/ objFSO/objWSHShell: Scripts to manage Files] (replace "Wscript.Echo" with "logmessage")
* [http://activexperts.com/activmonitor/windowsmanagement/adminscripts/other/textfiles/ objFSO/objWSHShell: Scripts to manage Text Files]
* [http://activexperts.com/activmonitor/windowsmanagement/adminscripts/other/textfiles/ objFSO/objWSHShell: Scripts to manage Text Files]
Line 864: Line 864:
  Set colPosition = xmlDoc.selectNodes( "Oni/Objects/WEAP/Header/Position" )
  Set colPosition = xmlDoc.selectNodes( "Oni/Objects/WEAP/Header/Position" )
  Set colRotation = xmlDoc.selectNodes( "Oni/Objects/WEAP/Header/Rotation" )
  Set colRotation = xmlDoc.selectNodes( "Oni/Objects/WEAP/Header/Rotation" )
  Set colClass = xmlDoc.selectNodes( "Oni/Objects/WEAP/OSD/Class" )
  Set colClass =   xmlDoc.selectNodes( "Oni/Objects/WEAP/OSD/Class" )
   
   
  loop_count = xmlDoc.selectNodes( "Oni/Objects/WEAP").length
  loop_count = xmlDoc.selectNodes( "Oni/Objects/WEAP").length
  logmessage "found " & loop_count & " weapons:"
  logmessage "found " & loop_count & " weapons:"
  logmessage "================"
  logmessage "================"
  for i=0 to loop_count - 1
  for i=0 to loop_count - 1
'split string into pices as array, space is used as seperator by default
'element 0 = X; element 1 = Y; element 2 = Z
pos = split(colPosition.item(i).text)
rot = split(colRotation.item(i).text)
' Mod Tool wants comma instead of point for decimal seperator
pos(0) = replace (pos(0), ".", ",")
pos(1) = replace (pos(0), ".", ",")
pos(2) = replace (pos(0), ".", ",")
rot(0) = replace (rot(0), ".", ",")
rot(1) = replace (rot(0), ".", ",")
rot(2) = replace (rot(0), ".", ",")
  logmessage colClass.item(i).text
  logmessage colClass.item(i).text
  logmessage colPosition.item(i).text
  logmessage pos(0) & " " & pos(1) & " " & pos(2)
  logmessage colRotation.item(i).text
  logmessage rot(0) & " " & rot(1) & " " & rot(2)
  logmessage "----------------"
  logmessage "----------------"
  next
  next
Line 880: Line 896:
  ' INFO : ================
  ' INFO : ================
  ' INFO : w5_sbg
  ' INFO : w5_sbg
  ' INFO : 23.16747 84.8193359 757.1958
  ' INFO : 23,16747 23,16747 23,16747
  ' INFO : 0 0 0
  ' INFO : 0 0 0
  ' INFO : ----------------
  ' INFO : ----------------
  ' INFO : w4_psm
  ' INFO : w4_psm
  ' INFO : 18.1105652 84.8193359 749.121
  ' INFO : 18,1105652 18,1105652 18,1105652
  ' INFO : 0 0 0
  ' INFO : 0 0 0
  ' INFO : ----------------
  ' INFO : ----------------
8,452

edits