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
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


Messages In This Thread
Custom Usable Item - by hunchbackproduction - 07-16-2013, 05:36 PM
RE: Custom Usable Item - by OriginalUsername - 07-16-2013, 06:08 PM
RE: Custom Usable Item - by Statyk - 07-17-2013, 01:24 AM
RE: Custom Usable Item - by ClayPigeon - 07-17-2013, 06:17 PM
RE: Custom Usable Item - by hunchbackproduction - 07-19-2013, 05:35 PM
RE: Custom Usable Item - by Your Computer - 07-19-2013, 09:16 PM
RE: Custom Usable Item - by hunchbackproduction - 07-20-2013, 11:49 AM



Users browsing this thread: 1 Guest(s)