Jump to content

Items on locations


Thralni

Recommended Posts

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.

Link to comment
Share on other sites

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).
Link to comment
Share on other sites

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.)
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...