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 / Script goes from State 0 to State 8 without stopping?

Author
Message
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 24th May 2009 20:10
I am having a little issue with the following script, and I am hoping someone can help me out here. Instead of using voice actors and such, I want to use HUDs for text to display. When the player gets within 100 of the entity, the first HUD displays with no problem, and then waits for the player to press the Enter key. However, when I press the enter key once, the script goes all the way to State 8 instead of going to state 2. When this happens, all custom huds disappear, and then I have to back away from the entity and approach it again. However, the entity then shows the very last HUD instead of any of the others.

The code:


Anybody have any clue why this is happening? Shouldn't the code move to state 2, and then wait for me to hit enter, and then when that happens state 3, and so on?

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
Dar13
17
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 24th May 2009 20:22
It's going through the script so fast because it's registering the keypress, and since it's all the same keypress, it's fulfilling the conditions for each state of the script. That's why it "skips" from State0 to State8.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 24th May 2009 20:28
So the solution is in between each state that requires a key press put

:state=STATE NUMBER,scancodekeypressed=0:state=STATE NUMBER

Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 25th May 2009 01:28
hockeykid, you're a genius. that works perfectly. makes the script a little long, but that's all good.

thanks much!

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 25th May 2009 01:48
Quote: "hockeykid, you're a genius. that works perfectly. makes the script a little long, but that's all good.

thanks much!"


Its no problem, glad it worked

Login to post a reply

Server time is: 2025-05-24 19:34:40
Your offset time is: 2025-05-24 19:34:40