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 / Conversation using fpgcrawtext

Author
Message
VBTCH4020
14
Years of Service
User Offline
Joined: 24th Jun 2010
Location:
Posted: 24th Jun 2010 23:54
I can get a single line to show up using fpgcrawtext when I approach a npc but I would like something differnet to show up when I appoarch a second time.

Any help would be greatly appreciated.
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 25th Jun 2010 01:13 Edited at: 25th Jun 2010 01:50
Use RPG Mod.

Addendum:

It can be done with fpgcrawtext without RPG Mod but RPG Mod was created for role playing.

If CE or Storyteller doesn't respond first, I'll be back with a possible solution. Hint: using a variable plus more scripting.

The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 25th Jun 2010 02:07 Edited at: 26th Jun 2010 11:29
This should work even without the pickobject condition:



If you write your own text, don't forget that you cannot use the following:
,
;
:

@Flatlander: I feel honoured that you expected me to answer this

In case you find my grammar and spelling weird ---> native German speaker ^^
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 25th Jun 2010 08:07
Why not have state 10 loop back to state 5 instead of making a state 11?

Just trying to help...


The one and only,


The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 25th Jun 2010 11:04
Quote: "Why not have state 10 loop back to state 5 instead of making a state 11"

I admit, that most of my scripts have 1 or even several *unnecessary* steps. Personally like it, when it's easy to subtract or add lines without having to change much of the existing.

In that case the *extra* line is simply there to include all sorts of things into the state=10 without touching the crucial fanial line(p.e. a player text like: "I better stay clear of that guy")

Just like the *extra* state=1, state=3 and state=5 lines in this script are also not only there to make the timer foolproof, but to leave space for text, the player will say

In case you find my grammar and spelling weird ---> native German speaker ^^
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 26th Jun 2010 02:12
Hmmm, state 1 could have been state 0, but the way I see it, states 3 and 5 were necessary, since they end up going to different parts of the script.


The one and only,


Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 26th Jun 2010 07:38 Edited at: 26th Jun 2010 07:40
He storyteller, since you have done some great work on the pickobject code, I knew you could come up with something. I hope you don't mind that I used the same text example as you did.

Now just to show that in programming, even simple scripting, there is always more that one way to code something.

Here is my code. The first thing I thought of was using a variable as mentioned in my first post. The reason for the second line for each conversation line is so that the line will remain on the screen while the player is within 50 units. When player leaves character it will disappear and increment the variable and wait until the player is within 50 units again. Of course this prevents the use of the timer; which there is nothing wrong with the timer.



ctm
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 27th Jun 2010 11:57
Flatlander wrote:
Quote: "Now just to show that in programming, even simple scripting, there is always more that one way to code something.
"


My version (based on Flatlanders):
NPC will repeat the 4th answer after the first 3 ones were given


gendestroier
14
Years of Service
User Offline
Joined: 5th Jun 2010
Location: Brazil
Posted: 30th Jun 2010 23:49 Edited at: 30th Jun 2010 23:54
how aboult this:

