HOW TO CAUSE PLAYER TO LOOSE INVENTORY ITEM AFTER USING IT ONCE?

Started by Amiga1, Mon 22/09/2008 17:36:43

Previous topic - Next topic

Amiga1

NATURE OF PROBLEM:
BASICALLY I AM MAKING A PRACTICE GAME IN WHICH THE PLAYER MUST PICK UP A BAG OF CEMENT, AND POOR IT INTO A POND.
AFTER WARDS i AM STUCK WITH THE BAG OF CEMENT IN MY INVENTORY.

HOW DO I MAKE ITEMS (ONE TIME USE ONLY) AFTER WHICH THEY DISAPEAR
AS I WILL NEED THIS FUNCTION
IF ANY ONE CAN HELP I WOULD REALLY BE GRATEFUL.

Snake

Beore anyone else tells you, lose the all capital letters thing you're doing.

Have you read the manual?

I'll give you a push in the right direction:
In the manual, search for, LoseInventory...


--Snake
Grim: "You're making me want to quit smoking... stop it!;)"
miguel: "I second Grim, stop this nonsense! I love my cigarettes!"

Makeout Patrol

Failing that, I should point out that the AGS scripting language is case-sensitive, so you're probably going to need to get a working keyboard before you continue.

Amiga1

Quote from: Snake on Mon 22/09/2008 17:49:21
Beore anyone else tells you, lose the all capital letters thing you're doing.

Have you read the manual?

I'll give you a push in the right direction:
In the manual, search for, LoseInventory...


--Snake
Thank you

Amiga1

Quote from: Makeout Patrol on Mon 22/09/2008 19:32:32
Failing that, I should point out that the AGS scripting language is case-sensitive, so you're probably going to need to get a working keyboard before you continue.
Had virus , been deleting parts of windows causing many problems.
Thanks for your help.

Amiga1

Quote from: Snake on Mon 22/09/2008 17:49:21
Beore anyone else tells you, lose the all capital letters thing you're doing.

Have you read the manual?

I'll give you a push in the right direction:
In the manual, search for, LoseInventory...


--Snake
ok been there and read it , I managed to insert
character[EGO].LoseInventory(iconcrete);  and made sure to go to inventory and add a script name for this item first!
I put the line after a :if inventory item was used comand within character interactions
and the game still ran but nothing happened.
I read that its possible to just set AGS to do what I want automatically from the general settings but when I checked mine I could not find this option?

I was planning to use little or no scripting as I am very new to this.
I simply want the item to get (used up) when the player used it on the correct hotspot. do I need an earlier version of ags perhaps?
really need a hand with this? :-[
I am using AGS 2.7


Khris

You can do it without scripting, 2.7 still contains the interaction editor.
Since the player is supposed to use the cement on a pond, you'll need to add the action(s) to the POND'S "use inventory on hotspot" event, not the player's.
First add a "Conditional - if inventory item was used" and set the number to the cement's index number.
Then double-click the "Do Nothing" child action and change it to "Player - remove an item from the inventory" (again set the number to the cement's).

You might want to right click that child action and "Add action after this..." to add a Display command to tell the player what's happened.

And please, do the tutorial in the manual.

Btw, you'll only need the Script O-name if you use code.

Amiga1

Quote from: KhrisMUC on Tue 23/09/2008 00:41:48
You can do it without scripting, 2.7 still contains the interaction editor.
Since the player is supposed to use the cement on a pond, you'll need to add the action(s) to the POND'S "use inventory on hotspot" event, not the player's.
First add a "Conditional - if inventory item was used" and set the number to the cement's index number.
Then double-click the "Do Nothing" child action and change it to "Player - remove an item from the inventory" (again set the number to the cement's).

You might want to right click that child action and "Add action after this..." to add a Display command to tell the player what's happened.

And please, do the tutorial in the manual.

Btw, you'll only need the Script O-name if you use code.
I will follow this very carfully, thanks
I just did not know where to use that player remove inventory command thanks a million

oh it worked by the way cheers

SMF spam blocked by CleanTalk