System Timer32

Nexor

...
Reaction score
74
it displays the following message:

"T32 ERROR: Struct #46 had startPeriodic called while already running!"

I'm using the 1.05 version of T32. Could it be the problem?
 

Nexor

...
Reaction score
74
my triggers are on the previous page, I don't see any reason why it is called multiple times...
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Would it be feasible, or even useful, for the whole T32 system to be a textmacro in order to instantiate the system at a different loop rate? eg. [ljass]//! runtextmacro "TX"(40)[/ljass] would create a library_once named T40 and period 0.02, or [ljass]//! runtextmacro "TX"(2)[/ljass] would create a library_once named T2 and period 0.5?
 

tooltiperror

Super Moderator
Reaction score
231
Would it be feasible, or even useful, for the whole T32 system to be a textmacro in order to instantiate the system at a different loop rate? eg. [ljass]//! runtextmacro "TX"(40)[/ljass] would create a library_once named T40 and period 0.02, or [ljass]//! runtextmacro "TX"(2)[/ljass] would create a library_once named T2 and period 0.5?

Are you thinking of a system to code timers in the vanilla world editor?
 

Jesus4Lyf

Good Idea™
Reaction score
397
Would it be feasible, or even useful, for the whole T32 system to be a textmacro in order to instantiate the system at a different loop rate? eg. [ljass]//! runtextmacro "TX"(40)[/ljass] would create a library_once named T40 and period 0.02, or [ljass]//! runtextmacro "TX"(2)[/ljass] would create a library_once named T2 and period 0.5?
It would be ironic to say the least.
Possible, but what's the point?
 

tooltiperror

Super Moderator
Reaction score
231
It would be ironic to say the least.
Possible, but what's the point?

Well, if I get what Weep is saying, it could possibly mean he is trying to use textmacroes to run the system in the normal editor without [LJASS]//! import[/LJASS]. Of course, I could be wrong.
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Would it be feasible, or even useful, for the whole T32 system to be a textmacro in order to instantiate the system at a different loop rate? eg. [ljass]//! runtextmacro "TX"(40)[/ljass] would create a library_once named T40 and period 0.02, or [ljass]//! runtextmacro "TX"(2)[/ljass] would create a library_once named T2 and period 0.5?

If you need to, you can always just create a separate timer, trigger, and module for it. (assuming you use that period frequently) Otherwise, you can use KT2, TimerUtils, or just an inlined T32.
 

Jesus4Lyf

Good Idea™
Reaction score
397
If you need to, you can always just create a separate timer, trigger, and module for it.
That's what he's suggesting. A textmacro to create it. It would just mean resources could be submitted using whatever period they like, and since it uses library_once, they would not conflict. It makes sense, if there is any purpose in having multiple periods, which is what I am trying to ask...
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Are you thinking of a system to code timers in the vanilla world editor?
No. I mean, [lJASS]//! runtextmacro[/lJASS]s and [lJASS]//! import[/lJASS] still require JassHelper, but actually, that's an interesting thought. It's completely unrelated to this question, though.

It makes sense, if there is any purpose in having multiple periods, which is what I am trying to ask...
T32 is supposedly the most efficient timer system possible, but only works for a single period. If someone wanted to use a different period, they couldn't use T32 without modifying its setting, which would possibly mess up any other imported resources using T32. Some people (like Viikuna and myself) like periods faster than 32/sec for sliding effects; also, some periodic effects don't need to be that fast.

Wouldn't it be more efficient, and possibly easier to implement, than KT2 to have a few T32-style systems running at specific, pre-specified periods, or than having a resource check the T32 tick and only execute every 3rd time?

I suppose you'd argue that any period faster than 32/sec is not noticeable (false) and any period longer than 32/sec probably needs to be exactly in phase with the start event (questionable), but, still I present my thinking behind the question.
 

Jesus4Lyf

Good Idea™
Reaction score
397
If someone wanted to use a different period, they couldn't use T32 without modifying its setting, which would possibly mess up any other imported resources using T32. Some people (like Viikuna and myself) like periods faster than 32/sec for sliding effects
In these cases, the authors should write the systems to be independent of the FPS of T32 - ie. they should perform calculations based on T32_PERIOD. This allows a map author to set T32_PERIOD to whatever they wish. So a slide system built on T32 would use whatever FPS the map author wishes - indeed, if the entire map runs too slow, just make T32 fire less frequently. Unfortunate that the resource name itself has "32" in it in hindsight.

