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 / Freeze the player, play sound, and display an image? [HELP]

Author
Message
Desecrated Studios
14
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Kirtona
Posted: 8th Aug 2011 06:52 Edited at: 8th Aug 2011 07:05
This is not a request. I need some help.. So i got a script from the Community Guide and i have edited it a little bit so that when i go up to this entity(a note) and hold F it displays an image, and then when i let go it hides the image. Here is the script:



Now, i have searched the forums on how to freeze the player and i got plrfreeze a lot. So i figured i would give it a try, I didn't really know where to place it into my script so i put it where it seemed logical to me. Does anyone know what is wrong with it?

rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 8th Aug 2011 07:10 Edited at: 8th Aug 2011 07:14
Plrfreeze is an action not a condition.
Nevermind.

Desecrated Studios
14
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Kirtona
Posted: 8th Aug 2011 07:15
Quote: "Plrfreeze is an action not a condition."

Oh, well then do i just need to move it? Or can it not be used in a script?

Quote: "You are also going to go straight back to state 1 with no time to show the hud, use a timer."

Alright since i know nothing of timers i will search the forums real quick and see what i can come up with.

Thanks for commenting rolfy!

rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 8th Aug 2011 07:16 Edited at: 8th Aug 2011 07:18
Actually looking at it I realised it prolly works fine as it is. Just put plrfreeze into state=2 line

Desecrated Studios
14
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Kirtona
Posted: 8th Aug 2011 07:18
It sadly doesn't
Like, it works in the sense that i can walk up and press f to view the image. But i can still move around? Ugh..

rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 8th Aug 2011 07:20 Edited at: 8th Aug 2011 07:25
No I mean the image will show fine but move plrfreeze into state=2.

:state=2:hudshow=objectives,plrfreeze=1000,state=1

Though I might be tempted to freeze the player for less time since your looping the script as long as you hold down the 'f' key.

Desecrated Studios
14
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Kirtona
Posted: 8th Aug 2011 07:25
Oh, well as i said i didn't know where to place it. Now it works! Woo! I have another question sadly, how many seconds/minutes/hours is 1000? XD I waited like 30 seconds and i couldn't move. Isn't plrfreeze in milliseconds?

Well now i get to work on adding audio to the script.. There was a script in the community guide, i will try and add it to this one..

Thanks!

BlackFox
FPSC Master
17
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 8th Aug 2011 07:32 Edited at: 8th Aug 2011 08:04
I would do it like this:



Now recognize that using the condition plrdistwithin usually means you have attached this script to an entity that is not moving.

[ADDITIONAL]

Yes, plrfreeze is in milliseconds. 1000 milliseconds = 1 second

You could not move because you forgot to set the script to use plrfreeze=0 which unfreezes the player.


Twitter: @NFoxMedia
Desecrated Studios
14
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Kirtona
Posted: 8th Aug 2011 07:38 Edited at: 8th Aug 2011 07:39
I was actually thinking of putting a map in my game (Insert sad face) Alright i won't be doing that then..

But what exactly did you change? Obviously i can see what you changed, but what does it do? I guess i could test the script..

Quote: "Now recognize that using the condition plrdistwithin usually means you have attached this script to an entity that is not moving."


It is attached to an entity that is not moving. It is a note on a desk/table..

Thanks for commenting BlackFox! I will test the script right now!

EDIT - Oh, alright i will add it to the script! Thanks!

BlackFox
FPSC Master
17
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 8th Aug 2011 07:42
Quote: "I was actually thinking of putting a map in my game (Insert sad face) Alright i won't be doing that then.."


Why not? Just because I do does not mean I have a patent on that idea.

Quote: "But what exactly did you change? Obviously i can see what you changed, but what does it do? I guess i could test the script.."


If you look at your original post and code, then look at the first code block I supplied, you'd notice I moved the plrfreeze to where it belongs, added a plrfreeze=0, and altered it just slightly.

No problem. Glad to help out, and hopefully our examples help to clarify some of your questions. Script writing takes practice, trial and error. Even I forget something sometimes- using a ; instead of a : and I've been a programmer for years.


Twitter: @NFoxMedia
Desecrated Studios
14
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Kirtona
Posted: 8th Aug 2011 07:51
Quote: "Why not? Just because I do does not mean I have a patent on that idea."


That's true.. Well the game is still in early development, so i might not want/need it.. Quick question (Sorry for so many, last one ) When do they choose games for BOTB? Is it coming up or did it already pass?

Quote: "If you look at your original post and code, then look at the first code block I supplied, you'd notice I moved the plrfreeze to where it belongs, added a plrfreeze=0, and altered it just slightly."


Oh alright, i see that now

Quote: "Script writing takes practice, trial and error. Even I forget something sometimes- using a ; instead of a : and I've been a programmer for years."


Yeah, i remember back in my C++ class/Java class there was a ton of trial and error. Scripting/programming is definitly a hard thing to do..

Thanks for commenting!

UPDATE - Yeah so... Your script doesn't actually work? I just tested it, and i walked up to the note and hit/held F and nothing appeared. I could also walk around. Maybe you misplaced a ; with a : or something? Ill give it a look and maybe see what is wrong

