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
Custom Usable Item
hunchbackproduction Offline
Junior Member

Posts: 36
Threads: 13
Joined: Jul 2013
Reputation: 0
#1
Custom Usable Item

Is it possible to make a custom usable item ? By usable item I mean something like "Sanity Potion" or "Oil". I want to make a potion that increases the players speed for a short duration of time.

Scripting level is over 9000!
07-16-2013, 05:36 PM
Website Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#2
RE: Custom Usable Item

Yes, just make it the way you want in your modeling program. You can change it to whatever in the modeleditor. It could be a door, lantern, lamp, oil, etc.

Edit: nvm that, I thought you meant something else.
(This post was last modified: 07-17-2013, 06:49 PM by OriginalUsername.)
07-16-2013, 06:08 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#3
RE: Custom Usable Item

You can't create a "new potion". You would have to somehow build the idea on something already made, like oil, sanity potions, or laudanum. It would require scripting, of course.
07-17-2013, 01:24 AM
Find
ClayPigeon Offline
Member

Posts: 214
Threads: 13
Joined: Mar 2012
Reputation: 8
#4
RE: Custom Usable Item

Model creation:You'll have to create a model first (if you want a custom model) in any 3d editing program that supports OpenCOLLADA (.dae exporter). After exporting it you'll need to open it in the model editor and add some physical properties to it by attatching a body to it, and then you'll need to set the item's settings so it will be a coin (Settings -> User Defined Variables -> Type - Item -> Subtype - Coins).

Script-wise:
Afterwards, you'll need to place it in the Level Editor somewhere in your map, and give it a name, and script it so when the player will pick up "name" it will boost him. You'll need to use:
void OnStart()
{    
    SetEntityCallbackFunc("name", "BoostPlayer");
}
void BoostPlayer(string &in ent, string &in type)
{    
    if(type == "OnPickup")    
    {        
        SetPlayerMoveSpeedMul(2.2f);        
        AddTimer("", 5.5f, "StopPlayer");    
    }
}
void StopPlayer(string &in timer)
{    
    SetPlayerMoveSpeedMul(1.0f);
}

This code will boost the player's speed by 2.2 times for 5.5 seconds, after he picks up "name".
(This post was last modified: 07-17-2013, 06:19 PM by ClayPigeon.)
07-17-2013, 06:17 PM
Find
hunchbackproduction Offline
Junior Member

Posts: 36
Threads: 13
Joined: Jul 2013
Reputation: 0
#5
RE: Custom Usable Item

(07-17-2013, 06:17 PM)ClayPigeon Wrote: Model creation:You'll have to create a model first (if you want a custom model) in any 3d editing program that supports OpenCOLLADA (.dae exporter). After exporting it you'll need to open it in the model editor and add some physical properties to it by attatching a body to it, and then you'll need to set the item's settings so it will be a coin (Settings -> User Defined Variables -> Type - Item -> Subtype - Coins).

Script-wise:
Afterwards, you'll need to place it in the Level Editor somewhere in your map, and give it a name, and script it so when the player will pick up "name" it will boost him. You'll need to use:
void OnStart()
{    
    SetEntityCallbackFunc("name", "BoostPlayer");
}
void BoostPlayer(string &in ent, string &in type)
{    
    if(type == "OnPickup")    
    {        
        SetPlayerMoveSpeedMul(2.2f);        
        AddTimer("", 5.5f, "StopPlayer");    
    }
}
void StopPlayer(string &in timer)
{    
    SetPlayerMoveSpeedMul(1.0f);
}

This code will boost the player's speed by 2.2 times for 5.5 seconds, after he picks up "name".

Thank you very much Smile

However, although that works I wanted something you activate inside your inventory. Anyway to do that ?

Scripting level is over 9000!
(This post was last modified: 07-19-2013, 05:36 PM by hunchbackproduction.)
07-19-2013, 05:35 PM
Website Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Custom Usable Item

(07-19-2013, 05:35 PM)hunchbackproduction Wrote: However, although that works I wanted something you activate inside your inventory. Anyway to do that ?

Perhaps mess around with item combinations.

Tutorials: From Noob to Pro
07-19-2013, 09:16 PM
Website Find
hunchbackproduction Offline
Junior Member

Posts: 36
Threads: 13
Joined: Jul 2013
Reputation: 0
#7
RE: Custom Usable Item

(07-19-2013, 09:16 PM)Your Computer Wrote:
(07-19-2013, 05:35 PM)hunchbackproduction Wrote: However, although that works I wanted something you activate inside your inventory. Anyway to do that ?

Perhaps mess around with item combinations.

Oh yes,good idea sir Big Grin I will give it a try. That would make it more like I want it ^ Thanks

Scripting level is over 9000!
07-20-2013, 11:49 AM
Website Find




Users browsing this thread: 2 Guest(s)