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 / Debugging of NPC-script

Author
Message
Copper Head
18
Years of Service
User Offline
Joined: 10th Dec 2005
Location:
Posted: 21st Dec 2005 02:44
Among all you script scribbling people can anyone look at this codesnippet and tell me why it works all funny? The script is suppose to make an NPC talk to the player. When first in range it'll display message_1 and when out of range or timeout it'll fade the message. When once more in range it should display message_2 and so on..

This works fine all the way thru but once the last message has been displayed and it starts over again on a certain message (in the codesnippet it makes message_2 play over and over) it doesn't display the message until you go out of range (in other words - when it's suppose to fade away) as oppose to you get into range.

Can anyone figure this out?
Benjamin A
19
Years of Service
User Offline
Joined: 31st Oct 2005
Location: The Netherlands
Posted: 21st Dec 2005 07:58
Your script is missing completely, so I can't check it, but here's a completely working npc talk script: http://forum.thegamecreators.com/?m=forum_view&t=65207&b=23

MegaMusic Pack 01.... 31 original soundtracks for your games!
http://www.aeilkema.dds.nl/mega/index.html
Copper Head
18
Years of Service
User Offline
Joined: 10th Dec 2005
Location:
Posted: 21st Dec 2005 08:47
I have no idea where the codesnippet went. I'll try again in plain text then.

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

;Artificial Intelligence Script

;Header

desc = NPC Talk Script

;Triggers

:state=0:hudreset,hudx=50,hudy=80,hudimagefine=conversation\message_1.tga,hudname=Greet,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=80,hudimagefine=conversation\message_2.tga,hudname=LoopMsg,hudhide=1,hudmake=display

:state=1:state=10

:state=5,plrdistfurther=65:state=20

:state=10,plrdistwithin=60:waypointstop,rotatetoplr,hudshow=Greet,timerstart,state=11
:state=11,timergreater=3000:hudfadeout=Greet,state=5
:state=11,plrdistfurther=65:hudfadeout=Greet,state=5
:state=20,plrdistwithin=60:waypointstop,rotatetoplr,hudshow=LoopMsg,timerstart,state=21
:state=21,timergreater=3000:hudfadeout=LoopMsg,state=5
:state=21,plrdistfurther=65:hudfadeout=LoopMsg,state=5


;End of Script
Les Horribres
19
Years of Service
User Offline
Joined: 20th Nov 2005
Location: My Name is... Merry
Posted: 27th Dec 2005 23:17 Edited at: 27th Dec 2005 23:17
:state=10,plrdistwithin=60:waypointstop,rotatetoplr,hudshow=Greet,timerstart,state=11
:state=11,timergreater=3000:hudfadeout=Greet,state=20

:state=20,plrdistwithin=60:waypointstop,rotatetoplr,hudshow=LoopMsg,timerstart,state=21
:state=21,timergreater=3000:hudfadeout=LoopMsg,state=5

And i am NOT a Script Scribbling Person.

Merranvo, The Cool One

Anti-Noob Justice League, an ANJL of Mercy.
Copper Head
18
Years of Service
User Offline
Joined: 10th Dec 2005
Location:
Posted: 28th Dec 2005 00:53
That does nothing more really but remove the function of having the hud go away when you back away from the NPC. I found that hudreset does a better job though. Also, i see now that the ":state=5:.." line is redundant. It should just go to state=20 right away.

Login to post a reply

Server time is: 2024-11-21 18:09:09
Your offset time is: 2024-11-21 18:09:09