![]() |
How to end custom story as a Demo? - 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 Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: How to end custom story as a Demo? (/thread-9077.html) |
RE: How to end custom story as a Demo? - Zypherzemus - 07-15-2011 This is so troublesome D:< RE: How to end custom story as a Demo? - DRedshot - 07-15-2011 you could try this: I have two possible solutions, if the first doesn't work, try the other 1. so you want it so that when you use the key on the level door, it unlocks. Sorry if someone else has posted this but couldn't you just do Code: void OnStart() Im guessing that you have already tried the above, and also i think you said that you wanted the credits to start when you click on the door. so try this: 2. create an area just in front of the door, add a use item callback so when you use the key on the Door, the callback calls. - set boolautodestroy true Spoiler below!
Spoiler below!
then in the editor add the code: Spoiler below!
![]() Edit: I suppose you wouldn't even need to make an area in front of the door - just change "mydoorarea" to "mydoor" in the useitemcallback ![]() RE: How to end custom story as a Demo? - Zypherzemus - 07-16-2011 hmm.. got an error saying (162, 1) Expected ';' Which is pretty impossible considering the fact the the only thing on row 162 is '{ syntax error somewhere? Code: void UseKeyOnDoor_6(string &in asItem, string &in asEntity) RE: How to end custom story as a Demo? - DRedshot - 07-16-2011 your if statement has a capital 'I', it must be lowercase to work 'if(GetLocalVarInt("IsDoorunLocked") == 1)' Not 'If(GetLocalVarInt("IsDoorunLocked") == 1)' RE: How to end custom story as a Demo? - Zypherzemus - 07-16-2011 IT DOESN"T WORK!! > ![]() RE: How to end custom story as a Demo? - xtron - 07-16-2011 Don't use that kind of method then. Just make a collidecallback and when you collide with that box the story ends and the credits roll. RE: How to end custom story as a Demo? - Zypherzemus - 07-16-2011 Here's the main problem, getting the credits to "roll", I'll go with the entire map full of credits method for a while, see if I could fix it, it plays the music, the screen fades to black, but the credits themselves don't show up. RE: How to end custom story as a Demo? - DRedshot - 07-16-2011 What is the problem? I cant see anything else wrong with the script. If the problem is that you go through the level door when you click on it, comment out the line: SetLevelDoorLocked("labdoor", false); and add it in again once you've uploaded the demo, that is, if you are still using my script. Also, if that doesn't work, you have probably named something wrong in your level editor/ .lang file RE: How to end custom story as a Demo? - Zypherzemus - 07-16-2011 I've done what you've suggested, but it still won't work, I checked both the .lang and .hps files to see if they matched several times, they both match. I don't believe anything is wrong with the .lang file. take a look? RE: How to end custom story as a Demo? - DRedshot - 07-16-2011 Ok, does your AddUseItemCallback look word for word exactly like this? AddUseItemCallback("Unlock" , "labkey_1" , "labdoor" , "UseKeyOnDoor_6" , true); also, in void OnStart() add SetLocalVarInt("IsDoorunLocked", 0); if its still messing up change the UseKeyOnDoor_6 part of the script to: void UseKeyOnDoor_6(string &in asItem, string &in asEntity) { SetLocalVarInt("IsDoorunLocked", 1); SetLevelDoorLocked(asEntity, false); PlaySoundAtEntity("", "unlock_door", asEntity, 0, false); RemoveItem(asItem); } also, if none of these suggestions work, you may aswell try this -- try making a script area cover the door, rename the door to "randomnamehere" and call the script area "labdoor" hopefully that will work... |