How can I add a delay between hudPrints in a script?
I tried sleep(), like in the cinematics but it didn't work. I really like the way mahric used delays in hudPrint in his/her mod "The wine merchants basement". I'm using counters and timers right now, but it's gets pretty convoluted. I'm thinking there must be an easier way.
As usual, thanks in advance.
how to build delay in lua script
-
Ryeath_Greystalk
- Posts: 366
- Joined: Tue Jan 15, 2013 3:26 am
- Location: Oregon
- Vice Dellos
- Posts: 47
- Joined: Thu Feb 28, 2013 12:56 pm
Re: how to build delay in lua script
I believe the only way is to use an external timer
so for example
and then link an timer to both the counter and the function
but I'm no expert
so for example
Code: Select all
function helloworld()
if counter_hello_world:getValue() == 1 then hudPrint("Hello")
elseif counter_hello_world:getValue() == 0 then hudPrint("world")
counter_hello_world:reset()
timer_hello_world:deactivate()
end
end
but I'm no expert
Re: how to build delay in lua script
If there's a lot of text you want to display, take a look at my source from my latest mod, the Awakening of Taarnab.Ryeath_Greystalk wrote:How can I add a delay between hudPrints in a script?
I tried sleep(), like in the cinematics but it didn't work. I really like the way mahric used delays in hudPrint in his/her mod "The wine merchants basement". I'm using counters and timers right now, but it's gets pretty convoluted. I'm thinking there must be an easier way.
As usual, thanks in advance.
It features a dialog window you can use with one easy function call. It's all in a script on level 2, top right part of the level, a scriptEntity called "neatDialog".
Please PM me if you need more help with that.
And if you want to stick with hudPrints, a timer and a counter is the shortest way I know of...
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
Re: how to build delay in lua script
if you want hudPrint to be used, then more timers are necessary. Or you can use some scripting like adviced by mahric or some GUI dialogue windows which is similar to it.
-
Ryeath_Greystalk
- Posts: 366
- Joined: Tue Jan 15, 2013 3:26 am
- Location: Oregon
Re: how to build delay in lua script
Thanks everyone.
I have been using counters and timers just like in your script Vice Dellos. Just time consuming to set up.
I will check out your source code Mahric and see if it's some simple enough for me to understand. BTW enjoying your Wine Merchants mod. I just fell down the pits into the prison area.
I have been using counters and timers just like in your script Vice Dellos. Just time consuming to set up.
I will check out your source code Mahric and see if it's some simple enough for me to understand. BTW enjoying your Wine Merchants mod. I just fell down the pits into the prison area.
