Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing item interaction?
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
Changing item interaction?

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.
03-09-2012, 07:19 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Changing item interaction?

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.

03-09-2012, 07:26 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#3
RE: Changing item interaction?

Some more detail would be nice. How can I change whether or not an item goes into my inventory?
03-09-2012, 07:46 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: Changing item interaction?

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.

03-09-2012, 07:50 AM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#5
RE: Changing item interaction?

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.

(This post was last modified: 03-09-2012, 09:42 AM by palistov.)
03-09-2012, 09:39 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#6
RE: Changing item interaction?

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.

03-11-2012, 12:56 AM
Find




Users browsing this thread: 1 Guest(s)