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 to change door text & pick up key with "use"

Author
Message
Muzzles56
14
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Ireland
Posted: 20th Mar 2013 18:01
I'm not sure if this goes in scripts or not, so I'm being safe and putting it in here. How can I change the text on doors? I do not want it to say "Press ENTER to open door" or something. I would like to change it to E, as I find Enter is an annoying key to interact with things. Also, how can I make a player pick up items by pressing E, rather than walking over it? Are these implemented in the engine already, or are custom scripts needed? If so, can you supply me with them and tell me what box they need to be in for the effect to occur?
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 20th Mar 2013 20:32
Quote: "I'm not sure if this goes in scripts or not"


It does.

Quote: "How can I change the text on doors? I do not want it to say "Press ENTER to open door" or something. I would like to change it to E, as I find Enter is an annoying key to interact with things."


I wrote a basic tutorial on how to have a hud display when near an entity. You can get it here. It is just a basic, but the principles of this guide are used throughout all scripting. Basically, you need to change the hud being called in the script you are using.

Quote: "Also, how can I make a player pick up items by pressing E, rather than walking over it? Are these implemented in the engine already, or are custom scripts needed?"


In your script, you can use "scancodekeypressed=18" which is assigned to the "E" key. When that key is pressed, then you can tell the script to "give to the player", etc. You can view the key assignments here.

These types of scripts are not implemented in the engine. Most of us write our own scripts for what we want in our developments. An example on the forum is here.


There's no problem that can't be solved without applying a little scripting.
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 20th Mar 2013 20:36
You can easily change the the hud of dooruse or use this:
it use the fpgcraw commands to create a text line



Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 20th Mar 2013 20:46 Edited at: 20th Mar 2013 20:47
Muzzles,

Real quick, not too many here will just write the script for you. We all want to see you make an attempt. You will never learn if you dont screw it up first.

That being said

This is fairly easy to do. Youll have to use editing software like Gimp or Photoshop.

There are a few lines of the door code youll have to change as well as making a custom hud. But all are fairly easy to do.

When you approach a door the engine looks to see if your within x.
The line looks something like :state=X,plrdistwithin=50
in the above line when the player is within 1/2 of a square(square-100) then it displays a hud i.e "door locked you need a key" what you need to do is edit this hud to say what you want i.e."this door is locked you moron" There are a ton hud editing tuts out there just search it out. Difficulty scale 1-10 1 being very easy 10 be impposible I'd say it's a 3.

As far as pressing E to open the door. That is fairly simple, look again at the door code. there should be a line that says scancodekeypressed=x. Every key on your keyboard and mouse have an assigned numeber. You simply change the number to the key you want to use. There are keyboard maps out there, again search it out.

Editwhile I was typing that two people replied. lol
Muzzles56
14
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Ireland
Posted: 20th Mar 2013 20:50 Edited at: 20th Mar 2013 22:57
I have no experience in scripting, but from scripts I've seen, it looks fairly logical and simple compared to other languages. I might learn during April or so, but I simply do not have time right now. Thanks for the solutions, everyone. I'll try some now.

I have achieved these things now. Thanks guys!

One more question though. Rather than make a new topic, I may as well put it here. Say I pick up key A which opens up door A. When I don't have the key, I want door A to say "Door locked" and when I have key A, I want door A to have no text. I'm sure this is easy to accomplish for pro scripters and even novice ones, but I have not begun to learn the language yet. Sorry!

Login to post a reply

Server time is: 2024-11-23 17:28:32
Your offset time is: 2024-11-23 17:28:32