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 / When FPSC drives you NUTS

Author
Message
Mr illusionest
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 19th Aug 2012 02:42
You've read the title , I'm about to get bananas in here . That program is gonna kill me soon . I was working on a script that shows HUDs and plays sounds , the script simply refuses to work . I checked HUDs paths , sounds paths and script syntax about 10 times . NO MISTAKES . In the end It got fixed by changing this :


into this :


Seriously ! That's it ! I changed the general look ! that was the problem that got me hooked for over an hour ! can anyone explain this ?
Sorry for panic but this but I'm kinda crazy at the moment . Why didn't the first one work and why did the second one work ?

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 19th Aug 2012 03:13 Edited at: 19th Aug 2012 03:41
All of your hudresets should be state=0 this way they are all loaded ready to go before the script runs them.You might find your first script working if you do this, also you might find your second script stops working if you dont.

These conditions and actions could be on same line to tidy things up, if you included them both I am assuming you want them both met at same time, I can understand you doing it the way you have if you want either condition to trigger the action, but tbh I would have simply removed it if object not in centre of screen then required plrdistwithin and pickobject as conditions of it reappearing. Its not a huge script and wouldn't have much impact but when you have a lot of 'em its good habit to keep them as short and tidy as you can get them.

Quote: ":state=2,pickobject=0:hudunshow=hand,hudunshow=ASCSOP,state=1
:state=2,plrdistfurther=80:hudunshow=hand,hudunshow=ASCSOP,state=1"


Quote: ":state=2,pickobject=0,plrdistfurther=80:hudunshow=hand,hudunshow=ASCSOP,state=1"


Thats just from first glance

Awesome! Its one of those threads.
Mr illusionest
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 19th Aug 2012 03:38
Quote: "All of your hudresets should be state=0 this way they are all loaded ready to go before the script runs them."

Firstly I had put all HUD resets in state=0 , then I put each one in each state and it didn't work either , then I changed the script header and desc and it worked even with the states of HUD Reset all different , so that wasn't the problem .

Quote: "I would have simply removed it if object not on screen then required plrdistwithin as condition of it reappearing."

Not sure what that means , but those same lines work perfectly in many other scripts of mine , plus this is not the problem . the script was functioning but it was a mess , the script ignores timers and displays 2 HUDs at the same time , but When I just removed header and end of script it worked like charm ! what I'm asking is why ?

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 19th Aug 2012 05:07 Edited at: 19th Aug 2012 05:15
Quote: "Not sure what that means , but those same lines work perfectly in many other scripts of mine"

I'm sure they do work perfectly for you just giving you advice on how to reduce your scripts, doing this with all scripts will help the performance overall.

I have no idea why those lines should stop your script the engine should be ignoring them and I didn't see end of script in either version.

Awesome! Its one of those threads.
Mr illusionest
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 19th Aug 2012 05:15
Quote: ":state=2,pickobject=0,plrdistfurther=80:hudunshow=hand,hudunshow=ASCSOP,state=1"

won't that line require that the player get away from the object AND not look at it ? the purpose of seperating was to make it get away OR not look . Please correct me If I misunderstood that .

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 19th Aug 2012 05:20 Edited at: 19th Aug 2012 05:28
Quote: "I can understand you doing it the way you have if you want either condition to trigger the action"


In the case of this script if huds are removed with pickobject=0 then you don't need to remove it with plrdistwithin=, the player simply looking away will do it, when the script returns to a state requiring both conditions it will reappear. Its as important to optimize your scripts as it is to optimize any other media.

In my own mind you only need to include plrdistwithin= to remove hud if you expect the player to back away from the object while still keeping it centre screen which in most situations is unlikely, it might be the case that you expect this but I have no idea of your level design.

Awesome! Its one of those threads.
Mr illusionest
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 19th Aug 2012 05:35 Edited at: 19th Aug 2012 05:36
Well sometimes I apply it to big entities so If the player goes back while still looking at it he will be able to activate it from a mile away add to that I sometimes use inview=x with small objects that pickobject=x will be a pain with .
about your quoted line , sorry didn't remember it . It's 5 am in here and I'm very tired .

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 19th Aug 2012 05:40
No worries I can see why you would want it this way, just that in most cases with this kind of hud you expevt it to be a small object...book or note etc.

Awesome! Its one of those threads.

Login to post a reply

Server time is: 2024-11-23 21:47:56
Your offset time is: 2024-11-23 21:47:56