![]() |
problem with scare 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: problem with scare script (/thread-19839.html) |
RE: problem with scare script - NaxEla - 04-07-2013 In these two lines Code: PlaySoundAtEntity("", "insanity_baby_cry_custom", asEntity, 0.0f, false); RE: problem with scare script - Tiger - 04-07-2013 (04-07-2013, 12:58 AM)NaxEla Wrote: In these two lines Can also be "Player", just so you know. RE: problem with scare script - NaxEla - 04-07-2013 (04-07-2013, 01:56 AM)Tiger Wrote:(04-07-2013, 12:58 AM)NaxEla Wrote: In these two lines Yes, it can be "Player". Although, I usually use PlayGuiSound if I want to make a sound play at the player. Doesn't really matter what function you use though. RE: problem with scare script - Tiger - 04-07-2013 (04-07-2013, 04:53 AM)NaxEla Wrote:(04-07-2013, 01:56 AM)Tiger Wrote:(04-07-2013, 12:58 AM)NaxEla Wrote: In these two lines I was telling op. RE: problem with scare script - zergling50 - 04-07-2013 (04-07-2013, 12:58 AM)NaxEla Wrote: In these two lines Thanks guys im almost there, but the new error its giving me is main (58,1) : ERR : Expected expression value EDIT: heres new code void CorpseDoorscare(string &in asParent, string &in asChild, int alState) { SetPlayerActive(false); SetEntityActive("corpse_male_1", true); AddPropImpulse("mansion_6", 20, 0, 0, "world"); StartPlayerLookAt("corpse_male_1", 2, 3, "StopLook2"); PlaySoundAtEntity("", "insanity_baby_cry_custom", "Player", 0.0f, false); PlaySoundAtEntity("", "insanity_imageflash01_custom", "Player", 0.0f, false); } EDIT EDIT: Nevermind that was an incredibly stupid mistake on my part. it launches fine now but the scare doesnt activate still. not sure why. If you need me to post my full code again I can. RE: problem with scare script - zergling50 - 04-07-2013 So I just went through again and managed to finally discover why it was still crashing, it was a problem with a completely different method, the fix you guys showed me with the entity sound thing worked. Only problem is the door is not flying open. Every part works except that. I set up two script areas next to the door so that I could in the game test what different impulses would do to the door and see if I could get it to work, but it wont work. You can see the door get shoved and hear an impact but its like its hooked up to a really strong rubber band because it only budges an extremely little bit and then shuts right back closed. I have tried extremely high values (in the 600's) and small values (in the 10's) but they all have the same effect. The door simply wont move. Does anyone have any idea whats going on? RE: problem with scare script - noovra - 04-08-2013 (04-07-2013, 09:42 PM)zergling50 Wrote: So I just went through again and managed to finally discover why it was still crashing, it was a problem with a completely different method, the fix you guys showed me with the entity sound thing worked. Only problem is the door is not flying open. Every part works except that. I set up two script areas next to the door so that I could in the game test what different impulses would do to the door and see if I could get it to work, but it wont work. You can see the door get shoved and hear an impact but its like its hooked up to a really strong rubber band because it only budges an extremely little bit and then shuts right back closed. I have tried extremely high values (in the 600's) and small values (in the 10's) but they all have the same effect. The door simply wont move. Does anyone have any idea whats going on? In my view, it looks like, that the coordinates are wrong. Did you ever tried to change them? Instead of: AddPropImpulse("mansion_6", 20, 0, 0, "world"); -> AddPropImpulse("mansion_6", 0.0f, 500.0f, 0.0f, "world"); or maybe try to place a " - " for the number of impulse... RE: problem with scare script - PutraenusAlivius - 04-08-2013 You're not adding enough force! You need the force to be above 2000 to see the effects. Code: AddPropImpulse("mansion_6", 30000, 0, 0, "world"); Code: AddPropForce("mansion_6", 30000, 0, 0, "world"); And remember, it depends whether you are in the Z or the X Axis! RE: problem with scare script - Linus Ă…gren - 04-08-2013 (04-08-2013, 02:20 AM)JustAnotherPlayer Wrote: You're not adding enough force! You need the force to be above 2000 to see the effects. Is that really true when it comes to AddPropImpulse? I never use values above 20.0f and that is strong enough to make the door get thrown up very powerfully. RE: problem with scare script - noovra - 04-08-2013 (04-08-2013, 09:00 AM)junkfood2121 Wrote:(04-08-2013, 02:20 AM)JustAnotherPlayer Wrote: You're not adding enough force! You need the force to be above 2000 to see the effects. Yes.. 500+ you should probably use. You're meaning AddPropForce. By Force u can't use that high numbers. |