Lua theme items
Moderator: Forum Moderators
Lua theme items
I need my code to get executed every millisecond-second. The only lua theme item that seems to refresh that often is the timer (report_countdown), which updates every 10 milliseconds. The problem is however that in both local and lan games this code seems to work even with the timer turned off, but in online multiplayer it almost instantenously causes oos. Is there any workaround for this and if there isn't, is there any way to enforce using the timer on the user when they're using my mp modification?
Thanks.
Thanks.
Re: Lua theme items
You should describe here why you want to run code so often. If only problem is that timer must be on, then you can end_level if it is off.
Re: Lua theme items
Thanks for the second idea. I need this for my trolling mod... It listens for events that trigger the trolling reactions, waits 3 seconds, displays the trolling message then only after a user specified interval can another trolling message appear.
Re: Lua theme items
have you tried synchronize choice on it?
It looks to me like it should work fine till trolling message after 3 seconds, but it will have problem with user specified interval... I'm not sure but I think that if you put your message into some event... and fire event instead of just [chat].. ([event] name.. [chat]... [/event] and use with [fire_event])
Because my unlimited timer seem to work without OOS only because it starts timing on turn refresh event... which happens on all clients at the same time... so i think it should work if you put everything that needs timing into events.. (at least in 1.12 my timer used to work, no idea for 1.14... havent tried it..) But who knows... whoooooooooo knows... i was surprized that i didnt need to synchronize choice my unlimited timer.. no idea why it works without oos... assume it's because everything that is timed is in events.. but idk..
Re: Lua theme items
I'm not sure if you understand, though... It does work, but only if the user switches the timer on.
Re: Lua theme items
I guess you are still thinking that unlimited timer is using default timer.. how is the timer related at all? You can create your own timer! That's what unlimited timer does, it does not use built-in default timer...
Re: Lua theme items
That's next to impossible though... As far as I know, because there are too many factors in the c++ code you can't simulate in lua, it's basically trying to simulate a lot of variables in your add-on using WML events and so on which is really weird, but if I remember correctly you can't do it anyway... But I'll check out your add-on.
EDIT: Oooh, I see your add-on actually removes those variables. I'll take a look at the code. Thanks!
EDIT: Oooh, I see your add-on actually removes those variables. I'll take a look at the code. Thanks!