also, some periodic effects don't need to be that fast.
This is the real thing I'm looking for. Can you give some examples?
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
This is the real thing I'm looking for. Can you give some examples?
Damage over time. Effects over time on units in an area. Detecting units entering an area (like auras). Checking for presence of a buff. Rapid but not OMG-FAST repeating special effects. The non-visual component of an in-a-line spell (32 enums/sec? Madness!) Very slow slides that don't need such a framerate to still look smooth, or sliding ribbon emitters (which themselves have an emission rate that is pointless to exceed). These are things that I tend to run at 0.1-0.25s.
 

baassee

Member
Reaction score
5
Lol DPS
real damage, real time, T32's Period 32FPS
damage * PERIOD / time same as (time / PERIOD) * damage ,to make it tick each interval but still do the same amount of damage

Just have a member and increase it and when it reaches a certain value (your 0.1-0.25) you set it to 0. and do your stuff, isn't that easy enough :D

EDIT: Soz, didn't notice the necro post.
 

koeienboei

Member
Reaction score
4
Hmm im not familiar with these modules and stuff. How do you write an easy loop with delay with this T32:

loop
move fireball
wait(0.01)
endloop
 

tooltiperror

Super Moderator
Reaction score
231
JASS:
library foo requires TimerUtils

	private struct Data

		private integer tick=0
		private unit    killer

		private method periodic takes nothing returns nothing
			set this.tick=.tick+T32_PERIOD
			if(tick==T32_FPS*5(then
				if (UnitAlive(this.killer)) then
					call KillUnit(this.killer)
					call this.stopPeriodic()
				endif
			endif
		endmethod

		private static method actions takes nothing returns nothing
			local thistype this=thistype.create()
			set this.killer=GetKillingUnit()
			call this.startPeriodic()
		endmethod

		private static method onInit takes nothing returns nothing
			// register a death event
			// register thistype.actions as a callback
		endmethod
	
		implement T32x // <--- that is what actually adds it

	endstruct

endlibrary


:thup:
 

Jesus4Lyf

Good Idea™
Reaction score
397
loop
move fireball
wait(0.01)
endloop
JASS:
struct Move
    real dx
    real dy
    unit subject
    private method periodic takes nothing returns nothing
        call SetUnitX(subject, GetUnitX(subject) + dx)
        call SetUnitY(subject, GetUnitY(subject) + dy)
    endmethod
    implement T32x
    private static method create takes unit which, real xPerSecond, real yPerSecond returns thistype
        local thistype this = thistype.allocate()
        set this.dx = xPerSecond * T32_PERIOD
        set this.dy = yPerSecond * T32_PERIOD
        set this.subject = which
        call this.startPeriodic()
        return thistype
    endmethod
    method destroy takes nothing returns nothing
        call this.stopPeriodic()
        call this.deallocate()
    endmethod
endstruct

I've written it freehand, but should work. Just use something like:
JASS:
local unit myFireball = // whatever, make some fireball.
local Slide s = Slide.create(myFireball, 1000, 500)
call TriggerSleepAction(2.0)
call s.destroy()
//remove fireball

That will move the fireball with a speed of 1000 x and 500 y for 2 seconds. Hope it helps. :thup:
 

koeienboei

Member
Reaction score
4
Hmm this should work pretty good, tyvm :)

1 problem, it sais im redeclaring method destroy :/

I tried making it private but didnt work + i cant find anything else that is called destroy in the jass compile screen
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!
  • The Helper The Helper:
    Happy Wednesday!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    Sticking with the desserts for now the latest recipe is Fried Apple Pies - https://www.thehelper.net/threads/recipe-fried-apple-pies.194297/
  • The Helper The Helper:
    Finally finding about some of the bots that are flooding the users online - bytespider apparently is a huge offender here - ignores robots.txt and comes in from a ton of different IPs
  • Monovertex Monovertex:
    @The Helper I'm really not seeing the "Signature" link in the sidebar on that page. Here's a screenshot:
  • The Helper The Helper:
    I have reported it - I was wondering why nobody I have given sigs to over the last few years have used them

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top