Hey guys, i'm back (sorry so quickly lol)
Maybe my brain is just tired but this seems like it should be a hell of a lot easier than it is turning out to be ... anyway - the issue:
If (something) {
text overlay displays
}
however, i only want that overlay to display for one second then go away. Keep in mind, please, that I do not want to use the wait command because I do not want other scripting to halt. Also, keep in mind that this will not (and can not) go in the RepExec section of the script. (it is currently in a hotspot interaction part of the script)
Again, I know this is probably simple ... but my brain gave me the finger so i'm turning to you guys for your help. Thanks.
Quote from: DrewCCU on Fri 07/05/2010 01:38:00
Hey guys, i'm back (sorry so quickly lol)
Maybe my brain is just tired but this seems like it should be a hell of a lot easier than it is turning out to be ... anyway - the issue:
If (something) {
text overlay displays
}
however, i only want that overlay to display for one second then go away. Keep in mind, please, that I do not want to use the wait command because I do not want other scripting to halt. Also, keep in mind that this will not (and can not) go in the RepExec section of the script. (it is currently in a hotspot interaction part of the script)
Again, I know this is probably simple ... but my brain gave me the finger so i'm turning to you guys for your help. Thanks.
I'm guessing it's a text overlay.
if (something) {
Overlay* myOverlay = Overlay.CreateTextual(50,80,120, Game.SpeechFont, 15,"This is a text overlay");
Wait(40);
myOverlay.Remove();
}
http://www.adventuregamestudio.co.uk/manual/Overlay.CreateTextual.htm
http://www.adventuregamestudio.co.uk/manual/Overlay.CreateGraphical.htm
Quote from: Dualnames on Fri 07/05/2010 01:42:18
Quote from: DrewCCU on Fri 07/05/2010 01:38:00
Hey guys, i'm back (sorry so quickly lol)
Maybe my brain is just tired but this seems like it should be a hell of a lot easier than it is turning out to be ... anyway - the issue:
If (something) {
text overlay displays
}
however, i only want that overlay to display for one second then go away. Keep in mind, please, that I do not want to use the wait command because I do not want other scripting to halt. Also, keep in mind that this will not (and can not) go in the RepExec section of the script. (it is currently in a hotspot interaction part of the script)
Again, I know this is probably simple ... but my brain gave me the finger so i'm turning to you guys for your help. Thanks.
I'm guessing it's a text overlay.
if (something) {
Overlay* myOverlay = Overlay.CreateTextual(50,80,120, Game.SpeechFont, 15,"This is a text overlay");
Wait(40);
myOverlay.Remove();
}
http://www.adventuregamestudio.co.uk/manual/Overlay.CreateTextual.htm
http://www.adventuregamestudio.co.uk/manual/Overlay.CreateGraphical.htm
I don't want to use the Wait command because i do not want scripting to halt while this text is displayed. Yes. it is a text overlay.
int sth;
if (something) {
Overlay* myOverlay = Overlay.CreateTextual(50,80,120, Game.SpeechFont, 15,"This is a text overlay");
while (sth!=40) {
sth++;
}
myOverlay.Remove();
}
Dual, that won't work. The while loop just contributes nothing to the game's elapsed time. It's still in that single frame of display.
1. The overlay pointer has to be declared outside of any function, otherwise it would be destroyed once the function finished executing.
Overlay* myOverlay;
2. At where you want stuff to happen:
if (something) {
MyOverlay = Overlay.CreateTextual(50,80,120, Game.SpeechFont, 15,"This is a text overlay");
SetTimer (1, 40);
}
3. Then in repeatedly_execute[_always]():
if (IsTimerExpired(1)) myOverlay.Remove();
Right my bad, indeed. Gilbet is 100% right. Gah, I'm so fast sometimes, I forgot to think.
Quote from: Gilbet V7000a on Fri 07/05/2010 01:49:41
Dual, that won't work. The while loop just contributes nothing to the game's elapsed time. It's still in that single frame of display.
1. The overlay pointer has to be declared outside of any function, otherwise it would be destroyed once the function finished executing.
Overlay* myOverlay;
2. At where you want stuff to happen:
if (something) {
MyOverlay = Overlay.CreateTextual(50,80,120, Game.SpeechFont, 15,"This is a text overlay");
SetTimer (1, 40);
}
3. Then in repeatedly_execute[_always]():
if (IsTimerExpired(1)) myOverlay.Remove();
ah thanks. you guys rock.