![]() |
Scripts Recollection - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Articles (https://www.frictionalgames.com/forum/forum-40.html) +---- Thread: Scripts Recollection (/thread-5117.html) |
RE: Scripts Recollection - mastersmith98 - 10-21-2010 Once we build up a big enough collection we should edit these entries a bit and move them over to the wiki. RE: Scripts Recollection - anzki - 10-21-2010 A request; how to use "inventory.hps"-file for example to make two items combine ? RE: Scripts Recollection - house - 10-22-2010 I know how to make a player teleport when he/she touches a area: Code: void CollidePlayerTeleport(string &in asParent, string &in asChild, int alState) -teleport_name: Name of what to teleport to, I recommend making another PlayerStartArea and giving the name of the extra player spawn. To give a good touch to it, add the functions: FadeOut and FadeIn. Add it like this: Code: void CollidePlayerTeleport(string &in asParent, string &in asChild, int alState) Adding FadeOut and FadeIn makes the screen fade right when you teleport so its not like you just somehow ended up there. Can you add this? Edit: I know how to add music in your level: Code: void OnStart() -name of song: This is the name of the song you want to play on start. All music is in a folder called: music. If you have the Steam version of Amnesia, it will be in: Steam\steamapps\common\amnesia the dark descent If you have the retail version, I don't have the retail version, I'm making a guess right now, the music folder should be in: program files/amnesia the dark descent/redist/ I hope thats right. Anyways, when you get there, you will see all the music. I don't know how to view the music though. They are .ogg files. Just look at the name of the songs. You'll figure everything out. ![]() When you are ready to place the name of the song in the PlayMusic function, Replace Name of Song with the song name you chose. It automaticly goes to the music folder. So don't worry about adding something like: PlayMusic("redist/music/song name.ogg", false, 0.7f, 0, 10, false); Right way: PlayMusic("name of song.ogg", false, 0.7f, 0, 10, false); Can you add this? RE: Scripts Recollection - anzki - 10-23-2010 Also you can make player float by: Code: AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords); P.S: Thanks house for the teleport so I don't have to fight with this ![]() And to house about the teleport script; teleport_name must be "string &asStartPosName" which I think means it must be start position. (So I think for example a normal script area won't work. But I might also be wrong ![]() RE: Scripts Recollection - anzki - 10-24-2010 Also you can add sound by using: Code: PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound); -string& asSoundFile is sound file; the file you want to be played. -string& asEntity is entity you want it to be played.(For example "player" makes it play at player, but if you want the sound to be heard from elsewhere; let's say a piano called "piano1", you put that("piano1") there. -float afFadeTime is time it should fade, for example 1.0f would put 1 second fade time. -bool abSaveSound. I am not sure what this is ![]() And you can stop it by using: Code: StopSound(string& asSoundName, float afFadeTime); -float afFadeTime; fade time, see above. RE: Scripts Recollection - Everlone - 10-25-2010 nice tutorials. It was very useful. But i have a question. With the script: "Make a locked door and a key to unlock it". How can i use more events? RE: Scripts Recollection - Frontcannon - 10-25-2010 (10-25-2010, 03:51 PM)Everlone Wrote: How can i use more events? Events are..? RE: Scripts Recollection - Everlone - 10-25-2010 oh sorry ^^ my bad english, i will use more scripts. the script from here show me i use one key for one door, but how i can add more keys for another doors. RE: Scripts Recollection - Frontcannon - 10-25-2010 So you have more than 1 door and want them to be unlocked by their specific keys! Just add more AddUseItemCallbacks and their functions. If you have two doors, do two AddUseItemCallbacks and two functions that unlock the doors. RE: Scripts Recollection - Everlone - 10-25-2010 sure, but how i do this??? i have ever a failure if i make another script. can you show me a example? |