Jump to content

Special Item Problem


aka Ravenwing

Recommended Posts

I'm currently trying to make a sort of practice scenario, but I've run into a problem. It's nothing huge, just annoying. I've added a special item; a key, if it matters. It works fine and everything, but it doesn't show up on the special items list. Instead of "No Special Items" or whatever it says, it's just blank. I've checked and rechecked my scripting, but I've failed to find anything wrong with it. Any suggestions?

Link to comment
Share on other sites

To quote from the Cookbook -- nice thing to have.. laugh

 

You do have the item code in file that starts somewhat like:

 

beginscenarioscript;

 

body;

 

beginstate LOAD_SCEN_STATE;

...

 

then all you need to do...

 

Quote:

Once you have defined your special item, your next task is to create an appropriate script which gives the party the special item in the appropriate situation. For example, you might want to give the party an item in response while talking with a non-player character (see "dialogue" below), or searching an object (see "special objects" below). No matter what type of script you use, however, you'll want to use the:

 

change_spec_item(itemNum, howMany);

 

command to give the party 'howMany' copies of special item number 'itemNum'. For example:

 

change_spec_item(4, 1);

 

will give the party special item number 4.

 

To remove a special item, you can either call change_spec_item() with a negative 'howMany' value, or else use the:

 

take_special_item(itemNum);

 

command, which takes one special item number 'itemNum' from the party.

 

Finally, you can check to see how many of a particular special item the party has by using the:

 

has_special_item(itemNum)

 

call, which returns the number of special item number 'itemNum' the party currently has. This means that you can do things like:

 

if (has_special_item(4) > 0) {

...

}

 

to perform an action only if the party has at least one copy of special item number 4.

 

Do hope this helps....

 

James

Link to comment
Share on other sites

Quote:
Originally written by Kelandon:
How have you set the memory cells in the door? List the numbers.
Hmm… strange. Not sure what I was thinking here, but I made the door and took away the script. I guess I was trying to prevent access completely if the player didn't have the key. So basically it's a wall that looks like a door, and if you have the key, it changes to an open door. Should I just make it a regular door? Probably should huh…

Oh, BTW. I do have a copy of the cookbook, though I haven't looked at it much since I got it. Only recently got back to playing/designing BoA.
Link to comment
Share on other sites

Um... I think I know what's going on. If you've been using the same save game file to test the item each time, make a new one. Granted, this would mean a bit of extra work to get back to wherever the item in question it, but it should make the key show up. This happened to me once or twice in testing my stuff... had to leave some testing shortcuts embedded in early versions so I could skip around a bit.

Link to comment
Share on other sites

Quote:
Originally written by Ephesos:
Um... I think I know what's going on. If you've been using the same save game file to test the item each time, make a new one. Granted, this would mean a bit of extra work to get back to wherever the item in question it, but it should make the key show up. This happened to me once or twice in testing my stuff... had to leave some testing shortcuts embedded in early versions so I could skip around a bit.
If you mean that I should have my test party exit the scenario when I change it, that's what I do already. It's just a practice scenario for me, so I just made it one town (a house, really) that's easily accessible.

Then again, if that's not what you're talking about, make sure to let me know what a fool I am. Then, do continue to tell me what you mean. smile
Link to comment
Share on other sites

Quote:
Originally written by Nemesis:
If you mean that I should have my test party exit the scenario when I change it, that's what I do already. It's just a practice scenario for me, so I just made it one town (a house, really) that's easily accessible.
Yeah, that's what I meant. If re-starting the scenario didn't do anything, then I don't know what's up... listen to everyone else.
Link to comment
Share on other sites

Alright, I'll give you the scripts for finding the key again and for opening the door.

 

Code:
beginstate 11;//enter the door? (ln100)	if (get_flag(0,1) == 1)		end();	message_dialog("This door won't budge. After several tries, you realize that you may actually have to use a key for the door to be opened. How… unlike you.","");	if (has_special_item(0)) {		message_dialog("You try the key you found behind the house. The door swings open on its own accord, as if by magic.","");		play_sound(58);		flip_terrain(32,32);		set_flag(0,1,1);	}break;beginstate 12;//find spare key	if (get_flag(0,2) == 1)		end();	message_dialog("You find a key. Thinking it might be useful for something, you pick it up.","");	change_spec_item(0,1);	set_flag(0,2,1);break;
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...