Special Item Problem

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Special Item Problem
Lifecrafter
Member # 7538
Profile Homepage #0
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?

--------------------
Do not provoke the turtles.
They do not like being provoked.

-Lenar

My website: Nemesis' Refuge
Posts: 743 | Registered: Friday, September 29 2006 07:00
Warrior
Member # 3340
Profile #1
It could help if you added the source code for the item in question. ;)

--------------------
Sometimes I just don't know anything about everything -- or do I ?
Posts: 99 | Registered: Wednesday, August 13 2003 07:00
Lifecrafter
Member # 7538
Profile Homepage #2
Ah. Right. :P
Here it is.

beginstate LOAD_SCEN_STATE;

init_special_item(0,"Spare Key","This is a key found at the back of the house. Its markings don't indicate what it unlocks.");

break;


--------------------
Do not provoke the turtles.
They do not like being provoked.

-Lenar

My website: Nemesis' Refuge
Posts: 743 | Registered: Friday, September 29 2006 07:00
Warrior
Member # 3340
Profile #3
To quote from the Cookbook -- nice thing to have.. :D

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

--------------------
Sometimes I just don't know anything about everything -- or do I ?
Posts: 99 | Registered: Wednesday, August 13 2003 07:00
Lifecrafter
Member # 7538
Profile Homepage #4
Oh right. Just forgot to mention it. Here it is.

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;


--------------------
Do not provoke the turtles.
They do not like being provoked.

-Lenar

My website: Nemesis' Refuge
Posts: 743 | Registered: Friday, September 29 2006 07:00
Off With Their Heads
Member # 4045
Profile Homepage #5
So when you try to unlock the door that this key opens, it actually unlocks, even though the item doesn't show up on the special items screen?

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Lifecrafter
Member # 7538
Profile Homepage #6
Yeah, it works just fine. It just doesn't show up on the list. I mean… it's not really that big a deal; most people probably wouldn't notice it, but it bothers me.

--------------------
Do not provoke the turtles.
They do not like being provoked.

-Lenar

My website: Nemesis' Refuge
Posts: 743 | Registered: Friday, September 29 2006 07:00
? Man, ? Amazing
Member # 5755
Profile #7
Changing the special item number to 1 has no effect.

Edit - reading slower increases my understanding...but not enough to be helpful.

:)

[ Friday, September 29, 2006 22:24: Message edited by: Jumpin' Salmon ]

--------------------
WWtNSD?
Posts: 4114 | Registered: Monday, April 25 2005 07:00
Off With Their Heads
Member # 4045
Profile Homepage #8
How have you set the memory cells in the door? List the numbers.

In other news, is Erik Westra's site down? I can't access it.

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Raven v. Writing Desk
Member # 261
Profile Homepage #9
Google has cached versions of his Cookbook as HTML and .DOC files. They leave out the pictures (were those tables?) though.

--------------------
Slarty vs. DeskDesk vs. SlartyTimeline of ErmarianG4 Strategy Central
Posts: 3560 | Registered: Wednesday, November 7 2001 08:00
? Man, ? Amazing
Member # 5755
Profile #10
I'll email the .doc file to a host if that is necessary.

--------------------
WWtNSD?
Posts: 4114 | Registered: Monday, April 25 2005 07:00
Lifecrafter
Member # 7538
Profile Homepage #11
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.

[ Saturday, September 30, 2006 11:09: Message edited by: Nemesis ]

--------------------
Do not provoke the turtles.
They do not like being provoked.

-Lenar

My website: Nemesis' Refuge
Posts: 743 | Registered: Friday, September 29 2006 07:00
Law Bringer
Member # 4153
Profile Homepage #12
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.

--------------------
Gamble with Gaea, and she eats your dice.

I hate undead. I really, really, really, really hate undead. With a passion.
Posts: 4130 | Registered: Friday, March 26 2004 08:00
Guardian
Member # 6670
Profile Homepage #13
I have a .pdf copy of the Cookbook, if that needed. Don't know what version it is, though.

And if I got a dime for every time I changed a script but didn't change the .sav...

--------------------
Chicago Checking on Elderly in Heat
- Headline
Posts: 1509 | Registered: Tuesday, January 10 2006 08:00
Off With Their Heads
Member # 4045
Profile Homepage #14
I suppose I might host all of Erik Westra's stuff, if it comes to that. E-mail me whatever you've got of the Cookbook.

[ Saturday, September 30, 2006 15:25: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
? Man, ? Amazing
Member # 5755
Profile #15
Sent.

--------------------
WWtNSD?
Posts: 4114 | Registered: Monday, April 25 2005 07:00
Lifecrafter
Member # 7538
Profile Homepage #16
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. :)

--------------------
Do not provoke the turtles.
They do not like being provoked.

-Lenar

My website: Nemesis' Refuge
Posts: 743 | Registered: Friday, September 29 2006 07:00
Law Bringer
Member # 4153
Profile Homepage #17
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.

--------------------
Gamble with Gaea, and she eats your dice.

I hate undead. I really, really, really, really hate undead. With a passion.
Posts: 4130 | Registered: Friday, March 26 2004 08:00
Off With Their Heads
Member # 4045
Profile Homepage #18
quote:
Originally written by Nemesis:

So basically it's a wall that looks like a door, and if you have the key, it changes to an open door.
By what mechanism? A blue special rectangle? If so, post the code for that, also.

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Lifecrafter
Member # 7538
Profile Homepage #19
Alright, I'll give you the scripts for finding the key again and for opening the door.

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;


--------------------
Do not provoke the turtles.
They do not like being provoked.

-Lenar

My website: Nemesis' Refuge
Posts: 743 | Registered: Friday, September 29 2006 07:00