Unlisted
No Tags
Auto Credit Based on hpgbproductions's cannon timer test rig
- PreviousAmmo: Set the previous ammo value to the current ammo at the start or when the activator state changed, so the timer isn't restarted in those scenarios.
- CannonActivator: Cannon activation variable. Remember to set the cannon activation group to this variable.
- CannonActivatorChanged: 1 if the activator state changed, else 0.
- AmmoChanged: 0 if the activator state changed. This prevents the timer from restarting. Else, 1 if the ammo changed. Else 0.
- PreviousAmmo: Update the "previous" value for the next frame
- PreviousCannonActivator: Update the "previous" value for the next frame
- TimeSinceAmmoChanged: The variable you can use in a label
Specifications
General Characteristics
- Predecessor cannon timer test rig
- Created On Android
- Wingspan 1.6ft (0.5m)
- Length 19.7ft (6.0m)
- Height 3.3ft (1.0m)
- Empty Weight 703lbs (319kg)
- Loaded Weight 703lbs (319kg)
Performance
- Wing Loading N/A
- Wing Area 0.0ft2 (0.0m2)
- Drag Points 505
Parts
- Number of Parts 5
- Control Surfaces 0
- Performance Cost 44
@Akashenik yep, your code is simpler. I use that structure a lot, but not here for some reason
I don't remember who I made this build for, having to support activation groups complicates things
Unlisted but it's the top search result💀
Anyways, I simplified the code to one line:
-
smooth(rate(ammo("name")) < 0 ? 2 : 0, rate(ammo("name")) < 0 ? 10000 : 1)
-
Where "name" is the name of the weapon; the "2" is number to count from (the "0" that's not in a conditional is the target value; so in this case you count down from 2 to 0); the "10000" is any arbitrary large number (this is how fast the timer resets. 10000 = 0.0001s); and the "1" is the counting rate (1 = 1 count per second; 10 = 10 counts per second, etc. (don't know why one would want to change the counting rate though)).