IWT
Junior Member
Posts: 5
Threads: 2
Joined: May 2012
Reputation:
0
|
How to make item unlootable?
So, I'm on my way to build my Custom story Demo, and one thing I've seen nowhere, is this:
So, my plan is to place an item with different name on the ground, and make it unlootable, and interactable with other items. How is the script done?
|
|
01-18-2013, 12:38 AM |
|
Daemian
Posting Freak
Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation:
49
|
RE: How to make item unlootable?
you edit the item on the model editor and set its type to other than "Item"
so player can't pick it up.
i'm not sure what kind of interaction you want with other items, collision? combine?
|
|
01-18-2013, 12:47 AM |
|
IWT
Junior Member
Posts: 5
Threads: 2
Joined: May 2012
Reputation:
0
|
RE: How to make item unlootable?
(01-18-2013, 12:47 AM)Amn Wrote: you edit the item on the model editor and set its type to other than "Item"
so player can't pick it up.
i'm not sure what kind of interaction you want with other items, collision? combine?
As the item lays on the ground, unlootable, you can use other item on it.
And I'm not sure about model editor, is it possible to do it without, or how to do it?
(This post was last modified: 01-18-2013, 01:07 AM by IWT.)
|
|
01-18-2013, 01:06 AM |
|
TheGreatCthulhu
Member
Posts: 213
Threads: 10
Joined: Oct 2010
Reputation:
32
|
RE: How to make item unlootable?
If the item doesn't have to move around (like, bounce back when the player runs into it), you can just open the Level Editor, select the item, go to the Entity tab, and check, "StaticPhysics"; when done, just place a script area around it, and do something like this in the script file (inside OnEnter() function):
SetEntityInteractionDisabled("itemname", true);
// and then (for player "hand-based" interactions): SetEntityPlayerInteractCallback("ScriptArea_1", "MyFunc", false);
// or rather (to use an item on it): AddUseItemCallback("internalCallbackID", "itemToUseID", "ScriptArea_1", "MyFunc", true);
Of course, replace "itemname", "itemToUseID", "ScriptArea_1" and "MyFunc" with the names you're using, and "internalCallbackID" with whatever you want.
|
|
01-18-2013, 01:20 AM |
|
IWT
Junior Member
Posts: 5
Threads: 2
Joined: May 2012
Reputation:
0
|
RE: How to make item unlootable?
(01-18-2013, 01:20 AM)TheGreatCthulhu Wrote: If the item doesn't have to move around (like, bounce back when the player runs into it), you can just open the Level Editor, select the item, go to the Entity tab, and check, "StaticPhysics"; when done, just place a script area around it, and do something like this in the script file (inside OnEnter() function):
SetEntityInteractionDisabled("itemname", true);
// and then (for player "hand-based" interactions): SetEntityPlayerInteractCallback("ScriptArea_1", "MyFunc", false);
// or rather (to use an item on it): AddUseItemCallback("internalCallbackID", "itemToUseID", "ScriptArea_1", "MyFunc", true);
Of course, replace "itemname", "itemToUseID", "ScriptArea_1" and "MyFunc" with the names you're using, and "internalCallbackID" with whatever you want.
Thanks, really helps me out! I guess the Demo is finished soon. Just fixing and decorating and some debugging and it's done.
|
|
01-18-2013, 01:06 PM |
|
|