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 / Trigger zone and terminals

Author
Message
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 6th Sep 2010 03:10
My issue is that i have a terminal right outside of a outpost, to welcome the player with some information about the game. I have a trigger zone right beside the terminal, ive named the terminal terminalA and the trigger zone, trigger_zone. Now this is ware i come to ask you guys for some help, i made the .jpg file with a black background green text, and i want it to pop up when the user approaches the terminal. To do this, i need the trigger zone to work.

Basically im asking any one have any experience with this and could tell me how to do it right? thanks in advance.

If this signature is not allowed please let me know
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 6th Sep 2010 05:25
If any one has any suggestions im open to hear them, thank you.

If this signature is not allowed please let me know
Nbt
16
Years of Service
User Offline
Joined: 11th Oct 2009
Location: Behind you!!
Posted: 6th Sep 2010 13:26
Why not use a story zone, as after all they were made for popping up info regarding your game.

Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 00:38
Will it work? i haven't used the story zone, trigger before.

If this signature is not allowed please let me know
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 7th Sep 2010 01:01 Edited at: 7th Sep 2010 01:02
Quote: "My issue is that i have a terminal right outside of a outpost, to welcome the player with some information about the game. I have a trigger zone right beside the terminal, ive named the terminal terminalA and the trigger zone, trigger_zone. Now this is ware i come to ask you guys for some help, i made the .jpg file with a black background green text, and i want it to pop up when the user approaches the terminal. To do this, i need the trigger zone to work.

Basically im asking any one have any experience with this and could tell me how to do it right? thanks in advance."


You actually don't need to use a trigger zone. I've done many different things in the way you described. So many of our developments have the player approaching a terminal or other item to have a hud come up. Here is an example.

1. Put this code in a script:



Change the <path_to_your_hud.extention> to where your hud is, and change HUDNAME to whatever you want (must be the same for both HUDNAME instances).

2. Place your terminal on the map. Right-click it to access the properties.

3. In the Script AI Main, assign the script you created with the above code.

4. Click Apply.

Here is how the script works:

1. Player approaches the terminal. When they hit the distance parameter of 50, the hud displays.
2. When the player moves away the hud disappears and the script ends.

As I mentioned before, I have many different variations of scripts that are assigned to objects that give the player information. This example was one of the easier ones. You can adjust the "plrdistfurther=40" and "plrdistwithin=50" to whatever suits you. If you want the hud info to keep showing up when the player walks away and returns, you can do the following by changing this line of code:



Hope that gives you some help.

- BlackFox

RPG Mod- Create a world full of adventure
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 04:36
what do you mean by "Hud extensions" do you mean the directory the files where installed to?

If this signature is not allowed please let me know
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 7th Sep 2010 04:46
Quote: "what do you mean by "Hud extensions" do you mean the directory the files where installed to?"


The path and extension where the hud file is. For example:

c:\FPS Creator\gamecore\huds\myhud001.tga
c:\FPS Creator\myhuds\myhud002.png

The .tga or .png are the extensions. Some of my huds are in TGA, others in PNG. The path is the directory where these files will reside.

- BlackFox

RPG Mod- Create a world full of adventure
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 06:13 Edited at: 7th Sep 2010 06:15


Thats what i have so far, i hope i did it right. I had to look it over a dozen time.

Question is now though. How to put this in to the terminalA model in the properties menu, the reason its in the language bank is because its an english game and therefore the text is english. Correct me if the folder is wrong

If this signature is not allowed please let me know
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 7th Sep 2010 06:29 Edited at: 7th Sep 2010 07:23
Correct your script to this:



Removed the "<" and ">" from the path, and changed the "/" to "\", which "/" is used in web addresses and the "\" is for path lines.

Quote: "
Question is now though. How to put this in to the terminalA model in the properties menu
"


Place the entity model where you want it in the map. Right-click on it to access the properties. In the AI Scripts section, Main script, click the little "..." (you will need to left click in the white square if it has something like default.fpi) and browse to where you put your script. Then click Apply changes at the bottom left.

