currently, the weapon fires at the start of the animation
"interval" is the number of ms between animation frames
"msPerShot" is the amount of animation in ms that each shot causes
"loop" determines whether the weapon's animation should reset between firing. So if it's set to true, firing will simply advance the animation by "msPerShot" frames. If it's set to false, the animation will reset to the first frame and then play msPerShot frames.
finishLoopCycle indicates whether the animation should always complete its loop.
So the reason for all of these settings is that there can be weapons where the reload time is greater or lesser than the animation time, and weapons where we want the animation to return to their base state at the end.
So here's some examples:
Let's take a weapon where the animation has 4 frames, ABCD, the interval is 50 ms and the reload time is 100 ms. It fires twice in a row.
Notation: uppercase letters denote frames where the weapon fires.
loop=true, finishLoopCycle=false, msPerShot=50:
aBbCd -- Two shots, each advancing the animation by two frames.
loop=true, finishLoopCycle=true, msPerShot=50:
aBbCda -- Same as above, but we return to the start of the loop at the end.
loop=true, finishLoopCycle=true, msPerShot=150:
aBbCdabcda -- The second shot started a second loop cycle.
loop=false, msPerShot=200:
aBcAbcd -- The weapon fires faster than its animation, and so it's reset to the start by the second shot. It's not set to finish its loop cycle, so it stays at frame D until the next shot.
A second weapon, where the animation has 4 frames, ABCD, the interval is 50 ms and the reload time is 400 ms. It fires twice in a row.
loop=true, finishLoopCycle=true, msPerShot=50:
aBcdaaaaBcda -- Even though it's only meant to advance by 1 frame per shot, we set it to finish its loop cycle, so it goes all the way around to frame A after each shot.
loop=true, finishLoopCycle=false, msPerShot=50:
aBbbbbbbC -- Advancing one frame per shot. An example here would be a revolver where each shot lines up the next chamber for firing.
loop=true, finishLoopCycle=false, msPerShot=150:
aBcddddAbc -- Each shot advances the animation by 3 frames, so nearly all the way around, but not quite.
loop=false, msPerShot=200:
aBcdaaaaBcda -- Each shot does one full animation. This has the same effect as the example above, but for different reasons.
loop=false, msPerShot=100
aBccccccBc -- This is badly set up, as frame D never actually gets used, and frame A is never seen again after the first shot.
Zarkonnen can i send you my mod so you can troubleshoot it because i don't know whats wrong with it, every time i get a loading error, i already deleted 2 whole weapon designs because i thought i did something wrong and i'm ANGRY because it doesn't work.
Warrant Officer
Is it posible to make a weapon fire at the end or start of an animation?
And can i make that animation loop before it fires?
Also could someone explain what these 4 lines do?
"interval"
"loop"
"finishLoopCycle"
"msPerShot
And can place crew in a certain position in your module?
Aerial Emperor
So the reason for all of these settings is that there can be weapons where the reload time is greater or lesser than the animation time, and weapons where we want the animation to return to their base state at the end.
So here's some examples:
Let's take a weapon where the animation has 4 frames, ABCD, the interval is 50 ms and the reload time is 100 ms. It fires twice in a row.
Notation: uppercase letters denote frames where the weapon fires.
loop=true, finishLoopCycle=false, msPerShot=50:
aBbCd -- Two shots, each advancing the animation by two frames.
loop=true, finishLoopCycle=true, msPerShot=50:
aBbCda -- Same as above, but we return to the start of the loop at the end.
loop=true, finishLoopCycle=true, msPerShot=150:
aBbCdabcda -- The second shot started a second loop cycle.
loop=false, msPerShot=200:
aBcAbcd -- The weapon fires faster than its animation, and so it's reset to the start by the second shot. It's not set to finish its loop cycle, so it stays at frame D until the next shot.
A second weapon, where the animation has 4 frames, ABCD, the interval is 50 ms and the reload time is 400 ms. It fires twice in a row.
loop=true, finishLoopCycle=true, msPerShot=50:
aBcdaaaaBcda -- Even though it's only meant to advance by 1 frame per shot, we set it to finish its loop cycle, so it goes all the way around to frame A after each shot.
loop=true, finishLoopCycle=false, msPerShot=50:
aBbbbbbbC -- Advancing one frame per shot. An example here would be a revolver where each shot lines up the next chamber for firing.
loop=true, finishLoopCycle=false, msPerShot=150:
aBcddddAbc -- Each shot advances the animation by 3 frames, so nearly all the way around, but not quite.
loop=false, msPerShot=200:
aBcdaaaaBcda -- Each shot does one full animation. This has the same effect as the example above, but for different reasons.
loop=false, msPerShot=100
aBccccccBc -- This is badly set up, as frame D never actually gets used, and frame A is never seen again after the first shot.
Warrant Officer
Zarkonnen can i send you my mod so you can troubleshoot it because i don't know whats wrong with it, every time i get a loading error, i already deleted 2 whole weapon designs because i thought i did something wrong and i'm ANGRY because it doesn't work.
Commodore
Thanks for the descriptions, Zarkonnen.
Aerial Emperor
WereCat88 - yes, absolutely. Email it here and I'll be happy to take a look. :)