Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

option to drop items

13 years ago

As far as I can figure, an item can either be dropped or not dropped. Is there a script that would make the option to drop an item available after a certain page is passed?

In my newbie understanding of scripting, it would look something like this:

IF $PAGEID > 20

$ITEMDROP = 1

END

(if this is totally wrong, please don't laugh - I am really new to scripting ;-)

option to drop items

13 years ago
I'm not sure if that would work but there's only one way to find out :)

Just two things though:

IF $PAGEID > 20
BEGIN
$ITEMDROP := 1
END

If you've got an 'END' clause, you'll need a 'BEGIN' clause. And there's a difference between

= and :=

= is a comparison
:= is a command

so if you want to SET something, you have to use :=, if you want to compare something, you have to use =.

option to drop items

13 years ago

Thanks, 3J. Good info on what  = and := means.

I'm trying it but the "validate" button said it didn't like the 'BEGIN' clause. So I took it out and then it didn't recognize the '$ITEMDROP' parameter.

I really don't even know if I'm using the correct terms (clause and parameter) cause I know practically nothing about scripting...

option to drop items

13 years ago

Just did this:

IF $PAGEID > 32
THEN BEGIN
$ITEMDROP := 1
END

I added the 'THEN' clause, but I couldn't save it because of 'script errors'.

What are the $ITEM parameters a person can use?

option to drop items

13 years ago

http://chooseyourstory.com/help/articles/article.aspx?ArticleId=66

ITEMSTATE and ITEMUSED are the two you can use.

ITEMSTATE can be 0 or 1. One meaning it's in your inventory, zero meaning it's not.

ITEMUSED is the amount of times the item has been used.

 

You could always just remove the item from the person's inventory after they no longer need it. Personally I've never bothered to drop an item while playing a one of the storygames anyways.

option to drop items

13 years ago

Technically they're:

$ITEMSTATE

$ITEMUSED

option to drop items

13 years ago

Thanks, Killa_Robot. I guess I won't worry about it right now.

I was just thinking a player could clear out items they didn't choose to use so as not have so many items in their inventory.

Maybe another way of looking at it is: sometimes I need items droppable, but only want them dropped on certain pages. Not forced to drop like page links do. I just want to provide the player the option to drop items - like organizing things in boxes. Is there a way to do that?

option to drop items

13 years ago

So you want the player to be able to drop items on a page then come back to that page and pick them up?

If so that's not how it works. When you drop an item you need to go back to the page you first got it in order to get it again.

 

If that's not what you want then I don't really understand the point in only letting them drop it after a certain point. You can either make it droppable by default, so the player can decide what they like and keep them or you can not make them droppable, and either have the player keep all the items or write a script that removes certain items after a certain page.

 

Only alternative I can think of is the following:

 - Have a page with links to all the items they own.

 - Have a page that links to all the items the don't own.

When they click a link on a page, it either adds that item to their inventory or removes it depending on the page. In order to access those pages you would either:

A) Periodically bring them to the pages so they can decide what to do (or to do nothing)

B) Have an item that links to the pages so they can access them at any time in the story

 

Though all in all unless you have like 15+ items it seems like more effort than it's worth.

option to drop items

13 years ago

Thanks. I'll see if what you suggested works for me.

I hadn't counted before but my story has 20+ items, haha - is that a lot?

Here's a simpler explanation:

Some of the items are containers and when used open (certain pages), where other items can be dropped.

Since I have to make the items droppable from the start, how do I prevent the player from dropping those items on the ground (other pages) and not in the containers?

*Is there a way to get '$ITEMDROP' added to the scripting language?*

option to drop items

13 years ago

"If so that's not how it works. When you drop an item you need to go back to the page you first got it in order to get it again."

You can't drop and leave items on the page you dropped them, so your containers idea wouldn't work anyways.

option to drop items

13 years ago

gotcha, thanks.

option to drop items

13 years ago
Sorry about that magcos. However, you could consider not using items. Just use an inventory item that takes you to a page where based on toggled variables (0 or 1), you get a list of items that you have.

option to drop items

13 years ago

thanks, 3J - that's another good idea!