XSI - Mesh Point Scripts

I created some custom XSI scripts today for adding Null points.

Here's a few examples if anyone would like to do something similar.

Instructions to setup as a custom toolbar button:

  1. On Custom Toolbar right click "Customize Toolbar..."
  2. Select "Toolbar Widgets"
  3. Drag "Script Button" onto toolbar
  4. Paste or create script command (my script is JScript for the scripting language).

This is a script that creates Null points for Weapon-0 ensuring the P### is incremented properly in XSI. The icon is also automatically set to an arrow, and the color set to blue. I cloned this button for Weapon-1 and Weapon-2, and bombing.

var i;
for (i = 1; i<99; i++) {
try {
  if (i<10)  {
 SelectObj("P00" + i  + "-Weapon-0")
  } else {
 SelectObj("P0" + i + "-Weapon-0")
  }
} catch(e) {
 break;
}
}
LogMessage(i);

var name;
  if (i<10)  {
 name = "P00" + i  + "-Weapon-0";
  } else {
 name = "P0" + i + "-Weapon-0";
  }
GetPrim("Null", name, "rootpoint", null)
SetValue(name + ".null.primary_icon", 10, null);
SetValue(name + ".null.shadow_icon", 10, null);
SetValue(name + ".null.shadow_colour_custom", true, null);
SetValue(name + ".null.B", 1, null);

End of quote

This script creates the common Null points with Rings and the color yellow.

GetPrim("Null", "P001-Above", "rootpoint", null)
SetValue("P001-Above.null.primary_icon", 2, null);
SetValue("P001-Above.null.shadow_icon", 2, null);
SetValue("P001-Above.null.shadow_colour_custom", true, null);
SetValue("P001-Above.null.R", 1, null);
SetValue("P001-Above.null.G", 1, null);
GetPrim("Null", "P001-Aura", "rootpoint", null)
SetValue("P001-Aura.null.primary_icon", 2, null);
SetValue("P001-Aura.null.shadow_icon", 2, null);
SetValue("P001-Aura.null.shadow_colour_custom", true, null);
SetValue("P001-Aura.null.R", 1, null);
SetValue("P001-Aura.null.G", 1, null);
GetPrim("Null", "P001-Center", "rootpoint", null)
SetValue("P001-Center.null.primary_icon", 2, null);
SetValue("P001-Center.null.shadow_icon", 2, null);
SetValue("P001-Center.null.shadow_colour_custom", true, null);
SetValue("P001-Center.null.R", 1, null);
SetValue("P001-Center.null.G", 1, null);

End of quote

This script creates teh exhaust Null points with arrows, the color green and automaticallly rotates it 180 degress

var i;
for (i = 1; i<99; i++) {
try {
  if (i<10)  {
 SelectObj("P00" + i  + "-Exhaust")
  } else {
 SelectObj("P0" + i + "-Exhaust")
  }
} catch(e) {
 break;
}
}
LogMessage(i);

var name;
  if (i<10)  {
 name = "P00" + i  + "-Exhaust";
  } else {
 name = "P0" + i + "-Exhaust";
  }
GetPrim("Null", name, "rootpoint", null)
SetValue(name + ".null.primary_icon", 10, null);
SetValue(name + ".null.shadow_icon", 10, null);
SetValue(name + ".null.shadow_colour_custom", true, null);
SetValue(name + ".null.G", 1, null);
Rotate(null, 0, 180, 0, siAbsolute, siPivot, siObj, siY, null, null, null, null, null, null, null, 0, null);

End of quote

I also created a couple of buttons for Fire Left, Fire Right and Fire Back using the Rotate shown in Exhuast.

Hope this helps someone else out too.

Enjoy!

5,384 views 7 replies
Reply #1 Top

I went I step farther and created toolbars

  

The Add Mesh Points button opens another toolbar with weapons, lights and buffs plus. The convert XSI button is used the most. Moves the mesh and textures directly to my mod of choice.

Reply #2 Top

I'm new to trying to script in Xsi and will eventually setup somthing similar. All in all, my process is fairly streamlined for setting up a model. I just got tired of manually setting up null points (Argh!). I like how you set your toolbar up though!

Reply #3 Top

Click View --> New Custom Toolbar. You will now have an empty one. Right click inside the toolbars blank area and select Customize Toolbar, a window will pop up. Under Group:, select Toolbar Widgets and the right window will give available commands. Select the Script Button and drag it on the new toolbar and edit. Click on an empty area of the toolbar and save as. Once saved you can access by clicking View --> Toolbars. You can also always edit the button with right click --> edit. Don't forget to save the toolbar after any changes.

Once you have some buttons I will give you my Convert XSI script. All mine are VB.

Reply #4 Top

Yep, thats the same process I had above, except I was placing as a custome toolbar on the application window versus as a popup toolbar. I would much appreciate seeing the Convert XSI script :thumbsup: VBScript is cool, I'm just more familiar with the JScript syntax being a Java/C++ developer...

Reply #5 Top

convertxsi.txt

If you choose to move the mesh files and textures, just double click the mod name so you see the title in top and the folders in main windoow. It will create a mesh and textures folder inside if there is not on already.

If you choose no to move it places the files in C:Developer\New_Mod. It actually writes there first the moves the files to the mod with the above option.

It looks for the ConvertXSI files in C:Developer\ConvertXSI. If there not there it takes you to download page to get them.

You should easily be able to change the directorys.

 

Reply #6 Top

Why is it so complicated in XSI?

In max with my script all you need to do is make a point helper with the exact name you want in the file. With the visual arrows I added its SO much easier than anything similar I've ever tried (back in the day of freespace we would use truespace with lights to make turrets, ugh that was annoying).

Reply #7 Top

I do not find XSI complicated at all. It is what I learned on. More option is more buttons but do I use them all, no. Maybe as I learn I will.

Check out how long ago I made my 1st post Jump Gates when I did not know how to model, texture or mod any game.