BlackFox
FPSC Master
17
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 8th Aug 2011 08:02 Edited at: 8th Aug 2011 08:25
Check your hud, make sure it is correct and in the correct place. Also ensure the object is dynamic- you can't run this script on a static entity.


Twitter: @NFoxMedia
Desecrated Studios
14
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Kirtona
Posted: 8th Aug 2011 08:07 Edited at: 8th Aug 2011 08:17
Quote: "Check your hud, make sure it is correct and in the correct place"

Yes and Yes

Quote: "Also ensure the object is dynamic- you can't run this script on a static entity."

It is dynamic, not static.

Yet it is still not showing up? Would it help if i gave you the picture?

EDIT - I have attached the picture im using. I edited it (blur) so that no one can actualy see what the words say. Tell me if you get it working..

Attachments

Login to view attachments
BlackFox
FPSC Master
17
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 8th Aug 2011 08:24 Edited at: 8th Aug 2011 08:28
Here is the actual script:



I substituted the hud, but it gives you the jist. I forgot the fact when displaying things like maps, notes, etc, we need to add a pause in there. I just checked one of my map scripts and that is what I do on mine, particularly if it is a book and requires the player to "read" multiple pages.


Twitter: @NFoxMedia
Desecrated Studios
14
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Kirtona
Posted: 8th Aug 2011 08:36 Edited at: 8th Aug 2011 08:42
That script doesn't work either, damn you trial and error! I probably shouldn't say that, but what ever

But no, it doesn't seem to be working. Again i walked up and pressed F and nothing appeared. And yes the entity is dynamic.. I don't really get what is wrong, texture path is fine.. And why does it need a timer? I thought that's what plrfreeze was kind of doing?

EDIT - Sorry if im wasting your time BlackFox, i don't mean to if i am. Also, i went back to my other script (i had mine and yours) and that one works with this:
- Have to hold F to view image
- Freezes player
- Unfreezes player

So all i have to figure out now is how to make it so the image stays up until the plrfreeze runs out. This should be fun!

BlackFox
FPSC Master
17
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 8th Aug 2011 08:42
I'm sorry, but the script does work. We just ran it here and it works.

I put a table on the floor, placed a dynamic entity on the table. I walk up, press F and the player freezes while the hud is shown. I press F, the hud disappears. If I stay in that spot when the hud disappears and press F again, nothing happens. If I walk away and reach the plrdistfurther value, then come back and press F, the hud comes up.

So it does work. Why it is not for you I cannot answer. The only thing I can think of is either you placed the script in the wrong spot (for example in the start instead of main), the object is static, your pointing to a hud where the path is incorrect, or there is an issue with your hud graphic itself.


Twitter: @NFoxMedia
Desecrated Studios
14
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Kirtona
Posted: 8th Aug 2011 08:51 Edited at: 8th Aug 2011 08:53
Here i have attached a picture of everything you said. Can you see where i messed up maybe? Sorry the picture is so big, i figured it would be easier to see..

Quote: "or there is an issue with your hud graphic itself."


I attached the picture i am using 2 comments back, there is no problem with it?

EDIT - Oh and the first screenshot should say ReadANote2 instead. That was when i was messing with my old script..

Attachments

Login to view attachments
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 8th Aug 2011 09:05 Edited at: 8th Aug 2011 09:08
Blackfox script works for me too.

Try this to get closer to what I think you want.



Edit: oops just fixed the image path

Desecrated Studios
14
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Kirtona
Posted: 8th Aug 2011 09:14
Quote: "Blackfox script works for me too."


FPSC hates me

Quote: "Try this to get closer to what I think you want."


Wow your's actually works?
I don't understand what was wrong with his though?
So yours does this (Rolfy)

- Walk up and hold F
- Displays image
- Can't move
- Release F, can move again

What do i need to add/change to make it so you don't have to hold F? Do i need a timer? Kind of like what BlackFox had? Thanks for your help though guys! If i get this finished i may let you guys get the demo first?

rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 8th Aug 2011 09:34
Quote: "What do i need to add/change to make it so you don't have to hold F?"

What you need is a good kick up the arse to make ya go work it out for yourself

I'm off for my milk and cookies then its bedtime.

Desecrated Studios
14
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Kirtona
Posted: 8th Aug 2011 09:44 Edited at: 8th Aug 2011 10:24
Quote: "What you need is a good kick up the arse to make ya go work it out for yourself"


Im working on it, i mean this is my first ever script thing..

Quote: "I'm off for my milk and cookies then its bedtime."


Not fair!!

EDIT - Wow it would be as easy as changing one thing I figured it out guys! Thank you for all of your help! I will put your names in the credits of my game!
Now i just have to figure out how to add sound to a script.. No help on this one guys, i want to figure it out on my own

Desecrated Studios
14
Years of Service
User Offline
Joined: 16th Jan 2011
Location: Kirtona
Posted: 8th Aug 2011 10:38
I DID IT, IM DONE, I HATE SCRIPTING, BLAHHH!

Thanks again for the help Rolfy, and BlackFox! I will still credit you

Login to post a reply

Server time is: 2025-06-08 00:10:45
Your offset time is: 2025-06-08 00:10:45