Mod Tool: Difference between revisions

803 bytes added ,  22 October 2012
m
no edit summary
mNo edit summary
mNo edit summary
Line 332: Line 332:
  ' INFO : Where can you find following phrase in Oni? The day is mine !!
  ' INFO : Where can you find following phrase in Oni? The day is mine !!
  ' INFO : Did you know that Bungie likes to hide sevens? The digits of the year 2032 add up to 7.
  ' INFO : Did you know that Bungie likes to hide sevens? The digits of the year 2032 add up to 7.
'''More tips'''
* You can replace each "logmessage" with a variable. In that case don't forget the = sign.
* Selection(0) means that from all selected objects the first one is taken.
* Use a loop to get all objects.
for each n in selection
logmessage n
next
* In order to shorten the code you might want to set script objects.
: The command to create a standard cube is ''CreatePrim ("Cube", "MeshSurface")''
: If you use '''''set name = ''''' the cube or other object will be available under that ''name''.
: Then you can use any valid method or property with that ''name''.
: Example:
set c = CreatePrim ("Cube", "MeshSurface")
logmessage selection(0).name
logmessage selection(0).length.value
logmessage c.name
logmessage c.length.value
' INFO : cube
' INFO : 8
' INFO : cube
' INFO : 8




'''Some ModTool commands in vbs language that might be interesting for Oni related stuff'''
'''Some ModTool commands in vbs language that might be interesting for Oni related stuff'''
Everywhere "logmessage" stands you can replace it with a variable (in that case don't forget the = sign.)


{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
| width=50% valign=top | LogMessage <nowiki>[string | var]</nowiki>
| width=50% valign=top | LogMessage <nowiki>[string | var | object]</nowiki>
| A command to log information. It requires a string or a variable. Example:
| A command to log information. It requires a string or a variable. Example:
: LogMessage "The object's name is: " & selection(0).Name
: LogMessage "The object's name is: " & selection(0).Name
|-
| logmessage selection.count
| Logs the number of selected objects.
|-
|-
| logmessage selection(0).Name
| logmessage selection(0).Name
Line 415: Line 445:


{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
|width=33%| [1] making an array
|width=33%| [1] creating and extending an array
|width=33%| [2] check selection mode
|width=33%| [2] check selection mode
| [3] getting the IDs of selected polygons plus sorting them
| [3] getting the IDs of selected polygons plus sorting them
8,452

edits