Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with scare script
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#11
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 "").

In Ruins [WIP]
04-07-2013, 12:58 AM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#12
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
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#13
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.

In Ruins [WIP]
04-07-2013, 04:53 AM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#14
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
Find
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#15
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
Find
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#16
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
Find
noovra Offline
Junior Member

Posts: 9
Threads: 1
Joined: Apr 2013
Reputation: 0
#17
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
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#18
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."
(This post was last modified: 04-08-2013, 02:20 AM by PutraenusAlivius.)
04-08-2013, 02:20 AM
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#19
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
Website Find
noovra Offline
Junior Member

Posts: 9
Threads: 1
Joined: Apr 2013
Reputation: 0
#20
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
Find




Users browsing this thread: 3 Guest(s)