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 / Mouse over object, press a key then display text

Author
Message
Burger
11
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: New Zealand
Posted: 26th Jun 2012 12:11
I just want to say I already have displaying text sorted, I'm using TextEase. But what I don't know is how to have the condition in my script if the mouse is on an object.

For example, there's some leaves on the ground. When the player looks at the leaves (mouse on the object), the player can press F (or any key, the ocfpsc guide has scancodekeypressed chart I can use) and the description I have set displays. So when looking at the leaves, after pressing f it will say: "A quick count reveals 69,105 leaves" or whatever. I'm relatively new with scripting, but I'm not sure if theres a condition for this.

Any help is appreciated

That's right, I'm Mr T.
The Storyteller 01
14
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 26th Jun 2012 16:02 Edited at: 26th Jun 2012 16:02
I am working on a simple script (I even have done it partially before, just cannot find it) that displays a "?" when the mouse is pointing at something and after pressing enter displays "whatever text".

Its darn easy but I am working on a 1-3 liner script that displays stuff in a way like.

Quote: "
"whatever player sees"
"whatever comment or thought"
"press <key> to do whatever" (if apropriate)

---> and pressing the <key> might open other options"


which means I have to use hudtext combined with rawtext and that takes an evening of testing

In case you find my grammar and spelling weird ---> native German speaker ^^
maho76
12
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 26th Jun 2012 16:47 Edited at: 26th Jun 2012 16:48
in combination with plrdistwithin/further...

ched80s script syntax list (sticky):

Quote: "3.8.1.27 PLRNOTFACING=X
Description: Is true if the player is not facing the entity within ± X°. If X is 0 then a default range of 35° is used."





The Storyteller 01
14
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 27th Jun 2012 04:30 Edited at: 27th Jun 2012 04:32
The script is done. But since I couldnt make the hudtext to get any colour (hudred=xx etc. doesnt seem to work)its just rawtext.

The example script is for a key that can be picked up:


What does it do?

1. when the player moves the crosshair over the object a "?" is displayed.
2. after pressing ENTER "an old key" is displayed.
3. after pressing ENTER again "press <enter> to take the key" is displayed
4. and after pressing ENTER a 3rd time the key is finally picked up.

To make the whole thing a little less boring, the player is not frozen while the script is running (as in my previous AGSP scripts).

Instead the text display disappears when the player moves the crosshair away from the object AND the script stores the 'state of exploration'. That means if the crosshair is removed at stage 3, the next time the player moves the crosshair over the object again, the text from stage 3 will be displayed and the player can immideately take the object.

I hope this is what you wanted @Burger

In case you find my grammar and spelling weird ---> native German speaker ^^
Burger
11
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: New Zealand
Posted: 28th Jun 2012 07:44
Thank you, this is what I wanted. I based this script off of yours:

I'm still refining it a little and figuring out what I don't need to make it a breifer script.

This will greatly improve the story or theme of my game, it will be more interesting, create puzzles, create a little more realism and so on.

That's right, I'm Mr T.
ivanfv1989
11
Years of Service
User Offline
Joined: 30th Jun 2012
Location:
Posted: 6th Jul 2012 15:10
Hi, thanks for the script, but the script you posted only works on dynamic objects,

I want a script to display a text when the mouse is over a static or dynamic object, like a crate for example, or a stone.

It seems quite simple but I can`t find the way to create that script,

anyone knows any solution?
Burger
11
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: New Zealand
Posted: 7th Jul 2012 09:46 Edited at: 7th Jul 2012 09:47
Here, and yeah this can only be done with dynamic objects. In my script you have to push F, so take the scancodekeypressed line out for text to display as you look over it.



One trick I use is to have a static object that I want to have a description, then I have an identical dynamic object over it with an invisible texture assigned and the display text fpi script. Essentially meaning, invisible duplicate that can display text while only a normal static object is seen

I'm inspired by my own wise quotes, thank you.

Login to post a reply

Server time is: 2024-04-19 21:22:40
Your offset time is: 2024-04-19 21:22:40