- BlackFox

RPG Mod- Create a world full of adventure
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 06:49 Edited at: 7th Sep 2010 06:56
Its not working, its telling me that there are more the one colons ( in selected line, please revise. Now im looking at the file directory and i see the (C:/program files, so i assume thats ware the extra colon is.



This is the changed code

I put the script in the AI main, but its not popping up when i approach it for some reason.

If this signature is not allowed please let me know
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 7th Sep 2010 07:08 Edited at: 7th Sep 2010 07:15
Ok try this. In my configuration I have my huds going into RPG_Mod\Huds\gamename\ (which the RPG_Mod folder is located inside FPS Creator\Files folder). I checked all my scripts and I don't specify the absolute path, but just the folder inside the FPS Creator\Files folder. So my folder structure is:

FPS Creator\Files
FPS Creator\Files\RPG_Mod
FPS Creator\Files\RPG_Mod\Huds
FPS Creator\Files\languagebank\english\

In your case, change the state=0 line to read:

:state=0:hudreset,hudx=86.2,hudy=23,hudimagefine=languagebank\User\testwelcome.jpg,hudname=HUD1,hudhide=1,hudmake=display,state=1

Then ensure the hud you have (testwelcome.jpg) is located in the path FPS Creator\Files\languagebank\user folder.

The main thing is to specify where you are placing the hud. For example, if you put your huds in the languagebank\english\gamecore\huds folder, then that is the path. If you are putting in a folder called MyHuds in the FPS Creator\Files folder, then your path would be MyHuds\hudfilename.jpg

Follow?

- BlackFox

RPG Mod- Create a world full of adventure
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 07:15 Edited at: 7th Sep 2010 07:17
Its saying, Condition command invalid in selected line, please revise.
i changed the state=0 to read and im getting that error.

im going to start over and try again with this part of the game

If this signature is not allowed please let me know
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 7th Sep 2010 07:20 Edited at: 7th Sep 2010 07:21
Ok look at this:



First, make sure your jpg hud is in the languagebank\user path.

Second, you had specified HUD2 and HUD3, when the HUDNAME is HUD1. Therefore, HUD1 is the hud name you need to specify for the hudname, hudshow, and hudfadeout commands.

- BlackFox

RPG Mod- Create a world full of adventure
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 07:26
well hold on, i remade the place ware they should go. This is the code,


If this signature is not allowed please let me know
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 7th Sep 2010 07:32 Edited at: 7th Sep 2010 07:33


- BlackFox

RPG Mod- Create a world full of adventure
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 07:37
It saved and i put the script in the ds_huds folder. And i also put the .jpg file in the folder, but it dont pop up in game.

If this signature is not allowed please let me know
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 7th Sep 2010 07:39
Quote: "It saved and i put the script in the ds_huds folder. And i also put the .jpg file in the folder, but it dont pop up in game."


Ok, place a trigger zone and apply the script to the trigger's AI Script main and see if that did it. If it does not work, I have no other answers to offer. We have multiple developments that have been completed and sold, where scripts are assigned to entities, triggers, etc and it works perfect.

- BlackFox

RPG Mod- Create a world full of adventure
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 07:46
i need some one to show me how, i am having a vary frustrating time.

If this signature is not allowed please let me know
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 08:06 Edited at: 7th Sep 2010 08:20
Fox, you still there?



thats the code. I am having a vary tough time figuring this out.

Thanks for leaving me hanging dude, seriously.

This is what i do, i take the code and open my FPI EditPad program. I past it in there and make the changes that need to be changed, i hit save and i put it in the folder that it needs to be saved to. I go in to FPSC i find the AI main and then click on the little "..." thing and nav all the way to the script i just made, i select it and hit ok, ok. I test the game, i approach the terminal. Nothing...

If this signature is not allowed please let me know
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Sep 2010 17:45 Edited at: 7th Sep 2010 18:20
First of all, Blackfox would not just leave you hanging on purpose. According to the times of the conversation, it appears that it was getting late in his time-zone.

You are still having difficulties coming up with the correct path, however, all is not lost.

I see that you are using FPI EditPad. This app has an easy way of adding huds. I'm in the process of making some images to show you how to do that. Give me a few minutes and I will post them.

Addendum:

OK here are the images.

The first image shows the text cursor on a blank line and the arrow pointing to the menu item "Insert".



We click on that menu option and we get a popup window showing additional options. Select "Hud Definition..."



You now get a file selection window. It starts in the FILES folder of FPSC. Find your file and then select it. BTW, you will notice it defaults
to PNG file extensions. Go to the drop down extension's box in the lower right hand corner and select your TGA extension.
I programmed it this way to get rid of the clutter of all the possible files.



You now get pop up window to enter the name of your hud and also the x and y coordinates. Put in that information and click on "OK".



You will now see that the hud statement line is created automatically for you. with the correct path location of your hud.



The next possible issue with this is that you must put your script within the main AI of a dynamic entity. It cannot be static or the script will not work.

I reject your reality and substitute my own!

Add more adventure to your game -- use RPG Mod
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 20:33
I got the script in to the entity i wanted, and started the game. I approached it and it still didn't work, so i gave up and tried to put a trigger zone by the entity. THAT didn't work, i followed the steps you said on how to write the script. But other then that, im at a loss.

If this signature is not allowed please let me know
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Sep 2010 20:50
I'm at a loss at your at a loss. Please post your new script in a code snippet. I will use my own hud to try and duplicate it.

I reject your reality and substitute my own!

Add more adventure to your game -- use RPG Mod
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 21:00 Edited at: 7th Sep 2010 21:02


it saved with no problem, and i was able to put it in to the TerminalA entity, tried to approach it while it being a dynamic entity and it didnt work. All i want is to see the little thing i made in photo shop, a black background with some green text.

Like, when you approach it, it pops up. And when you back away it vanishes on till you re approach it.

If this signature is not allowed please let me know
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Sep 2010 21:03
Give me some time and I will set up a map with a similar terminal using this script. I will use my own hud but in the exact location and with the same file type and name.

I reject your reality and substitute my own!

Add more adventure to your game -- use RPG Mod
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 21:06
take your time

If this signature is not allowed please let me know
ctm
21
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 7th Sep 2010 21:08
Where is this "\ds_huds\" sub folder?

If it is not in the scriptbank folder the script will not work.

When i saw your picture i made a test:

I used a the same script 2 times in a room. I put one in the scriptbank\user folder and the other one in the gamecore\huds folder.
Then i tested it. Only the one in the scriptbank folder worked.
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Sep 2010 21:10 Edited at: 7th Sep 2010 21:12
I may not have to do that. I think I might have discovered the problem. I was looking to see where you had your script. It looks like it is outside the "scriptbank" folder. All scripts must be within the scriptbank folder. A script can be in a subfolder of the scriptbank folder but not outside of it. It looks like your fpi script is outside the scriptbank folder. Try putting it in the proper place and assign the new location to the main AI and try running again.

Addendum:

ctm saw this problem as well and beat me to the draw.

I reject your reality and substitute my own!

Add more adventure to your game -- use RPG Mod
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 21:11
Could you tell me how you did it exactly? did you put it in with the dds files?

If this signature is not allowed please let me know
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Sep 2010 21:13
The hud location is fine. It is your fpi script that isn't working. It's not working because it is not in the scriptbank folder. Please read through the posts by myself and ctm.

I reject your reality and substitute my own!

Add more adventure to your game -- use RPG Mod
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 21:17
I need a video to show me how to do this..

Did you use a trigger zone?

If this signature is not allowed please let me know
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Sep 2010 21:17
Also, you need to make sure you have in the script, the hudshow command. hudshow=name of hud

I reject your reality and substitute my own!

Add more adventure to your game -- use RPG Mod
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Sep 2010 21:18 Edited at: 7th Sep 2010 21:18
You need to learn more about the basics of scripting my young jedi. No, I'm not going to make a video of something so simple.

I reject your reality and substitute my own!

Add more adventure to your game -- use RPG Mod
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 21:22
any tutorials then on how to do it right?

If this signature is not allowed please let me know
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 7th Sep 2010 22:01
There are no tutorials. There is a user manual that comes with the product. It is common knowledge that scripts must reside in the files\scriptbank folder. I guess I made an error assuming that this was a well known fact.

Let's simplify the issue for you.

1. The script I was showing you works- I have many variations of it that I use. Scripts reside in the files\scriptbank folder.

2. Wherever you place your huds, you will need to put the path in the script. for example, you had "hudimagefine=gamecore\huds\ds_huds\testwelcome.tga", so make sure that tga file is actually there.

3. The script gets assigned to the entity you are using. If it is a crate, a box, a tank, etc, it gets assigned to the Scripts AI Main field.

4. Make sure the hudname=, hudshow=, and hudunshow= all use the same name. If you give it hudname=test1, then hushow=test1 and hudunshow=test1. If you are using hudfadeout= instead of hudunshow, then that is fine- it follows the same conditions as hudshow/hudunshow.

5. When you are asking for help, remember that a lot of us are in various time zones. You might have been wide awake and anxious to get this solved, but I needed some sleep after being up for the last 36 hours. Don't assume people are leaving you to hang.

6. Recommendation- look at the application and play with it. Put some entities in the map and look at their properties. Take a look in the scriptbank folder to view the different scripts. You will need to know the basics to make this all work for you.

With that said, I'll take my leave and let you play around with it.

- BlackFox

RPG Mod- Create a world full of adventure
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 7th Sep 2010 22:41 Edited at: 7th Sep 2010 22:47
i just tried it and i dont know why it still wont work, im about to call it quits on trying to put information in the game.



i put the script as shown above in the correct place this time, which is in the scripts bank. And left the TGA file in the ds_huds folder, changed the HUD1 to Hud1 and opened FPSC, made a little level. And put the TerminalA entity in the center, followed by a marker for the player. Now i start the game to test it and i go over to the terminal. Nothing pops up, so i need to have a trigger zone as well? or am i not putting the TGA file in the right location?

Also, just to clear this, i put the testscript.fpi file in the ai main part of the properties. Do i do anything with the "If used" parts of it or what, ive not gone to sleep all night trying to figure this out.

I changed the testwelcome.tga file to just welcome.tga

If this signature is not allowed please let me know
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 8th Sep 2010 00:10
Skynet Games,

I have created a tutorial you can download. This is one of the simplest tutorials on displaying a hud and scripting. I know it works because I made this document, and I use these methods quite extensively.

You can download it here:

Entity displays hud when player approaches it

Please understand as well when I say this, and I mean no disrespect. Many of us have used this product for a long, long time. It is overwhelming at first for new people when they are first starting out. However, you need to remember to look at everyone's posts before you make your post. Your script kept appearing with the same errors, and unless there is a language barrier, you just did not grasp the concepts that either myself or Flatlander tried to tell you. Some of us are willing to help, but you will also need to take steps to show that you are trying to learn. We will not do the work for you.

With that said, read the tutorial. It's very simple, practice with it. Play with FPSC and learn the dynamics of it- where scripts go, what the file\folder structure is. It will help you to understand the issues you will face if you have some sort of idea to the product's structure and function.

- BlackFox

RPG Mod- Create a world full of adventure
Skynet Games
17
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 8th Sep 2010 00:42
THANK YOU!!

The tutorial works!! now i can continue with the introduction to level 1 of the game.

Thanks vary much fox!

If this signature is not allowed please let me know
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 8th Sep 2010 01:23
Quote: "THANK YOU!!

The tutorial works!! now i can continue with the introduction to level 1 of the game.

Thanks vary much fox!"


No problem. Glad to be of help.

- BlackFox

RPG Mod- Create a world full of adventure

Login to post a reply

Server time is: 2026-07-26 22:00:23
Your offset time is: 2026-07-26 22:00:23