Frictional Games Forum (read-only)
Changing item interaction? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Changing item interaction? (/thread-13866.html)



Changing item interaction? - Damascus - 03-09-2012

I've done some searching, but haven't quite been able to figure out how to change the way a player interacts with an item. I know that I have to make new files for each version of the item, but I don't know what to change about it.

Example 1: I've laid the arm of a corpse on the ground, but want the player to be unable to pick it up and move it.

Example 2: This one's more complicated. I want the player to pick up an item into their inventory (a stone), but when they use it on a stand, you can't move it but can use an item on it. Then, once you do use the necessary item on it, it becomes an item that you can now carry and throw like the normal stones in the game.

I realize that last example will require three different item files, but I don't know what I have to change about them to make them interact differently.



RE: Changing item interaction? - flamez3 - 03-09-2012

Example 1: Change it to static physics by going to the entity tab of the item and ticking "StaticPhsyics"

Example 2: Set an the item where you want it to be, then make it static physics aswell.


RE: Changing item interaction? - Damascus - 03-09-2012

Some more detail would be nice. How can I change whether or not an item goes into my inventory?



RE: Changing item interaction? - flamez3 - 03-09-2012

Don't make the item that you pick up static, and the item that you do not want the player to pick up, make static physics. And you might need to add a ScriptArea around the staticphysics item so that you can seemingly interact with the item.


RE: Changing item interaction? - palistov - 03-09-2012

Not sure if you got everything you needed to know from flamez.

You'll need 3 separate entities of the rock.

1. The inventory item (entity sub-type: Item > Puzzle)
2. The rock sitting in the stand (entity sub-type: Object > Static)
3. The rock you can throw (entity sub-type: Object > Grab)

Make those in the ModelEditor. Note that the inventory item MUST have an image file or you will be unable to pick it up. When you use the rock item (#1) on the stand, set entity #2 active. When you use your other item on this rock #2, set rock #2 inactive, and set #3 active. Then the player can toss it around.

Noticed you're quite new to the forums, so I'll go into a little more detail. When you're creating these entities, go to Settings > User-Defined Variables. There you can set the entity's type and sub-type. Most entity types (the ones I listed above definitely do) require a body. Use the shape tool (press 5), then select your shape and create a body. You'll want #2 and #3 placed in the level editor, and set in-active. Then you set them active via the script when the player performs the appropriate actions.


RE: Changing item interaction? - Damascus - 03-11-2012

Alright I've made two seperate entities, and they work in the right way. For the difference between the last two i think I'm just going to enable StaticPhysics on the one.

Now I just have two things to figure out, how to change the color of my item (have been playing with model and material editor but can't figure out how to yellow tint the rock texture). And I need to figure out how to make an image for the inventory item.