![]() |
Script Halting
I'm wondering if there would be any way to halt a script at a certain point until some trigger is activated. I'm making a default GUI dialog set like JOptionPane in Java, and I want the player to be able to enter the value before the return is executed.
|
Stefan said something about adding a command to stop NPCs while they're being modified..
|
timeout()?
timeout with an if (flag)? onKeypressed()? event block with an if (flag)? even if there isn't a command specifically designed to do this particular thing, there are other ways to do it. |
Quote:
It could be useful to have a way to pause a script, but the problem lies in deciding what should make the script resume. |
horribly simple way of doing it based on one of the suggestions i posted earlier:
NPC Code: |
I think JOptionPane works a little like the Windows Form (in Java/C#) 'MessageBox'. The function halts until, for example, input is recieved. i.e
PHP Code:
|
I don't want to use a loop.
That = bad for what I want. And Napo is exactly right, the function needs to halt until you get the input. |
Quote:
in gs1: if (created) { this.running=1; timeout=.05; } if (playerchats) { if (strequals(#c,run)) { this.active=1; timeout=.05; }elseif (strequals(#c,stop)) this.active=0; } if (timeout && this.active==1) { //script timeout=.05; } |
Quote:
But if there were some way to make Inverness' request work, that would be better than the timeout. |
Yes, though you could do that for everything else as well.
like i said before, even if there isn't a command specifically designed to do this particular thing, there are other ways to do it. |
All times are GMT +2. The time now is 10:51 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.