[SCRIPT] Wake up script - 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: [SCRIPT] Wake up script (/thread-15188.html) |
RE: Wake up script - Saren - 05-10-2012 (05-10-2012, 01:38 PM)Adrianis Wrote: Dude you need to tell us whats wrong. Is there a script error, is the thing just not happening, is it all happenin too fast or is just one part not working? Yes, OnStart should be at the top. TBH I've never tried having it elswhere but I don't think it would react too well, and for organisational purposes I recommend always having OnStart at the start of the script, as this is where the initial setup of variables and callbacks should take place.I did put it back on top... and I have looked at the wake up thing from the Nepsis story...... holy christ that makes no sense!!!! And... what makes even less sense... there's no calback! ANYWHERE....... world.... Y U MAKE NO SENSE?? RE: Wake up script - Adrianis - 05-10-2012 There may be a way to do what you, I couldn't tell you because I haven't got Nepsis, but then if I look at scripts from people much much better than myself, there always seems to be crazy impossible shit, which actually makes perfect sense when you learn more about angel scripting in general. However, there is a much easier and perfectly possible way to do what you want to do, and that is by taking those functions out of WakeUp and making them work in OnStart. Check this out... This is a sample from one of my maps, at the start i wanted the player to be looking up, whilst crouched down. It's the closest approximation from what I've done to what your trying to do. void OnStart() { //player settings for start SetPlayerCrouching(true); StartPlayerLookAt("ScriptArea_1", 1.5, 3, "StopLookingAtStart"); FadeOut(0); AddTimer("", 1.5, "FadeInFunc"); PlayMusic("Opening Cut 1.ogg", false, 1, 1, 10, true); } // FUNCTIONS FOR PLAYER LOOKING AT START ///////////////// void StopLookingAtStart() { StopPlayerLookAt(); } void FadeInFunc(string &in asTimer) { FadeIn(3); } Everything that needs to happen at the very moment the loading is finished and the game starts, goes into OnStart. At the outset, the player needs to crouch, look up, the screen needs to be black, music starts, and there's a timer to start a fade in once the player's view stops moving. I needed the Fade In delayed to cover the fact that the camera is moving at the start of the game, otherwise it looks dumb. The commented lines help me figure out which functions belong to which callbacks If you apply that kind of thinking to your intro, then you can figure out what needs to be in OnStart, and what needs to be in functions called by timers and collide callbacks (depending on how you like your intro's). Once you can do that, you'll be in a better position to figure out what was done in Nepsis, and you might find it is better that way RE: Wake up script - Saren - 05-10-2012 (05-10-2012, 09:38 PM)Adrianis Wrote: There may be a way to do what you, I couldn't tell you because I haven't got Nepsis, but then if I look at scripts from people much much better than myself, there always seems to be crazy impossible shit, which actually makes perfect sense when you learn more about angel scripting in general.Fine... I'll try to look into it... AGAIN.... While I fuck up my story once again.. could you tell me whats wrong with this cute little door and key script? Cause I see nothing wrong... AT ALL And yes, everything is named right, bla bla... it's simply stopped working outta NOWHERE.. AddUseItemCallback("", "MasterBedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("masterbedroomdoor", false, true); PlaySoundAtEntity("", "unlock_door", "masterbedroomdoor", 0, false); PlaySoundAtEntity("", "03_puzzle_secret", "Player", 0, false); RemoveItem("MasterBedroomkey"); } RE: Wake up script - Adrianis - 05-10-2012 Ok, now when you say its 'simply stopped working', do you mean its now saying 'You cannot use this item this way' or is the door not just not opening, or are you getting an error? Also, what function is AddUseItemCallback part of? RE: Wake up script - Saren - 05-10-2012 (05-10-2012, 10:51 PM)Adrianis Wrote: Ok, now when you say its 'simply stopped working', do you mean its now saying 'You cannot use this item this way' or is the door not just not opening, or are you getting an error?I mean... suddenly it said Cannot use item this way... and nope, no error, and uh... that is part of a bigger group of callback... dunno if it makes any difference... I hardly think so... //Callbacks AddEntityCollideCallback("Player", "Spawnmusic", "PlayMusic", true, 1); AddEntityCollideCallback("Player", "Stopmusic", "StopMusic", true, 1); AddEntityCollideCallback("Player", "Missingstaff", "Message1", true, 1); AddEntityCollideCallback("Player", "Guarddogthoughts", "Message2", true, 1); AddUseItemCallback("", "MasterBedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true); AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); AddEntityCollideCallback("Player", "PlayerCollide2", "MonsterFunction2", true, 1); } RE: Wake up script - Adrianis - 05-11-2012 Sorry but I mean the function, not just whether its in a group. Are those all in OnStart? RE: Wake up script - Saren - 05-11-2012 (05-11-2012, 12:01 AM)Adrianis Wrote: Sorry but I mean the function, not just whether its in a group. Are those all in OnStart?Oh right.... sry, getting tired here... but yup RE: Wake up script - Adrianis - 05-11-2012 Well, I can't see anything wrong with that. Something must have changed between when it was working and now that it is not. Without knowing what you've done, sadly, I don't think I can be much help. You know what needs to happen for that to work, so run over all the parts. If you really can't figure it out, redo the door, and the key, and rewrite the script RE: Wake up script - Saren - 05-11-2012 (05-11-2012, 09:37 AM)Adrianis Wrote: Well, I can't see anything wrong with that. Something must have changed between when it was working and now that it is not. Without knowing what you've done, sadly, I don't think I can be much help. You know what needs to happen for that to work, so run over all the parts. If you really can't figure it out, redo the door, and the key, and rewrite the scriptYeah... I was afraid you'd say that... lol.... oh well.. RE: Wake up script - Adrianis - 05-11-2012 (05-11-2012, 10:31 AM)Saren Wrote:No need to fear, it won't take a sec to rewrite it now that you know what is required. Just check the names of the items, comment out your previous lines and write out some new ones(05-11-2012, 09:37 AM)Adrianis Wrote: Well, I can't see anything wrong with that. Something must have changed between when it was working and now that it is not. Without knowing what you've done, sadly, I don't think I can be much help. You know what needs to happen for that to work, so run over all the parts. If you really can't figure it out, redo the door, and the key, and rewrite the scriptYeah... I was afraid you'd say that... lol.... oh well.. |