CLEO Help Label-based timer

CLEO related
Status
Not open for further replies.

mpol77

Active member
Joined
Oct 24, 2018
Messages
66
Reaction score
6
:marker
33@ = 0
31@ = Marker.CreateAboveActor(0@)
wait 5000
Marker.Disable(31@)
0AB2: ret 0

the issue with this code is that i can't call @marker from elsewhere while the "wait 5000" is going on, any way to bypass that?
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
you could use these opcodes:
0C6A: 0@ = create_custom_thread_at_label @new_thread_label // instead of "0AB1: call_scm_func"
0C6C: set_thread 0@ local_var 0 = 1@ // 1@ is passed to the new thread (it becomes 0@ variable there)
0A93: end_custom_thread // instead of "0AB2: ret"

So instead of calling a function, you'd create a separate thread at a label. This thread will not block the main code (even when it's using "wait"), so you'll be able to create multiple threads, running at the same time
 

mpol77

Active member
Joined
Oct 24, 2018
Messages
66
Reaction score
6
you could use these opcodes:
0C6A: 0@ = create_custom_thread_at_label @new_thread_label // instead of "0AB1: call_scm_func"
0C6C: set_thread 0@ local_var 0 = 1@ // 1@ is passed to the new thread (it becomes 0@ variable there)
0A93: end_custom_thread // instead of "0AB2: ret"

So instead of calling a function, you'd create a separate thread at a label. This thread will not block the main code (even when it's using "wait"), so you'll be able to create multiple threads, running at the same time

can't find 0C6A nor 0C6C, you sure its a sanny builder native opcode?

use timer variables
32@ or 33@

how'd u do it without blocking the main thread?
 

mpol77

Active member
Joined
Oct 24, 2018
Messages
66
Reaction score
6
0A92: create_custom_thread "extension.s" 0@

found something, this is working just fine and its w/o sampfuncs, but it can sometimes make my game freeze, for some reason, so yeah the hereinbefore questions are still up
 
Last edited:
Status
Not open for further replies.
Top