You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Define types for special variables TimerA and TimerB #220
Currently timera and timerb are predefined constants.
It seems like the types of underlaying variables should be predefined too, so there will be no need to add
var
TimerA : int
TimerB : int
end
to every script.
Maybe $ONMISSION (and other predefined variables) could be handled in same way too.
interesting. timers are usually used with number constants, like this:
TIMERA = 0
while TIMERA < 3000
wait 0
end
so the compiler would use integer opcodes. I agree in principle that they could be declared by default as int variables, just curious to see the code where it is needed.
File constants.txt is implicitly imported in any script as a source file. It means that it is possible to modify the content of it to include a var..end construct.
For example, for data\sa\constants.txt:
const
false=0
true=1
TIMERA=32@
TIMERB=33@
end
var
TimerA : int
TimerB : int
end
File constants.txt is implicitly imported in any script as a source file. It means that it is possible to modify the content of it to include a var..end construct.
For example, for data\sa\constants.txt:
const
false=0
true=1
TIMERA=32@
TIMERB=33@
end
var
TimerA : int
TimerB : int
end
Note to self: this breaks main.scm compilation as the compiler does not expect var..end to go before a DEFINE header.
Activity
x87 commentedon Mar 16, 2023
interesting. timers are usually used with number constants, like this:
so the compiler would use integer opcodes. I agree in principle that they could be declared by default as int variables, just curious to see the code where it is needed.
MiranDMC commentedon Mar 16, 2023
Real example:
0@ = DebugTimeOffset
0@ += TimerB
008F: 0@ = integer 0@ to_float
0@ *= 0.001 // ms to seconds
x87 commentedon May 7, 2023
File
constants.txtis implicitly imported in any script as a source file. It means that it is possible to modify the content of it to include a var..end construct.For example, for data\sa\constants.txt:
x87 commentedon May 7, 2023
Note to self: this breaks main.scm compilation as the compiler does not expect
var..endto go before a DEFINE header.