Modding, Mission Design, and Coding > The Scripting Workshop
Confused about executing scripts.
Wanderer:
Huh? What do you mean?
You just create a new weapon (dummy) that has the same performance as the weapon you want to fire (real weapon). Then make sure the new weapon has all the interface anims, muzzleflashes and all such set for it and also that it has no shockwave and no impact explosion. Search for the script i posted and change the name 'Corona' to the name of your new dummy weapon, and the 'Halo' with the weapon you really want to fire.
Script could probably be reworked into working when ship class fires instead of just using defined weapons though - with small 'cost' in weapon range.
Scooby_Doo:
so for meson i would copy and paste your code, rename Corona to something like meson_dummy
then for tachyon i would repaste it again, rename Cornoa to tach_dummy?
Wanderer:
Ah.. Well i the gun convergence script was a show off thing sort of 'But I can only show you the door. You're the one that has to walk through it.' to demonstrate what you can do with scripting... and of course to get more people 'to walk through the door' i.e., start experimenting on Lua scripts. It can be modified to work with multiple weapon classes too without copy pasteing it two times (by writing a bit longer script).
But (havent tested) it should work if you copy the actual convergence section (outlined below) and use the first one for Mesons and the second one for Tachyons.
--- Code: ---if missiontime > 0.5 then
...
<lots of stuff>
...
end
--- End code ---
Scooby_Doo:
Ahhh i think I see where
--- Code: ---if stringWeaponClass == "Corona" and numberWeaponLife > 0.2 then
--- End code ---
will be
--- Code: ---if stringWeaponClass == "Meson_dummy" or stringWeaponClass == "tachyon_dummy" or ...... and numberWeaponLife > 0.2 then
--- End code ---
and
--- Code: --- mn.createWeapon(tb.WeaponClasses["Halo"],orientationWeapon,vectorWeaponPosition,newshooter,-1)
--- End code ---
with
--- Code: ---if stringWeaponClass == "Meson_dummy" then
mn.createWeapon(tb.WeaponClasses["Meson_real"],orientationWeapon,vectorWeaponPosition,newshooter,-1)
else if if stringWeaponClass == "tachyon_dummy" then
mn.createWeapon(tb.WeaponClasses["tachyon_real"],orientationWeapon,vectorWeaponPosition,newshooter,-1)
....
else
mn.createWeapon(tb.WeaponClasses["default_real"],orientationWeapon,vectorWeaponPosition,newshooter,-1)
--- End code ---
Correct? I don't see anything else pretaining to the actual weapon, rest seems to be about vectors.
Wanderer:
Yeah.. Just make sure you get the booleans right though.
Navigation
[0] Message Index
[*] Previous page
Go to full version