Easygoing Eyebeast Thralni Posted April 6, 2007 Share Posted April 6, 2007 I have a puzzle in which has to be hecked whether or not a certain item is on a certain spot. However, it fails to work correctly. The relevant bit of code is here: Code: beginstate START_STATE;if (get_flag(13,5) == 0 && item_of_class_on_spot(26,33,1) == 1); set_flag(13,5,1);if (get_flag(13,5) == 4 && item_of_class_on_spot(34,33,2) == 1); set_flag(13,5,5);break; The first if-call checks for a slith spear, the second one for a greatsword. Can enybody see what is wrong in this script that it might not work? If somebod knows a better way to do the same, I would very appreciate it if he told me how to, as this call does actually not do exactly what I want it to do. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted April 6, 2007 Share Posted April 6, 2007 The item_of_class_on_spot() call only checks for items of that special class, set by it_special_class. Did you redefine the greatsword and slith spear so that this property is set to 2 and 1 respectively on these items? Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Thralni Posted April 6, 2007 Author Share Posted April 6, 2007 Woops, I didn't know that was necessary. I'll do it right away. Thanks! EDIT: Hmmm, still doesn't seem to work right. I probably did something wrong: datascript: Code: // *** ITEMS ***// Slith spear and greatswordbegindefineitem 445; import = 371; it_special_class = 1;begindefineitem 446; import = 61; it_special_class = 2; townscript: Code: beginstate START_STATE;if ((get_flag(13,5) == 0) && (item_of_class_on_spot(26,33,1) == 1)) { set_flag(13,5,1);}if ((get_flag(13,5) == 4) && (item_of_class_on_spot(34,33,2) == 1)) { set_flag(13,5,5);}break; I put a print_num(num) call at the first if-call of the START_STATE, to see if it's triggered at all, and it's not. I think everything is right now, yet it doesn't work. What can be the problem now? Yes, I did put the right items in the town (445 and 446). Quote Link to comment Share on other sites More sharing options...
Unflappable Drayk Lazarus. Posted April 6, 2007 Share Posted April 6, 2007 Remove the flag checks and put a print_str() in each of the item checks, just to see what the problem is. It looks like it should work, perhaps the flags are just messed up. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Ephesos Posted April 6, 2007 Share Posted April 6, 2007 Quote: Originally written by The Gators Win it All....... Again:perhaps the flags are just messed up. I bet this is it. Try it out with a fresh party, or manually reset the flag via character editor for whatever save you're using for testing. (It really helps to search your other scripts for places where you might've accidentally set one of those flags. That's happened to me a few times now.) Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Thralni Posted April 6, 2007 Author Share Posted April 6, 2007 Okay, I'll try that. I, too, thought it might be the flags, although I really doubt it. I will do that sometime tomorrow, as the party of last night, the beer I drank and the last night sleep, plus the 5 hours of orchstra repetition have basically killed me. Anyway, thanks. EDIT: Just couldn't leave it alone, could I. Once I get obsessed with such things like these, i keep going until it works, and now it does. I still don't quite understand what the problem was, though. I took out the flags, and checked to what the flags were set, which were set correctly. Then I put in the flag checks, and it still worked. Then I took out the flags' checks of print_num() and it still works. Thanks for all the help guys, you made me a very happy man. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.