What I actually don't like about this burst weapon approach is the disabling of the weapon. This prevents the user from cancelling the weapon fire or changing the target while the weapon is "recharging". I don't have any idea on how to do it better, though, given Nexus' scripting limitations...
First off, just a quick note for those who d/l the new version. There's just a little typo in the 'DisableBurstWeapon' rule. The Timer command ends in a comma, not a semi:colon. So you'll just need to make a liitle edit before you run it.
Thanks, fixed that and another error in the LongRangeArrived rule and re-uploaded the script. I also changed some of the conditions to just check, if the device is part of the BurstWeapons-list instead of checking for each burst fire devicetype individually... makes expanding the script to apply to more weapon types easier, since you have to change fewer lines now.
And the first time I ran it, I did get an error where the mission editor got upset about an 'e.dev:device' not being valid, though I've not been able to reproduce it again. So hopefully it was just an odd quirk.
That sounds strange. I obviously haven't had time to extensively test the script, so I can't guarantee, there'll be absolutely no error.
My first efforts did involve using temporary variables (such as the E.******), but after about ten or so weapons things started to go wrong. My thought here was that sometimes a variable was being overwritten by a new firing event before the old one could be fully processed. Hence the use of permanant variables to keep track of things.
Event variables shouldn't be accidently overwritten - they only exist during that specific rule's execution. Even if you call that rule multiple times (like for several weapons), each call should use their own set of event variables. Of course, that's only my assumption based on past experiences and observation - I don't know about the inner workings of Nexus' script support, so there could be some sort of bug causing variables to leak into spaces they don't belong to.
ok, I'm a noob here, but what a hell I have to do to make it work? I already included this file in my mission script, and called that machine, replaced weapons with my own, but still no work, my weapons shoot as they originally supposed... btw, mission was created by nexus skirmisher...please help, cos I really love the idea of burst firing...
It's more of a modder's ressource and thus isn't as easily installed as an actual mod. I'll try to give a short guide:
(you'll need both Old Dragon's ppc.zip and my updated PPC.rar for this)
1. copy dev_weapons_new.ini to the mod's universetextstexts-folder
2. copy the contents of efx.ini to the mod's universeenginemod_efx.ini file
3. copy the contents of tacticstypes.ini to the mod's universetacticstacticstypes.ini (don't overwrite anything, just insert somewhere)
4. your mod may already have a DEVICETYPE 41 or DEVICETYPE 42, so change these two numbers of both inserted devicetypes to something, that's not being used already (e.g. for the Nexus Skirmisher mod, 360 and 361 work)
5. copy my ppc.mach to the mod's universemod_missions-folder
6. create a mission using the Skirmisher including a ship, that has the #weap_Light_PPC or #weap_Heavy_PPC onboard
7. open your mission file and include
GetMachine("PPC"):ChangeState(Default, 0); in the SceneInit-RULE
8. include
#include "PPC.mach" below the SceneInit-RULE
Repeat steps 6 to 8 for additional missions.