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 / Need help with speech script i'm working on.

Author
Message
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 17th Nov 2009 18:09
As you may know I'm not a very good scripter at all and I'm trying to make a script work where a hud will pop up when you are next to a NPC, here's the script so far:



I have the hud in the correct place and placed the script in the MainAI part but nothing's happening, the NPC isn't even rotating towards the player. What's the obviously embarrassing thing I'm missing? Any help appreciated

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 17th Nov 2009 20:02 Edited at: 17th Nov 2009 20:03
Here is a script I use, shows the hud once only when I approach an NPC.



Hope that helps.

Cheers

Mike
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Nov 2009 20:17
Blackfox, Just for the sake of my learning, could you explain that script?

Well, mainly just this bit -



am i right in saying that, once the hud has been displayed , it will not show again,regardless of whether the player is using the action or not, because state=40 doesnt exist?

If so, then you neednt explain
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 17th Nov 2009 20:46 Edited at: 17th Nov 2009 20:50
I had that line in because one of the areas I had used it, there is an NPC right beside a switch. I have that line in place since I am activating the switch. However, the script works even if you remove that line and will not have to use action.

Modified Code:



I set the state=40 because there is no state=40 and had assumed by doing it this way, it terminates the script once all conditions are met. I'm still learning the scripting myself, but it seems to be working exactly how we want it.

@ Nickydude, I hope that helps you out.

Cheers

Mike
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 17th Nov 2009 21:04
Thanks for that BlackFox but mine is part of a larger script which will show multiple huds and I'd like to know why my particular script won't work.

xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 17th Nov 2009 21:08
Nickydude,

I think your problem may be in this part.

Quote: "hudname=talk1,hudhide=1,hudname=display"


Duplicate hudname

Brian.

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 17th Nov 2009 21:23
Good catch Brian. I missed that one.

Mike
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 17th Nov 2009 22:17
Oops! Now changed but still nothing, I at least assumed the NPC would rotate to the player even if no hud was showing.

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 17th Nov 2009 22:32 Edited at: 17th Nov 2009 22:52
Are you using multiple huds, where you approach the NPC and one hud shows, then you move back and as you approach the NPC a second time a second hud shows, etc?

Just trying to get a picture of how you are using this conversation script. I have multiple variations, some where messages are dispayed each time I approach an NPC, or another one where the NPC speaks first then I press Enter to get a second message, etc. Another one where multiple messages are displayed and there is a timer between each.

Cheers

Mike
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 17th Nov 2009 23:32
Quote: "hudname=display"


I believe you meant "hudmake=display". Not sure if you've already changed it to that, but it's kind of necessary to make the HUD finish its creation.

As for not rotating, I have no clue. Your script, aside from the aforementioned mistype, seems to be fine.


The one and only,


xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 17th Nov 2009 23:37
Have you tried a different character? How about a different floor segment. It sounds stupid I know, but....

Brian.

Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 17th Nov 2009 23:41 Edited at: 17th Nov 2009 23:43
AhHA! It had something to do with the StartAI script I had as I placed one of my own there, as soon as I changed it to 'appear1.fpi' everything worked!

Thanks for your help guys, very much appreciated.

The startAi script was just this:

:state=0:animate=31

So the NPC would start off crouched. how can I get the NPC to crouch and talk?

Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 18th Nov 2009 00:23
try this?


not sure if it will work.
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 18th Nov 2009 01:41
That worked Mad Nightmare, thanks.

Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 18th Nov 2009 18:30
No problem
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 18th Nov 2009 20:30
Just to recap (so I know for next time) "runfpidefault=1" means 'run the MainAI script'?

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 18th Nov 2009 20:48 Edited at: 18th Nov 2009 20:54
Quote: "Just to recap (so I know for next time) "runfpidefault=1" means 'run the MainAI script'?"


I believe that is correct. That's how I understood the scripting manual.

Cheers

Mike
Earthpig_jr
15
Years of Service
User Offline
Joined: 31st Mar 2009
Location:
Posted: 29th Nov 2009 22:36
Ok i have already made a script for this situation... That is if you are just want a subtitle for the npc's when you walk for them. You can find it here
http://forum.thegamecreators.com/?m=forum_view&t=149483&b=23
Hope this helps
P.S. This works for any mod i believe.
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 30th Nov 2009 02:43
I already have it working (http://www.youtube.com/watch?v=qpyyFI_0kgI) but thanks anyway.

Login to post a reply

Server time is: 2024-11-25 05:38:38
Your offset time is: 2024-11-25 05:38:38