HPL3/Amnesia: Rebirth/Tutorials/FAQ

From Frictional Wiki
< HPL3‎ | Amnesia: Rebirth‎ | Tutorials
Revision as of 22:52, 17 November 2020 by Darkfire (talk | contribs) (Created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This article aims to resolve common issues with Rebirth modding.

Q: Where are all the script functions?

A: Firstly, make sure you're using CodeLite. It will reduce the need to search for functions since it gives you hints about existing functions. It will also reduce the number of mistakes you make because it has syntax highlighting. To answer your question directly: Currently CodeLite is the only thing which has all functions, but you can see the core engine functions on this page. The game-specific functions which will interest you the most will be here, but they're currently not fully documented.


Q: How do I script X to do Y?

A: There aren't tutorials for everything that can be done in the game, or for every basic thing. People can help you with ideas, but don't expect them to write code for you. Please read as much of the scripting articles as possible and look at in-game examples before asking people to fix basic syntax for you.

Q: The player model and animations are broken. What do I do?

A: You need to enable the player body in a script to make it function properly. Use this line: PlayerBody_SetActive(true); in the Setup section of your script.

Q: How do I remove the bracelet amulet from the inventory?

A: Use this line: Item_RemoveFromInventory(ItemType_GetFirstInInventory("CurseMedallion")); in your script.

Q: How do I make a monster work? / How do I make a monster walk along a path?

A: Check these guides:

Q: How do I play a sound?

A: Use the Sound_CreateAtEntity function in your script. Make sure you're using CodeLite so it gives you hints on what to type into the function.

Q: How do I make a timer?

A: Use this line: Map_AddTimer("timerName", 1.0f, "Timer_timerName"); in your script. Customise the function arguments. The callback function will look like this:

void Timer_timerName(const tString&in asTimer)
    //your code goes here. It's called when the timer runs out

Q: Custom objects don't show up in the editor/game.

A: Make sure you have set up the mod correctly (Set up guide part 1 and part 2) and that you are using the Rebirth Mod Manager. It will automate a few of the steps.