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 / [SOLVED] Mouse over entity displays text or HUD?

Author
Message
PixelF
11
Years of Service
User Offline
Joined: 30th Oct 2012
Location: United States
Posted: 8th May 2020 02:30
Hello,

I have one of Storyteller01's old adventure script that allows the player to walk up to an entity and press 'Enter' which displays a message saying "This is an old chest. It is empty". I want to add the ability for the player to walk up to the entity and if the player is looking at the entity, it displays a "?" so that the player knows that the entity can be interacted with. Here is what I have (Keep in mind that I have no FPSC scripting experience)



The lines with the // are my additions to the script.

The script works when I walk up to an entity and look at it and it will display the "?". However, nothing else work after that. When I remove my edits the script will work as it is supposed to. How to I fix this so that I can have the "?" popup and continue on with the interaction?

The author of this post has marked a post as an answer.

Go to answer

ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 9th May 2020 01:12 Edited at: 9th May 2020 01:31
This post has been marked by the post author as the answer.
PixelF First, Good start, But change all "timer" to etimer ( etimerstart & etimergreater)
And I see you have state=3 struck out where your "?" should be ? Let me test a little and get back with you.
And you want the "?" to be on screen at all times. Ok I think I get it now.

Ok, I see the problem. At this line of code...

State=4 does not go anywhere, it dead ends.

See if this works better for you...


Please note, I did not test this yet. And I don't know how you have this setup. So let me know if it works or anything else.
It's only off the top of my head This is a temporary fix. The "states=" need to be cleaned up and put into order.
** WHERE'S MY DARN YELLOW BUTTON ? **
PixelF
11
Years of Service
User Offline
Joined: 30th Oct 2012
Location: United States
Posted: 9th May 2020 02:09 Edited at: 9th May 2020 02:12
ncmako you are a god amongst men! Your script didn't work at first but I changed line 12 from



to



and it seems to be working perfectly now! I'm not sure if there is a cleaner way to write this script but it seems to work nicely. Thank you very much for your help!! Hopefully my edits don't create glitches or anything

For anybody else that find this thread, the entire script is this ->


Simply set an entity to dynamic, set it to IsImmobile to Yes, and place this script as the main script.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 9th May 2020 12:10
PixelF Oh yes, How could I miss that typo at state=4, Sorry. But glad it works
Great job finding error and fixing it Pixel.
** WHERE'S MY DARN YELLOW BUTTON ? **

Login to post a reply

Server time is: 2024-03-29 10:07:40
Your offset time is: 2024-03-29 10:07:40