Frame Timer Bundle

This is a very simple timer that counts game frames rather than real-time seconds:

Code
{"data":{"behavior":{"v":"2","nodes":[{"inputCount":6,"outputCount":2,"name":"Frame Timer","behaviorType":"logic.NodeGroup","x":180,"y":96,"id":"77e1d1dcee404b44","isMenuItem":false},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":0,"y":0,"group":"77e1d1dcee404b44","id":"77e1d1dc1615f74a","startVal":0,"tag":"(0,0)","roundMode":1},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":180,"y":96,"group":"77e1d1dcee404b44","id":"77e1d1dc85f34747","portId":"77e1d1dcee404b44i0","tag":"Delay","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":180,"y":160,"group":"77e1d1dcee404b44","id":"77e1d1dc14425b4c","portId":"77e1d1dcee404b44i1","tag":"Repeat Count","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":180,"y":224,"group":"77e1d1dcee404b44","id":"77e1d1dc5a70e44e","portId":"77e1d1dcee404b44i2","tag":"Pause","dataType":2},{"expression":"(B%A)==0?1:0","default0":1,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":2,"version":2,"tag":"Frame Delay","inputCount":3,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":1080,"y":480,"group":"77e1d1dcee404b44","id":"77e1d1dcb86cba44"},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":1440,"y":448,"group":"77e1d1dcee404b44","id":"77e1d1dcfe23e847","startVal":0,"tag":"Output Number","roundMode":1},{"gateVal":1,"mode":"equal to","inputCount":2,"outputCount":2,"name":"Filter","behaviorType":"logic.logic.Filter","x":1260,"y":512,"group":"77e1d1dcee404b44","id":"77e1d1dc298a1741"},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":360,"y":416,"group":"77e1d1dcee404b44","id":"77e1d1dc80adf642","startVal":0,"tag":"Reset","roundMode":1},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":1620,"y":352,"group":"77e1d1dcee404b44","id":"77e1d1dd6859e746","portId":"77e1d1dcee404b44o0","tag":"Out#","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":180,"y":288,"group":"77e1d1dcee404b44","id":"77e1d1dd37f08d41","portId":"77e1d1dcee404b44i3","tag":"Resume","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":180,"y":352,"group":"77e1d1dcee404b44","id":"77e1d1ddb7e0d541","portId":"77e1d1dcee404b44i4","tag":"Reset","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":180,"y":416,"group":"77e1d1dcee404b44","id":"77e1d1dd5df2504d","portId":"77e1d1dcee404b44i5","tag":"Start","dataType":2},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":540,"y":576,"group":"77e1d1dcee404b44","id":"77e1d1dd593c3645","_startVal":1,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":360,"y":608,"group":"77e1d1dcee404b44","id":"77e1d1dd20357940","_startVal":0,"dataType":2},{"inputCount":0,"outputCount":1,"name":"Always","behaviorType":"logic.triggers.Always","x":180,"y":640,"group":"77e1d1dcee404b44","id":"77e1d1dda73ce549"},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":1980,"y":640,"group":"77e1d1dcee404b44","id":"77e1d1dd495e254a","portId":"77e1d1dcee404b44o1","tag":"Done","dataType":2},{"expression":"B==A?1:0","default0":1,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":2,"version":2,"tag":"==Repeat Count?","inputCount":3,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":1620,"y":416,"group":"77e1d1dcee404b44","id":"77e1d1dd681cd444"},{"gateVal":0,"mode":"greater than","inputCount":2,"outputCount":2,"name":"Filter","behaviorType":"logic.logic.Filter","x":540,"y":224,"group":"77e1d1dcee404b44","id":"77e1d1ddc618344e"},{"expression":"Math.round((Math.max(A,0)),1)","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":1,"version":2,"tag":"Nearest Positive Integer","inputCount":2,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":360,"y":192,"group":"77e1d1dcee404b44","id":"77e1d1dd6744454b"},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":900,"y":512,"group":"77e1d1dcee404b44","id":"77e1d1dd826af149","startVal":0,"tag":"Frame Number","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":720,"y":544,"group":"77e1d1dcee404b44","id":"77e1d1dd90966b48","_startVal":1,"dataType":2},{"gateVal":1,"mode":"equal to","inputCount":2,"outputCount":2,"name":"Filter","behaviorType":"logic.logic.Filter","x":1800,"y":448,"group":"77e1d1dcee404b44","id":"77e1d1dd67971b43"},{"expression":"Math.round((Math.max(A,1)),1)","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":1,"version":2,"tag":"Nearest Positive Integer Excluding 0","inputCount":2,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":360,"y":96,"group":"77e1d1dcee404b44","id":"77e1d1dd0c9ffc4f"}],"links":[{"input_id":"77e1d1dd0c9ffc4fi0","output_id":"77e1d1dc85f34747o0"},{"input_id":"77e1d1dd0c9ffc4fi1","output_id":"77e1d1dc85f34747o0"},{"input_id":"77e1d1dd6744454bi0","output_id":"77e1d1dc14425b4co0"},{"input_id":"77e1d1dd6744454bi1","output_id":"77e1d1dc14425b4co0"},{"input_id":"77e1d1dd593c3645i0","output_id":"77e1d1dc5a70e44eo0"},{"input_id":"77e1d1dc298a1741i0","output_id":"77e1d1dcb86cba44o0"},{"input_id":"77e1d1dd6859e746i0","output_id":"77e1d1dcfe23e847o0"},{"input_id":"77e1d1dd681cd444i1","output_id":"77e1d1dcfe23e847o0"},{"input_id":"77e1d1dd681cd444i2","output_id":"77e1d1dcfe23e847o0"},{"input_id":"77e1d1dcfe23e847i2","output_id":"77e1d1dc298a1741o0"},{"input_id":"77e1d1dcfe23e847i0","output_id":"77e1d1dc80adf642o0"},{"input_id":"77e1d1dd826af149i0","output_id":"77e1d1dc80adf642o0"},{"input_id":"77e1d1dd593c3645i1","output_id":"77e1d1dc80adf642o0"},{"input_id":"77e1d1dd593c3645i1","output_id":"77e1d1dd37f08d41o0"},{"input_id":"77e1d1dc80adf642i1","output_id":"77e1d1ddb7e0d541o0"},{"input_id":"77e1d1dd20357940i0","output_id":"77e1d1ddb7e0d541o0"},{"input_id":"77e1d1dc80adf642i1","output_id":"77e1d1dd5df2504do0"},{"input_id":"77e1d1dd20357940i1","output_id":"77e1d1dd5df2504do0"},{"input_id":"77e1d1dd90966b48i2","output_id":"77e1d1dd593c3645o0"},{"input_id":"77e1d1dd593c3645i2","output_id":"77e1d1dd20357940o0"},{"input_id":"77e1d1dd20357940i2","output_id":"77e1d1dda73ce549o0"},{"input_id":"77e1d1dd67971b43i0","output_id":"77e1d1dd681cd444o0"},{"input_id":"77e1d1dd681cd444i0","output_id":"77e1d1ddc618344eo0"},{"input_id":"77e1d1dd90966b48i1","output_id":"77e1d1ddc618344eo0"},{"input_id":"77e1d1dd90966b48i0","output_id":"77e1d1ddc618344eo1"},{"input_id":"77e1d1ddc618344ei0","output_id":"77e1d1dd6744454bo0"},{"input_id":"77e1d1dcb86cba44i1","output_id":"77e1d1dd826af149o0"},{"input_id":"77e1d1dcb86cba44i2","output_id":"77e1d1dd826af149o0"},{"input_id":"77e1d1dd826af149i2","output_id":"77e1d1dd90966b48o0"},{"input_id":"77e1d1dc80adf642i1","output_id":"77e1d1dd67971b43o0"},{"input_id":"77e1d1dd20357940i0","output_id":"77e1d1dd67971b43o0"},{"input_id":"77e1d1dd495e254ai0","output_id":"77e1d1dd67971b43o0"},{"input_id":"77e1d1dcb86cba44i0","output_id":"77e1d1dd0c9ffc4fo0"}]}}}

I just figured I’d share this since I find it pretty useful to have a timer that stays consistent with the game’s framerate. It’s especially good for weapon fire rates and things like that (which can start to trigger too often with a normal timer when a game lags a lot).
This timer bundle also includes inputs and outputs that I would love to have on the normal Timer behavior (Repeat Count, Pause, Resume, Output Number, and Done).

6 Likes

I’ve been using one of these for a while, really useful

2 Likes