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 / How would I make text appear when I walk in certain places?

Author
Message
AceEvo
14
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 3rd Oct 2010 23:33
I'm not asking for someone to do this for me, but I'm new to scripting and I'm not sure how I would do this. When I stan in a certain place, I want text to appear, but only one time.. How would I do this?
nikas
15
Years of Service
User Offline
Joined: 23rd Apr 2009
Location:
Posted: 4th Oct 2010 00:00
searche huds on the forum search.....

AceEvo
14
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 4th Oct 2010 01:19
Ok, I searched HUDS... Yet I didn't find anything to help me..
King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 4th Oct 2010 06:08 Edited at: 4th Oct 2010 06:12
I will try to explain this best i can.

Credit goes to BlackFox, as he showed me the script...

Notice: From glancing at the steps below, this might look like a lot of work, but that's just because i'm being very detailed.


1. Create a hud (image) to appear when you step into the zone, and save it (without spaces in the name) into your huds folder, which is in your gamecore folder.
(If you need more help on this, just tell me.)

2. Copy and paste this script into notepad:



3. Replace the "X.file", with your exact image name, followed by the file type. (Example: textimage.jpg)

4. After that, wherever you see an "X", type just the image name. (Without the file type) Now save the notepad file as a ".fpi" in your scriptbank folder.

5. Go into your FPS Creator project, and place a trigger zone for where you want the text to appear when the player steps there.

6. Right click on the trigger zone to go into its properties. Next to the "Main", property, it will say "plrinzone.fpi". Click all the way to the right of that rectangular box.

7. Locate the fpi (notepad) file you saved, and double click it. And just in case you don't want the little "trigger sound" to play when you step into the zone - At the bottom left where it says "Sound0", erase what it says in the box to the right of it. (That's IF you don't want the trigger sound to play when you step into the trigger zone)

8. Apply changes.

That's it! Now when the player steps into that trigger zone, the text will appear on-screen.

(Note: If you want to change the area of the screen the hud appears in, then adjust the "hudx=" and "hudy=" values to your liking.)

Remember, if you get stuck or have a question about something, just tell me.

Cheers, Jake
------------------------------------------------------------
-The Clarkson Residence- (WIP)
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 4th Oct 2010 09:05
If you use 1.16 or later you can use scripts which run FPGCRAWTEXT.

Here is a ready example from my AGSP script pack displaying a single textline when player enters a trigger zone:


You can edit the text within the script without the need to use a hud.

Download links for the whole pack are in this thread: http://forum.thegamecreators.com/?m=forum_view&t=171157&b=23

In case you find my grammar and spelling weird ---> native German speaker ^^
King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 4th Oct 2010 15:22
I didn't know there was something that just let you display text without a hud! I just might use that!

Cheers, Jake
------------------------------------------------------------
-The Clarkson Residence- (WIP)
AceEvo
14
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 4th Oct 2010 22:47
King of Khaos, thank you very much! That helps me greatly, especially with all the detail! Unfortunately, my computer cannot run FPSC v1.16 (for reasons unknown..) so you've really helped me alot! Thank you!
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 4th Oct 2010 23:19 Edited at: 4th Oct 2010 23:20
Unfortunately, you need FPSC v1.16+ to use the FPGCRAWTEXT command. Hence the method supplied above will work for any version. Remember too that the hud file does not need to be a box with text- it can be just text only.

If you use a text-only hud, remember to set the text color opposite your background in the game. For example, if you are playing a game with dark screens, your text should be lighter so people can see it. Also, you can make your hud with either Photoshop, Gimp, etc. Save it as a TGA or PNG if you want to have transparency.

- BlackFox

RPG Mod- Create a world full of adventure
AceEvo
14
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 4th Oct 2010 23:40
Quote: "Unfortunately, you need FPSC v1.16+ to use the FPGCRAWTEXT command. Hence the method supplied above will work for any version. Remember too that the hud file does not need to be a box with text- it can be just text only.

If you use a text-only hud, remember to set the text color opposite your background in the game. For example, if you are playing a game with dark screens, your text should be lighter so people can see it. Also, you can make your hud with either Photoshop, Gimp, etc. Save it as a TGA or PNG if you want to have transparency.
"


Haha, I already knew that
Thanks though.

Quick question, what kind of extension is .TGA? I've never heard of it.
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 4th Oct 2010 23:48
TGA is an initialism for Truevision Graphics Adapter.

TGA files commonly have the extension ".tga" on PC DOS/Windows systems. Some media will use either DDS, TGA, PNG, JPG for the texture files.

We use TGA for our huds, others use whatever format they want to use.

- BlackFox

RPG Mod- Create a world full of adventure
AceEvo
14
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 6th Oct 2010 03:18
I seem to be having trouble. I edited the script you showed me, and it seemed like it should work. I made a text box 9the hud) in paint, saved it as a png, and put it in my gamecore folder.

What have I missed? The hud doesn't appear when I walk into the trigger zone.
King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 6th Oct 2010 05:25 Edited at: 6th Oct 2010 05:28
@ AceEvo - Did you put it in the "huds" folder that can be found in "gamecore"? If it is in there and it still doesn't work, try making the file a .jpg, .tga or .dds...

Note: .jpg doesn't support transparency, so i would try avoiding it if you don't want the letters to appear in a solid box. It sounds like you do, but just for future reference...

Tell me how it works out. Also, why don't you give The Storyteller 01's script a shot? I'm actually using it for the game i'm making now, and it's really nice!

Cheers, Jake
------------------------------------------------------------
-The Clarkson Residence- (WIP)
Brunopark09
14
Years of Service
User Offline
Joined: 7th Jul 2010
Location: Santiago de Chile
Posted: 6th Oct 2010 08:06 Edited at: 6th Oct 2010 08:07
I think this will work:



Replace "YourTextGoesHere" with your text

EDIT: For 1.16+

SCI FI MEDIA IS NEVER ENOUGH!
AceEvo
14
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 8th Oct 2010 18:07
Thanks guys, I ended up using King of Khaos' script. Works like a charm, thanks alot.

Login to post a reply

Server time is: 2024-11-24 19:32:39
Your offset time is: 2024-11-24 19:32:39