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 / FPI scripting / Help for Newcomers , Inexperienced users

Author
Message
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 11th Oct 2010 21:00 Edited at: 11th Oct 2010 21:01
I decided to make this thread , as I'm seeing a lot of new threads for small scripts,which quite frankly are clogging up the section.

I see a lot of people don't understand the basics of FPI,so I'd gladly help them understand to the best of my knowledge.

If you have any questions about the scripting language,have some sort of script error and can't quite figure out how to fix it,ask here.

Before you proceed , read this first - http://en.wikibooks.org/wiki/FPI_Script

Remember this is not a request board,don't ask me to write your scripts from scratch.

I hope I can be useful to someone atleast.
-Gencheff

SecretiveOps
14
Years of Service
User Offline
Joined: 13th Sep 2010
Location:
Posted: 11th Oct 2010 22:53
I'll help you out. I have quite a few tricks up my sleeve too.

Why does life suck the life out of you?
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 12th Oct 2010 00:23
Actually, I think if they titled their threads better, making a new thread for each problem would be more benficial. That way, if a smart user happens to come in and runs a search for their problem, they will likely find it, along with the solution.


The one and only,


Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 12th Oct 2010 18:36
You make a valid point there Ply , however my main idea here is to help the users understand the language.

I do agree with you , however it doesn't hurt for the so called 'smart' user to read this thread as well,if they really need to fix their script.It would be a logical thing to do , as long as it doesn't get bumped off the first 1-2 pages.

You know,this gives me an idea.I should write down the basics with some explanations in this thread.If anyone feels this is needed,let me know.

Cheers,
Gencheff

bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 12th Oct 2010 19:35
I for one would definately like to see a 'Scripting for Dummies' type thread!

I try to make threads with good titles, but I feel like I would be better off if I understood FPI scripting myself, that way I wouldn't have to keep pestering you guys for help lol

King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 13th Oct 2010 00:35
I made a thread a few days ago asking for some help with a script i had put together. Nobody answered though, and i'm still stuck. I really need it, and i've tried everything i can think of, but it won't work properly. This is the original post:

-------------------------------------------------------------------

It's kind of hard to explain in a title, but i've attempted to implement JRH's disorientation script into a spawn script i have for an enemy. The script normally plays music when the enemy spawns, and stops when the it's destroyed. But i need to add the disorientation effect to it. I've tried many different ways, like playing around with "runfpidefault" values, changing the "state" values, etc. But no luck. The camera either zooms in real quick, then back out, and no music plays, or it stays zoomed in (as intended) but loops a loud, 'glitchy' sounding noise really fast. It's kind of hard to explain. Either way, the script doesn't work. And although i'm trying to learn how to script, i couldn't make a decent one if my life depended on it. The only scripts i've ever been successful with were very simple audio ones. I was hoping maybe someone could point me in the right direction with this one. What am i doing wrong? Did i miss something?

This is my attempted combination of the two scripts:



PS: The disorientation script is intended to be applied to a trigger zone, but i just used a certain part of it, not the other trigger zone and timer commands.



Thanks in advance for any help.

Cheers, Jake
------------------------------------------------------------
-The Clarkson Residence- (WIP)
SecretiveOps
14
Years of Service
User Offline
Joined: 13th Sep 2010
Location:
Posted: 13th Oct 2010 11:17
Yes, I saw that post. I'm stumped myself. Plystire should be able to help. He got us into Vanilla FPSC, and he can help us through it.

Why does life suck the life out of you?
Mr illusionest
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 13th Oct 2010 18:19
Nice thread Gencheff , but like all of the understanding language thread you will find a lack of posting due to people wanting to get help from all members , so they just post out .

Not trying to underestimate this type of threads , Keep up on helping the community man , And if you need anything just contact me with any way you want .

Cheers

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 13th Oct 2010 21:11
@Mr Illusionest - Even if one finds this useful it still serves a purpose.The ambitious people willing to learn and do things on their own are the ones who will be the next BOTB or VBOTB holders.