(sorry, i don't know how to do that code thing)

;Artificial Intelligence Script

;Header

desc = cvilian with problems

;Triggers

:waypointstate=0:animate=2,waypointstart
:waypointstate=3:animate=2,waypointnext
:waypointstate=4:animate=2,waypointrandom
:waypointstate=5:animate=2,waypointreverse
:nearactivatable=0:settarget,activatetarget=2,animate=1,state=0

:state=0:waypointstop,state=1

:state=1,plrcanbeseen:settarget,state=2
:state=1,random=20:rotateheadrandom=65
:state=1,random=60:rotatetoplr
:state=1:settarget,animate=1,rotatetotarget,resethead,state=2
:state=1,noiseheard=5:settarget,rotatetotarget,rotatetoplr

:state=2,pickobject=1,plrdistwithin=60,plrusingaction=1:timerstart,plrdisable=100000,state=3,

:state=3:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=60
:state=3:fpgcrawtext=(Destroier)humm...what i can do for you sir ?
:state=3,timergreater=500,plrusingaction=1:timerstart,state=4
:state=3,scancodekeypressed=211:plrdisable=0,state=0

:state=4:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=60
:state=4:fpgcrawtext=(sickman)hey !!! you work for tarsus, huh ?
:state=4,timergreater=500,plrusingaction=1:timerstart,state=5
:state=4,scancodekeypressed=211:plrdisable=0

:state=5:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=60
:state=5:fpgcrawtext=(Destroier)yeap how do you know ?
:state=5,timergreater=500,plrusingaction=1:timerstart,state=6
:state=5,scancodekeypressed=211:plrdisable=0

:state=6:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=60
:state=6:fpgcrawtext=(sickman)what a hell are you talking aboult.
:state=6,timergreater=500,plrusingaction=1:timerstart,state=7
:state=6,scancodekeypressed=211:plrdisable=0,state=0

:state=7:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=60
:state=7:fpgcrawtext=(Destroier)huh ? excuse me sir ?
:state=7,timergreater=500,plrusingaction=1:timerstart,state=8
:state=7,scancodekeypressed=211:plrdisable=0,state=0

:state=8:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=60
:state=8:fpgcrawtext=(sickman)how many time has gone since the last time you take a look on the mirror ?
:state=8,timergreater=500,plrusingaction=1:timerstart,state=9
:state=8,scancodekeypressed=211:plrdisable=0,state=0

:state=9:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=60
:state=9:fpgcrawtext=(sickman)you're clearly modified like some new kind of mech...it's evident...
:state=9,timergreater=500,plrusingaction=1:timerstart,state=10
:state=9,scancodekeypressed=211:plrdisable=0,state=0

:state=10:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=60
:state=10:fpgcrawtext=(Destroier)we may resume this talk aboult your intentions ?
:state=10,timergreater=500,plrusingaction=1:timerstart,state=11
:state=10,scancodekeypressed=211:plrdisable=0,state=0

:state=11:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=60
:state=11:fpgcrawtext=(sickman)ohhh...yeahhh...my intentions it's simple i want you to shut down that NSF warehouse...
:state=11,timergreater=500,plrusingaction=1:timerstart,state=12
:state=11,scancodekeypressed=211:plrdisable=0,state=0

:state=12:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=60
:state=12:fpgcrawtext=(sickman)cuz they are killing everyone who are against to their revolutionary ideas !!
:state=12,timergreater=500,plrusingaction=1:timerstart,state=13
:state=12,scancodekeypressed=211:plrdisable=0,state=0

:state=13:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=60
:state=13:fpgcrawtext=(sickman)their guarding illegal weapons inside ! if you want proff go inside an take a look.
:state=13,timergreater=500,plrusingaction=1:timerstart,state=14
:state=13,scancodekeypressed=211:plrdisable=0,state=0

:state=14:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=60
:state=14:fpgcrawtext=(sickman)and do me a favor kill them all!
:state=14,timergreater=500,plrusingaction=1:timerstart,state=15
:state=14,scancodekeypressed=211:plrdisable=0,state=0

:state=15:fpgcrawtextsize=24,fpgcrawtextfont=verdana,fpgcrawtextr=150,fpgcrawtextg=150,fpgcrawtextb=150,fpgcrawtextx=50,fpgcrawtexty=60
:state=15:fpgcrawtext=(destroier)HUMMM...i may take a look but don't you think i will kill anyone
:state=15,timergreater=500,plrusingaction=1:timerstart,state=16
:state=15,scancodekeypressed=211:plrdisable=0

:state=16,timergreater=500,plrusingaction=1:globalvar=40,setvar=1,plrdisable=0

;End of Script

of course... i'm a rokie, so it's not perfect but it's working
it's from my game 50.caliber
the global variation is used for opening a door.

mods for creating a inteligent game,at least
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 1st Jul 2010 01:20
Quote: "@gendestroier
of course... i'm a rokie, so it's not perfect but it's working"


It doesn't have to be elegant. The important thing is that it works .

gendestroier
14
Years of Service
User Offline
Joined: 5th Jun 2010
Location: Brazil
Posted: 1st Jul 2010 02:10
''It doesn't have to be elegant. The important thing is that it works''




it's working on my computer, my game will cost 5 dollars, but, you guys can use ALL of my custom material, scripts, but not the game's main idea THAT'S MINEEEE !!!

THE GAME will take 4 years to be ready... every gun , floor, wall, will have a shader. I learned a ridiculous notion of scripting for now, but until the game evolve in to final product, i probably will know how to code an ''EXTREME AI'' i have here muth more complex scripts... if one of you guys teath me how to do that code thing , i will post it(and, how do i make my own thread ? i wanna present my game ).

mods for creating a inteligent game,at least

Login to post a reply

Server time is: 2024-11-24 21:40:38
Your offset time is: 2024-11-24 21:40:38