Theoritcal alternate weapon arcs systems

Continuing the discussion from [MOD] Taiidan Republic | Update: Interceptor and Frigates:

So I figured this derail was worth being in it’s own thread…

This was my initial instinct as well, but it’s not a perfect fit. If you ever use the LoadSharedModel functionality, you are now once again duplicating data. One idea I’d toyed with is that perhaps the turret arc data should be part of the hod somehow, and in theory that could allow for more complex cut-outs than textual definitions enable, but it’s a lot of added complexity for pretty marginal gains.

2 Likes

From what I’ve been able to tell, it turns out that a whole new Lua state interpreter is created just to read weapons files, and the only global functions available to that state is only the weapons definition functions - none of the default Lua libraries are loaded into the interpreter.


Edit: the only default Lua library functions that are available to the weapons scope are:

  • print
  • settagmethod
  • tonumber
  • tostring

Without access to the globals table, I couldn’t even begin to tell you what other functions are available, short of having a few million monkeys pound randomly on the keyboard for a few million years… (even then!)

well, at least my memory still works I guess.

1 Like

Something interesting I just found out:

NewWeaponType is never actually used. I replaced all references to it in a weapon file with “nil,” and the weapon file still loaded.

StartWeaponConfig(nil, "Fixed", "Missile", "Hgn_ClusterTorpedoA", "Normal Only", 300, 7000, 0, 0, 0, 0, 1, 0, 1, 0.5, 0, 0, 0, 0, 0, 0, 0.1, "Normal", 0, 0, 0);

2 Likes