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 / Help with Benjamin A's npc talking script different amounts of messages

Author
Message
VividHero
9
Years of Service
User Offline
Joined: 25th Jul 2014
Location:
Posted: 25th Jul 2014 06:20
Hi everyone, I'm having a problem with Benjamin A's npc talking script. I have 3 npc's. 2 of them have 4 messages they display and I got that working fine. However, I want one of them to display 5 different messages and that is where my problem starts. When I finish talking to the first 2 npc's with the 4 messages each and go to talk to the third npc, it displays his 5th message instead of restarting and showing his first message.

This is my code for one of the npc's with 4 messages:




And this is the one for the npc with 5 messages




How do I fix this so that after one of the 4-message npc's shows his last message, the npc with 5 messages will show it's first when I walk up to him?
BlackFox
FPSC Master
15
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 26th Jul 2014 02:55
First off, change your "timerstart" and "timergreater" to "etimerstart" and "etimergreater". There is an issue using the "timerstart/timergreater"- if multiple calls of these commands are running in a script, they conflict and only one will prevail. Using the substitution will allow you to have multiple "etimers" and therefore no issues.

Second, ensure the NPC's are not too close to one another. You have the "plrdistwithin=60" and if the player is within "60 units" of both, that will be where one of your issues are. By looks of your two scripts, if you talk to the first two and get their messages, then the third NPC is showing his fifth, it probably is because it registered the "keystrokes" required.

Another thing you can also do is an an "etimer" at the end to allow the NPC to have a "reset" state. For example, using your first script...



... instead of going to "state=2" at the end, I changed to "state=60 and added a 2 second delay before returning to the start.

There's no problem that can't be solved without applying a little scripting.

Login to post a reply

Server time is: 2024-03-28 22:00:03
Your offset time is: 2024-03-28 22:00:03