 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Mon Jun 28, 2004 12:52 pm Post subject: What was wrong with this? |
|
|
Okay, so I changed this script and it works okay now, but I'm curious as to why this would not work before. The following script was called as the map auto script. It was to make guards move in certain patterns such that you would have to avoid their sight.
Script, ..., begin
#defined some variables
while(currentmap==##),do
begin
#a bunch of bounds checks that are CORRECT, as I have not changed this part and now the script works just fine
end
end
Basically, the bounds checks are if commands, and if you are in a guard's line of sight, you are caught. The problem was that sometimes just using a door that went back and forth on the given map would make you automatically caught. I used the debugging thing and couldn't figure out what was wrong. However, I noticed that the scripts began piling on top of each other, as it was reloaded every time a door was passed. However, this never happened on coming into the map from another map, and it didn't always happen even on the same door. I would use a door, and either I was caught right away, or I could wait there all day and even though the script was checking over and over I was never caught. Does anyone have any idea about how this could have happened? |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Jul 01, 2004 6:53 pm Post subject: |
|
|
I assume that you also have an auto-run script on the map you are entering.
When you enter this map, the autorun script is loaded and starts running immediatly - the last script is halted and thus never gets the chance to discover that it is on a different map and quit. This repeats and the scripts build up. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Fri Jul 02, 2004 10:27 am Post subject: |
|
|
I see what you mean, but the door that I use leads from the map to itself, thus it is a copy of the same script that is re-loaded. Thus numerous copies of this script do begin to pile up, and that was bad anyway; another reason I changed the script. Still, it does not explain to me why I would sometimes be 'caught' upon using the door. That is to say, sometimes when I used a door from the map to itself, one of the if statements must have somehow received a 'true', even though I was never on any of the tiles that would have been checked by the bounds checks within the if brackets. |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|