Posts: 1,586
Threads: 85
Joined: Apr 2011
Reputation:
0
"...That will soon be removed, please notify the creator that <Text is cut off by in game window size>"
Which scripting technique is this referring to?
Posts: 2,843
Threads: 382
Joined: Jul 2012
Reputation:
0
(07-23-2011, 09:10 AM)Duck Wrote: "...That will soon be removed, please notify the creator that <Text is cut off by in game window size>"
Which scripting technique is this referring to?
Using sleep() for a period of time longer than 0.5 seconds in an event handler. It will give you a more detailed message in edit mode (if it's your game, of course.)
Posts: 1,586
Threads: 85
Joined: Apr 2011
Reputation:
0
(07-23-2011, 01:47 PM)Jacob_ Wrote: (07-23-2011, 09:10 AM)Duck Wrote: "...That will soon be removed, please notify the creator that <Text is cut off by in game window size>"
Which scripting technique is this referring to?
Using sleep() for a period of time longer than 0.5 seconds in an event handler. It will give you a more detailed message in edit mode (if it's your game, of course.)
How are we meant to make things with delays if we can't use sleep?
Posts: 823
Threads: 75
Joined: Apr 2011
Reputation:
0
(07-23-2011, 02:15 PM)Duck Wrote: (07-23-2011, 01:47 PM)Jacob_ Wrote: (07-23-2011, 09:10 AM)Duck Wrote: "...That will soon be removed, please notify the creator that <Text is cut off by in game window size>"
Which scripting technique is this referring to?
Using sleep() for a period of time longer than 0.5 seconds in an event handler. It will give you a more detailed message in edit mode (if it's your game, of course.)
How are we meant to make things with delays if we can't use sleep?
Notice "in an event handler".
Posts: 1,586
Threads: 85
Joined: Apr 2011
Reputation:
0
(07-23-2011, 02:19 PM)noob007 Wrote: (07-23-2011, 02:15 PM)Duck Wrote: (07-23-2011, 01:47 PM)Jacob_ Wrote: (07-23-2011, 09:10 AM)Duck Wrote: "...That will soon be removed, please notify the creator that <Text is cut off by in game window size>"
Which scripting technique is this referring to?
Using sleep() for a period of time longer than 0.5 seconds in an event handler. It will give you a more detailed message in edit mode (if it's your game, of course.)
How are we meant to make things with delays if we can't use sleep?
Notice "in an event handler".
"How am I meant to put a ten second delay in my function if I can't use sleep?" Happy?
Posts: 823
Threads: 75
Joined: Apr 2011
Reputation:
0
(07-23-2011, 02:22 PM)Duck Wrote: (07-23-2011, 02:19 PM)noob007 Wrote: (07-23-2011, 02:15 PM)Duck Wrote: (07-23-2011, 01:47 PM)Jacob_ Wrote: (07-23-2011, 09:10 AM)Duck Wrote: "...That will soon be removed, please notify the creator that <Text is cut off by in game window size>"
Which scripting technique is this referring to?
Using sleep() for a period of time longer than 0.5 seconds in an event handler. It will give you a more detailed message in edit mode (if it's your game, of course.)
How are we meant to make things with delays if we can't use sleep?
Notice "in an event handler".
"How am I meant to put a ten second delay in my function if I can't use sleep?" Happy?
If said function is an event handler (callback), then use something like game  cheduleTask()
Posts: 2,843
Threads: 382
Joined: Jul 2012
Reputation:
0
07-23-2011, 02:48 PM
(This post was last modified: 07-23-2011, 02:49 PM by Jacob__mybb_import1.)
(07-23-2011, 02:24 PM)noob007 Wrote: (07-23-2011, 02:22 PM)Duck Wrote: (07-23-2011, 02:19 PM)noob007 Wrote: (07-23-2011, 02:15 PM)Duck Wrote: (07-23-2011, 01:47 PM)Jacob_ Wrote: Using sleep() for a period of time longer than 0.5 seconds in an event handler. It will give you a more detailed message in edit mode (if it's your game, of course.)
How are we meant to make things with delays if we can't use sleep?
Notice "in an event handler".
"How am I meant to put a ten second delay in my function if I can't use sleep?" Happy?
If said function is an event handler (callback), then use something like game cheduleTask()
The preferred way is by using os.time(). It avoids the requirement of an extra thread.
[lua]
delay = 3 --3 seconds
lastCalled = os.time()
function doSomething()
if os.time() - lastCalled < delay then return end
--do stuff
lastCalled = os.time()
end
[/lua]
Posts: 823
Threads: 75
Joined: Apr 2011
Reputation:
0
Posts: 1,586
Threads: 85
Joined: Apr 2011
Reputation:
0
(07-23-2011, 02:48 PM)Jacob_ Wrote: (07-23-2011, 02:24 PM)noob007 Wrote: (07-23-2011, 02:22 PM)Duck Wrote: (07-23-2011, 02:19 PM)noob007 Wrote: (07-23-2011, 02:15 PM)Duck Wrote: How are we meant to make things with delays if we can't use sleep?
Notice "in an event handler".
"How am I meant to put a ten second delay in my function if I can't use sleep?" Happy?
If said function is an event handler (callback), then use something like game cheduleTask()
The preferred way is by using os.time(). It avoids the requirement of an extra thread.
[lua]
delay = 3 --3 seconds
lastCalled = os.time()
function doSomething()
if os.time() - lastCalled < delay then return end
--do stuff
lastCalled = os.time()
end
[/lua]
But doesn't that mean people could cheat / break a game by messing about with their clock
Posts: 2,843
Threads: 382
Joined: Jul 2012
Reputation:
0
(07-23-2011, 03:03 PM)Duck Wrote: (07-23-2011, 02:48 PM)Jacob_ Wrote: (07-23-2011, 02:24 PM)noob007 Wrote: (07-23-2011, 02:22 PM)Duck Wrote: (07-23-2011, 02:19 PM)noob007 Wrote: Notice "in an event handler".
"How am I meant to put a ten second delay in my function if I can't use sleep?" Happy?
If said function is an event handler (callback), then use something like game cheduleTask()
The preferred way is by using os.time(). It avoids the requirement of an extra thread.
[lua]
delay = 3 --3 seconds
lastCalled = os.time()
function doSomething()
if os.time() - lastCalled < delay then return end
--do stuff
lastCalled = os.time()
end
[/lua]
But doesn't that mean people could cheat / break a game by messing about with their clock
If they do then I'll just add some code that kicks them out if time goes backwards or unusually fast.
|