NaxEla
Senior Member
Posts: 415
Threads: 5
Joined: Dec 2012
Reputation:
28
|
RE: problem with scare script
In these two lines PlaySoundAtEntity("", "insanity_baby_cry_custom", asEntity, 0.0f, false);
PlaySoundAtEntity("", "insanity_imageflash01_custom", asEntity, 0.0f, false);
change asEntity with the name of the entity that the sound plays at (inside quotations "").
|
|
04-07-2013, 12:58 AM |
|
Tiger
Posting Freak
Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation:
55
|
RE: problem with scare script
(04-07-2013, 12:58 AM)NaxEla Wrote: In these two lines PlaySoundAtEntity("", "insanity_baby_cry_custom", asEntity, 0.0f, false);
PlaySoundAtEntity("", "insanity_imageflash01_custom", asEntity, 0.0f, false);
change asEntity with the name of the entity that the sound plays at (inside quotations "").
Can also be "Player", just so you know.
|
|
04-07-2013, 01:56 AM |
|
NaxEla
Senior Member
Posts: 415
Threads: 5
Joined: Dec 2012
Reputation:
28
|
RE: problem with scare script
(04-07-2013, 01:56 AM)Tiger Wrote: (04-07-2013, 12:58 AM)NaxEla Wrote: In these two lines PlaySoundAtEntity("", "insanity_baby_cry_custom", asEntity, 0.0f, false);
PlaySoundAtEntity("", "insanity_imageflash01_custom", asEntity, 0.0f, false);
change asEntity with the name of the entity that the sound plays at (inside quotations "").
Can also be "Player", just so you know.
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.
|
|
04-07-2013, 04:53 AM |
|
Tiger
Posting Freak
Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation:
55
|
RE: problem with scare script
(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 PlaySoundAtEntity("", "insanity_baby_cry_custom", asEntity, 0.0f, false);
PlaySoundAtEntity("", "insanity_imageflash01_custom", asEntity, 0.0f, false);
change asEntity with the name of the entity that the sound plays at (inside quotations "").
Can also be "Player", just so you know.
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.
I was telling op.
(This post was last modified: 04-07-2013, 04:44 PM by Tiger.)
|
|
04-07-2013, 04:43 PM |
|
zergling50
Member
Posts: 74
Threads: 9
Joined: Jul 2012
Reputation:
1
|
RE: problem with scare script
(04-07-2013, 12:58 AM)NaxEla Wrote: In these two lines PlaySoundAtEntity("", "insanity_baby_cry_custom", asEntity, 0.0f, false);
PlaySoundAtEntity("", "insanity_imageflash01_custom", asEntity, 0.0f, false);
change asEntity with the name of the entity that the sound plays at (inside quotations "").
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.
(This post was last modified: 04-07-2013, 09:04 PM by zergling50.)
|
|
04-07-2013, 08:37 PM |
|
zergling50
Member
Posts: 74
Threads: 9
Joined: Jul 2012
Reputation:
1
|
RE: problem with scare script
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?
|
|
04-07-2013, 09:42 PM |
|
noovra
Junior Member
Posts: 9
Threads: 1
Joined: Apr 2013
Reputation:
0
|
RE: problem with scare script
(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...
(This post was last modified: 04-08-2013, 02:07 AM by noovra.)
|
|
04-08-2013, 02:05 AM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: problem with scare script
You're not adding enough force! You need the force to be above 2000 to see the effects.
AddPropImpulse("mansion_6", 30000, 0, 0, "world");
And you need another perimeter!
AddPropForce("mansion_6", 30000, 0, 0, "world");
And remember, it depends whether you are in the Z or the X Axis!
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
04-08-2013, 02:20 AM |
|
Linus Ågren
Senior Member
Posts: 309
Threads: 58
Joined: Jan 2011
Reputation:
5
|
RE: problem with scare script
(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.
AddPropImpulse("mansion_6", 30000, 0, 0, "world");
And you need another perimeter!
AddPropForce("mansion_6", 30000, 0, 0, "world");
And remember, it depends whether you are in the Z or the X Axis!
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.
Creator of The Dark Treasure.
|
|
04-08-2013, 09:00 AM |
|
noovra
Junior Member
Posts: 9
Threads: 1
Joined: Apr 2013
Reputation:
0
|
RE: problem with scare script
(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.
AddPropImpulse("mansion_6", 30000, 0, 0, "world");
And you need another perimeter!
AddPropForce("mansion_6", 30000, 0, 0, "world");
And remember, it depends whether you are in the Z or the X Axis!
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.
Yes.. 500+ you should probably use.
You're meaning AddPropForce. By Force u can't use that high numbers.
|
|
04-08-2013, 01:03 PM |
|
|