| View previous topic :: View next topic |
| Author |
Message |
Meatballsub Divine Bovine

Joined: 16 Jun 2003 Posts: 437 Location: Northwest Georgia
|
|
| Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Fri Sep 07, 2007 9:56 am Post subject: |
|
|
Sounds like read timer is goofing up somehow. Try inserting
show value (read timer(0))
right before the if check. This will let us see exactly what number we're getting here.
PS: This is generally a good idea. When stuff isn't going right, try running your variables/numbers through a show value command. It is probably your best friend ever in terms of finding/fixing scripting bugs. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
| Back to top |
|
 |
Meatballsub Divine Bovine

Joined: 16 Jun 2003 Posts: 437 Location: Northwest Georgia
|
|
| Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Fri Sep 07, 2007 10:14 am Post subject: |
|
|
Hey, wasn't there a command to write to the debug file? There should be. It would make debugging much easier. _________________
|
|
| Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Fri Sep 07, 2007 12:03 pm Post subject: |
|
|
| 'plot:trace' |
|
| Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Fri Sep 07, 2007 12:06 pm Post subject: |
|
|
Wow this is really weird. Sounds like a bug, really. Can anybody confirm that if checks work correctly when the condition is 0==0? Because that's what we have right now, and apparently the code is not getting run... I'm going to try it on RC3 (that's what I have handy right now)
Okay just did it, and 0==0 checks out as true in RC3. MBSub, try putting showvalue(123) inside the if block (right before the variable declarations) and let us know if 123 ever shows up in the bottom corner. Do not get rid of the other show value command. We need both to really see which parts of the script are being run. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
| Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Fri Sep 07, 2007 12:35 pm Post subject: |
|
|
Oh! Hey! I just remembered something cool! TeeEmCee re-wrote the "script debugging mode" for Ubersetzung. If you have debugging keys enabled, press F10 twice, and your script will pause. Then you can press any key to step through it one-frame-at-a-time, while displaying some information about the currently-running commands.
Try it, and see if it is helpful |
|
| Back to top |
|
 |
Meatballsub Divine Bovine

Joined: 16 Jun 2003 Posts: 437 Location: Northwest Georgia
|
Posted: Fri Sep 07, 2007 1:20 pm Post subject: |
|
|
| Code: | script,minetimer,begin
if (read timer (0) == (0)) then (
show value (123)
variable (i,tag)
for (i,0,35) do,begin
tag:=read npc(i,11) + 1000
show value (read timer(0))
if (tag >> 1000) then, begin
set tag (tag,off)
end
end
set timer (0,60,timer:default,@resetstring,1,timer flag:battle)
$2="Ores reset in "
show string at (2,150,190)
show string at (1,280,190)
)
end
script,resetstring,begin
clear string (2)
clear string (1)
end |
Maybe I did something in the code wrong, but it won't even show the "123" value as it just stays "0". _________________ MOCBJ Software - My Games
The Hamster Wheel - OHRRPGCE Information Database
Last edited by Meatballsub on Sat Sep 08, 2007 6:39 am; edited 1 time in total |
|
| Back to top |
|
 |
Meatballsub Divine Bovine

Joined: 16 Jun 2003 Posts: 437 Location: Northwest Georgia
|
Posted: Fri Sep 07, 2007 1:21 pm Post subject: |
|
|
| James Paige wrote: | Oh! Hey! I just remembered something cool! TeeEmCee re-wrote the "script debugging mode" for Ubersetzung. If you have debugging keys enabled, press F10 twice, and your script will pause. Then you can press any key to step through it one-frame-at-a-time, while displaying some information about the currently-running commands.
Try it, and see if it is helpful |
Thanks, I will give it a shot  _________________ MOCBJ Software - My Games
The Hamster Wheel - OHRRPGCE Information Database |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Sep 07, 2007 6:07 pm Post subject: |
|
|
Oh, wait a moment. Timers count down to -1. The idea was that they show 0 for a second before actually triggering whatever when they hit -1. So just change the first if to "if (read timer (0) <= 0)"
(msw meant for you to put the "show value (read timer(0))" before the very first if, so that it's shown every time the script runs)
| Meatballsub wrote: | | James Paige wrote: | Oh! Hey! I just remembered something cool! TeeEmCee re-wrote the "script debugging mode" for Ubersetzung. If you have debugging keys enabled, press F10 twice, and your script will pause. Then you can press any key to step through it one-frame-at-a-time, while displaying some information about the currently-running commands.
Try it, and see if it is helpful |
Thanks, I will give it a shot  |
Unfortunately, it's pretty unfinished. And undocumented! Actually, I'm going to fix that now. Anyway, this probably isn't a situation suited to using the debugger. But this give me an idea: I'll add a mode to the debugger for looking at the state of timers. _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Fri Sep 07, 2007 6:52 pm Post subject: |
|
|
Are you kidding me? How did I miss that misplacement when he posted the new script? I guess because he had already told me that it was returning zero, and I didn't even think about it being incorrectly placed. Well, the important thing is that the problem should now be solved. And we may have gotten improvements to the debugger out of it all. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
| Back to top |
|
 |
Meatballsub Divine Bovine

Joined: 16 Jun 2003 Posts: 437 Location: Northwest Georgia
|
|
| Back to top |
|
 |
|