@King Of Khoas - I'll get back at you on that script tomorrow.I'm a bit busy right now to test anything.

@bruce3371 - Then in that case , I should get started on writing it.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 13th Oct 2010 23:07
@King of Khaos:

I thought I had posted in your thread.... hmmm, maybe I didn't click post.

Anyway here is what I had intended to tell you:

Try using the following:


It seems to me that by doing the musicoverride on every loop causes it to restart the music every time, which may result in a glitchy sound... however, the camfov NEEDS to be used on every loop, otherwise it returns to the normal FOV.


Quote: "I for one would definately like to see a 'Scripting for Dummies' type thread!"


I made one of those a long time ago. Let me see if I can go find it. It was basically the thread where I made the tutorials that you can now find in the ofpscguide.pdf included in your Docs folder.


The one and only,


King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 14th Oct 2010 06:20 Edited at: 14th Oct 2010 06:48
Thanks a lot for the script Plystire, the camera stays zoomed until the enemy dies, then it goes back to normal. The only problem is, the enemy doesn't go after the player, it just stands there. Even if i run into it, it doesn't respond. It just stays idle, doing it's normal idle animation. Thanks again for the script edit, i appreciate it. I'm just wondering if there's something in the script that might make the enemy stay idle if it's altered? If so, how would i make it so the enemy still attacks the player? I'm sorry if i'm hassling you.

EDIT: Could it be a problem with the AI Main script?



Is something wrong with it? I don't recall ever changing anything, but who knows...

Cheers, Jake
------------------------------------------------------------
-The Clarkson Residence- (WIP)
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 14th Oct 2010 22:32
The enemy didn't do anything because it wasn't told to enter the Main script... but remember that once you LEAVE the "start" script and start using the Main script, the start script commands won't be used anymore. This means that your FOV will likely not work anymore. You will want to place the FOV command in the Main script, so that it can execute continuously.

Here is your altered Start Script... just make sure to put the fov command in the Main script, and it should work.




The one and only,


King Of Khaos
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 15th Oct 2010 00:15
I think you meant to make the runfpidefault a "1". It's fine, i added it, and now the music and chasing works perfect. I DID have a problem with the camfov staying in action though, but i messed around with a few things and figured out a way to make it so it stays as long as the player is within a certain distance. It gave me a cool idea, so i'm leaving it as it is. Everything works perfect now, and i really appreciate you taking the time to explain this to me. Thank you.

Cheers, Jake
------------------------------------------------------------
-The Clarkson Residence- (WIP)
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 15th Oct 2010 05:13
No problem at all! Glad you got it working!


The one and only,


riccetts
14
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 15th Oct 2010 19:43
Hello
I have 1.17 fps,I tried a text script but it won't work with trigger zones or other entity's.Can anybody futher explain how to use the script?
If the player doesn't know the object of the game it's a worthless game.
Here is the snipet:

Attachments

Login to view attachments
Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 15th Oct 2010 21:47
Your submitted script:



Here's a known functioning script:



Virtually identical to yours, but with a few minor changes.

Replace plrwithinzone=1 with plrdistwithin=60, to use the script with a dynamic entity.

Replace [YOUR MESSAGE HERE] with your text.

Set the script as the Main Script for the triggerzone/entity, and you should be all set.

Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 15th Oct 2010 21:56
Seth Black's suggestion should work.

Basically what happens in the first row after the ;Trigger is sort of a preperation for the text (Font,Size,Color,Position)

The second row is to check if the player is within the trigger zone.If so,show the text.

However I would go with Seth's suggestion to use plrdistwithin instead of plrinzone.

plrdistwithin has a certain radius defined by the user,while plrwithinzone is just 1 segment (100x100 units).




You can still apply it to a trigger zone or a dynamic light as it's main script.

The position of the light/trigger zone is considered the point from which it will be checked if the player is near.

Login to post a reply

Server time is: 2024-11-24 19:34:45
Your offset time is: 2024-11-24 19:34:45