Quick and dirty max script for weapon templates

Baby’s first steps in max scripting!

Download link

This is a 30 lines script that does about the same thing as CFHodEd’s Add Template: Weapon.

I hope this will both help people who are trying to get their bearings in 3dsmax, and those who are trying to bring the 3dsmax/HODOR pipeline closer in functionality to CFHodEd.

How to use:

  1. Go in MAXScript>Open Script and open WeaponTemplate.ms
  2. Go in MAXScript>MAXScript Listener
  3. In the Editor window, click Tools>Evaluate All
  4. In the Listener window, you can now type commands to create hardpoints (see below)
  5. Manually link the hardpoint to ROOT_LOD[0] via the Schematic View.

weaponTemplate “Gun0” will create the correctly named and linked Weapon_Gun0_Position, _Direction and _Rest that you can then manually move and rotate.

You can also enter the coordinates and rotation manually with
weaponTemplate “Gun0” coord:[0,5,0] rot:(eulerangles 0 0 90)

4 Likes

A nice useful little script. I’ve taken the liberty of adding a small UI to it, that lets you enter all the values using textboxes and numeric spinners.

Just go to the maxscript tab on the Utilities Tab, hit run script and select the ms file. Should pop open the UI box.

Hope you don’t mind, of course!

Download

1 Like

Great job! (both of you) Is this stuff possible with Blender (I never use it)…?

I would assume it is, but I have even less experience with blender than with 3dsmax, and most of it is not something I want to remember :b

hi

I allowed myself (yes me too) to add another function, such as:
-Weapon Turret
-repair Point
-Capture Point
-Salvage Point
-Hardpoint

Download

My understanding is Blender is all about the python so generally said there’s more freedom in adding functionality; very much more of an indie tool so much more open. I.e. fully blown plugins and addons could be built around Homeworld. But ive barely ever touched blender :smiley:

Everyone feel free to build around my little script. I’ve been doing modifications on my end to automate the Freespace Open -> HWR conversion process, a very specific goal that won’t be useful to other mods, but the less painful the HODOR pipeline becomes for everyone else, the better!

If it’s okay with you I’ve put it up as a Git:

Oh, and the words “Freespace Open -> HWR conversion”; best this year :smiley:

It’s way easier to add joints in Blender to begin with, compared to Max (copy paste the joint hierarchy, done) - but yeah, a drop-down menu to “add > weapon joint” would be easy. Could add similar options for the other joint types too.

Taking a look at adding a panel to the Create Object area; what would the blender equivalent of joints be? Or is it simply the naming convention that matters?

Add Object. They used to be called empties which was a bit clearer.

Thanks, found it. Added a fork to the DAE Export tool

https://github.com/Drache93/Better-Collada-Exporter-HW-Edition-

Just added weapon so far to test; rest should be easy enough. But coursework awaits :smiley:

1 Like

NavLight WIP

5 Likes

Truly heroes among us - do you also rush into burning buildings to save children & beloved pets? :wink: Good stuff!

2 Likes

That’s some good stuff right there. My method was to either copy the string out of Max into EditPad, do the edits and copy it back over or to just open the .DAE file and edit it there directly in the text.

1 Like

Hi

Here the update, with NavLight and ship Template.
Download

3 Likes

The plugins don’t work correctly for me on Max 2015. I have no idea why. Can anyone give me advice please? With the plugins enabled the example files don’t seem to import. With the plugins disabled the examples are fine.

A dummy’s guide to getting it set up would be appreciated here too, not everyone touched Max (at all) before HWRM…

Are all these new additions being consolidated back into the GitHub project?

//EDIT
Looks like they’re all in the project, nice :smile:
However when I try to use anything I get lots of call errors, null or undefined values aren’t being captured by the script.

Now that never used to happen, and I can’t quite see why, as it works if you close the script and then reload it by using the Run Script button. I’ll keep investigating it.

EDIT: I’ve figured it out. The functions weren’t defined first, so on first run, Max didn’t know what the functions were. I’ve fixed that, and made the ship templates a little more user friendly (as they now give you an error message that doesn’t cause the entire script to die). Plus, I neatened up the code a little bit.

Download the updated script here.

2 Likes

Thank you CMDBob! I’ve been able to get the tool kit to do stuff now! Just need to wrap my head around what everything is now… :confused: