Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Jumpscare script (request)

Author
Message
Froschkerl
5
Years of Service
User Offline
Joined: 9th Aug 2014
Location: Gerrrrrrmany
Posted: 15th Nov 2014 18:14
How do i make a face Pop up and Play a Sound when the Play reaches a Trigger Zone?
Sinister Spoon
11
Years of Service
User Offline
Joined: 9th Sep 2008
Location:
Posted: 23rd Nov 2014 20:19 Edited at: 2nd Dec 2014 00:01
Its really simple if you read the guide or an code syntax pdf

you need to ascertain when the player is in the triggerzone (plrwithinzone=1) as part of the condition and then in the action simply have it display a hud image of the face and use plrsound=(file path) to trigger the sound.

I could put the code in a snippet for you but for something this simple i think its best to just tell you what commands to use to achieve that result and let you find the best way of using that

in summary:

plrwithinzone=1 is true when the player is in the zone, so set this as a condition eg :state=0,plrwithinzone=1: (show image) (play sound)

hope that helps?

smoke em if you got em
Froschkerl
5
Years of Service
User Offline
Joined: 9th Aug 2014
Location: Gerrrrrrmany
Posted: 29th Nov 2014 21:49
To be honest, i don't really know ANYTHING about fpe Scripting. It would be very nice from you if you'd post the code snippet
ncmako
7
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 30th Nov 2014 02:06
Quote: "To be honest, i don't really know ANYTHING about fpe Scripting"

That's why it's best to show some kind of effort when asking for
help. This one really "is" easy to do. Try Sinister Spoon's method
then also take a look in your "Official comm. guide" in your doc's
folder you'll see just this effect on pg.131. They use a light and
character, but you can use really any object, image...ect
Show some effort first before posting. It cant hurt and
you'll learn thru the process
best

My games never have bugs. They just develop random features..
Sinister Spoon
11
Years of Service
User Offline
Joined: 9th Sep 2008
Location:
Posted: 1st Dec 2014 16:44 Edited at: 1st Dec 2014 16:47
Thanks Mako, I re read my original post...I was in a bad mood when I first replied sorry lol..

Anyway i kinda did post the code snippet in the 1st post if you check, :state=0.plrwithinzone=1: (play sound) (show Image)

The only way I could provide it more clearly without the filepaths your using for your images and sounds is



That is literally it...

That script wont be perfect, as it will play the sound everytime someone walks through the zone and do the same with your image

but it will give you the effect but learning why it plays everytime you walk through the zone and finding a way to prevent that will give you something to LEARN

Its better to learn fpi, like mako said read up on fpi syntax, look up problems people have had on the forums and read up on the solutions, you can make some truly awesome stuff with your imagination coupled with a knowledge of how fpsc and fpi work together

imagine instead of a picture a monster in a doorway, the lights go out as a scream is head, a second light comes on the other side of the monster illuminating the opening behind it and leaving it in shadow as it approaches the player menacingly then just as its about to reach the player it vanishes as the lights come on...

Now that sounds scary right? yeah... scary to code!

But not really, with a trigger zone, an enemy on a delayed spawn and a couple of stock dynamic lights that effect can be simply achieved, and being in engine would probably be a lot scarier, just have the trigger zone spawn the enemy, kill the lights, script the enemy to move towards the player, then be destroyed on a timer along with the lights

Anyway Id rather help you understand how scripts work than just give them out to you

But if your wana learn I'll help you create a scenario like the one I described, you'd be surprised how simple yet effective things like that can be. also try phasing a dynamic object partway through a wall with immobile=off, physic=on and always active=on, have it spawn at start=no, and put a trigger zone down near it with the name of the object in its ifused field and the playerwithinzoneactivateused.fpi ( i think thats the name)

Basically the way i remember it when you hit the trigger zone the object spawns partway in the wall, fpsc throws a wobbler, the object not knowing how to react simply flings itself accross the room excellent for poltergeist activity.

Also working on script that will allow items to bob gently up and down as if floating in mid air if you like, Im happy to post that up somewhere

Anyway hope it helped, but yeah have fun using the code and working out the gaps in it

smoke em if you got em
ncmako
7
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 1st Dec 2014 18:28 Edited at: 1st Dec 2014 18:32
@Sinister Spoon, I'm confused My response was directed
toward Froschkerl, not you. Sorry.
You didn't come across at all as in a "bad mood"
best

Also, BlackFox has a wealth of info on scripts on his thread
available here...http://forum.thegamecreators.com/?m=forum_view&t=192148&b=23
I use it all the time to refresh my memory.

My games never have bugs. They just develop random features..
Sinister Spoon
11
Years of Service
User Offline
Joined: 9th Sep 2008
Location:
Posted: 2nd Dec 2014 00:01
Sorry i Just read the opening to the second post i made and I realise the confusion heh..

I was saying thanks for saying my suggestion was sound, The bit about my own mood was just me re reading the post and feeling like i came of a bit...irritated

I just wanted to kinda clarify we were both saying the same thing, my whole spiel about the monster and the dynamic lights was just a continuation of what you suggested in your original response

Didnt mean to offend ya, you been very supportive

(apologies for the off topic response, just seemed neccesary to clear things up a little)

but yeah the point is take some time and learn to script then one day you can be the one dishing out advice and getting into misunderstandings with respected forum members

smoke em if you got em
Froschkerl
5
Years of Service
User Offline
Joined: 9th Aug 2014
Location: Gerrrrrrmany
Posted: 31st Dec 2014 14:54
Thanks guys, through your help i'm now... well... pretty talented in fpi Scripting, as you can maybe see in my daynight circle script! Thanks for your help!

Login to post a reply

Server time is: 2019-09-19 10:20:36
Your offset time is: 2019-09-19 10:20:36