Code Help

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: Code Help
Infiltrator
Member # 148
Profile #0
How do I put an item IN a container? I can put the item on a spot, but not in the container according to the docs.

--------------------
My ego is bigger than yours.
Posts: 480 | Registered: Thursday, October 11 2001 07:00
Shock Trooper
Member # 7662
Profile #1
If you are referring to void put_item_on_spot(short loc_x,short loc_y,short what_item) there is no call that makes an item contained or otherwise. You can manually make an item contained by choosing Shift + S, clicking on the square containing the item and then clicking on the line that says "Not Contained".
Posts: 292 | Registered: Monday, November 13 2006 08:00
...b10010b...
Member # 869
Profile Homepage #2
One option is to fake it by using a call to give the party the item when the container is searched, rather than actually placing the item.

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00
Lifecrafter
Member # 6193
Profile Homepage #3
Oddly, if you put an object on a container it WILL be contained-- or at least half contained. The player will have to search the container to get the item, but the item will appear on top of the container.

Personally I prefer a twist on what Thuryl is talking about. Place the object in a container but have a block_entry() called whenever the player searches until whatever conditions are met so that the player can find the item. Alternatively, hidden containers containing items (with a block_entry()) toggled to visible containers (without a block_entry()) can be useful as well if the space wasn't originally a container.

--------------------
"NOW PASS ME MY BOOTS. I HAVE AN APPOINTMENT WITH A FACE." -Nikki

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00
Law Bringer
Member # 4153
Profile Homepage #4
block_entry() works on containers? Sweet...

--------------------
TM: "I want BoA to grow. Evolve where the food ladder has rungs to be reached."

Gamble with Gaea, and she eats your dice.
Posts: 4130 | Registered: Friday, March 26 2004 08:00
Shock Trooper
Member # 10488
Profile #5
I think you'd want to put it in the SEARCH_STATE to prevent access to the contents of the container.
Posts: 334 | Registered: Friday, September 14 2007 07:00
Shock Trooper
Member # 7662
Profile #6
A customized terrain script would prevent access until the conditions were met. Presumably the condition would be represented by a certain SDF.

If the conditions were represented by a special item you could use the existing trap.txt instead.
Posts: 292 | Registered: Monday, November 13 2006 08:00
Lifecrafter
Member # 6193
Profile Homepage #7
Or just specobj with a flag/item/whatever check in the state it calls.

--------------------
"NOW PASS ME MY BOOTS. I HAVE AN APPOINTMENT WITH A FACE." -Nikki

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00
Shaper
Member # 3442
Profile Homepage #8
quote:
Originally written by Lazarus.:

Or just specobj with a flag/item/whatever check in the state it calls.
That's the way I do it, and it's so damn easy. Place a specobj terrain script on a container, set memory cell 0 to 10 (or whatever), and then add this in the town script:

beginstate 10; //or whatever
if(get_flag(0,1) == 0) { //if the condition isn't met...
block_entry(1); //stop them getting the loot
message_dialog("You can't open this chest yet,",""); //and maybe leave them a message
}
break;


[ Monday, December 17, 2007 05:26: Message edited by: Funkadelic ]

--------------------
Nikki's Nook - bigger than Jesus?
Posts: 2864 | Registered: Monday, September 8 2003 07:00