HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger Randomly not working

09-05-2004, 03:33 AM#1
Taelrie
This has been driving me crazy and I can't figure out why. I have completely isolated an action in a trigger, that should be working, but not only doesn't work but stops the rest of the trigger from working as well! This has happened me twice before, and ive fixed it both times by doing the same action a different way. However whatever I try this time I can't get it to work, and I was wondering if anybody has had this problem before. I have checked EVERYTHING, from the variables in the trigger, to changing the loops in the trigger, to changing the trigger itself, and everything checks out. I have even gone so far as to put actions that show in game before and after the action in question, and it doesn't even show the action afterwards (including everything else). Anyway if you see a problem with this please help me because im about to pull my hair out over this.

Code:
57 is the length of the string in question
69 is the length of the decoding and encoding strings, which is the point of this action (to check the encrypted part of each code and changing it with the unencrypted part)
Loadstring1 is the code that is being manipulated (and I have had it shown in game to see whether it is correct or not, and it is)
Loadstring3 is an empty string that the unencrypted part goes to.

For Each Integer a from 1 to 57 Do (For Each integer b from 1 to 69, do (If((Substring(LoadString1, (Integer A, Integer A))) Equal to (Substring(CodeSetEncrypted, (Integer B, Integer B)))

Then Do-
Set LoadString3 = LoadString3 + (SubString(CodeSetNormal, Integer B, Integer B)))

Else Do-

Nothing

The code seems that it should work fine, so I seriously doubt there is anything wrong there. The strangest thing about this is for the encryption part it is done EXACTLY the same way, just the variables for encryption/normal switched and the destination/source is different, and the encryption part works fine. If it matters im usin WEU, so it might be a bug in the system but at any rate HELP!
09-05-2004, 04:21 AM#2
Unknown6
try your code again skipping [if-then-else].
sometimes doesn't work with loops.

if still u can't find the bug, then check the code by short parts. Verify each variant every time it changes.