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 / I might need a little help with Lucys script...

Author
Message
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 12th Jan 2017 08:12
Everything works fine with this script, except that I dont want Lucy to follow Me after the timer is "0" its after Lucy3.ogg has played I want Her to stand still. For some reason Lucy4.ogg works fine and she dosnt follow player...
Here is the script:

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


:state=0:state=1
:state=1,plrdistwithin=100:waypointstop,animate=4,rotatetoplr,sound=audiobank\dialog\Lucy1.ogg,etimerstart,state=2
:state=2,plrdistfurther=100:waypointstate=0,state=1,animate=2,waypointstart

:activated=2:waypointstop,resetmarkers,rotatetoplr,followplr,animate=2,setanimatespeed=100,state=4
:state=4,plrdistwithin=75:animate=1,setanimatespeed=0,state=5,freeze
:state=4:sound=audiobank\dialog\Lucy2.ogg
:state=4,vargreater=hpcounter 75:stopsound,hudreset,state=7
:state=4,varless=timecounter 1:state=8
:state=5,animate=1,plrdistfurther=100:resetmarkers,rotatetoplr,followplr,animate=2,setanimatespeed=100,state=6

:state=6:waypointstop,resetmarkers,rotatetoplr,followplr,animate=2,setanimatespeed=100
:state=7,plrdistwithin=75:animate=1,setanimatespeed=0,freeze
:state=7:sound=audiobank\dialog\Lucy3.ogg

:state=8,varless=hpcounter 75:stopsound,hudreset
:state=8:waypointstop,resetmarkers,rotatetoplr,animate=2,setanimatespeed=0,state=9
:state=9,plrdistwithin=75:animate=1,setanimatespeed=0,freeze
:state=9:sound=audiobank\dialog\Lucy4.ogg
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 12th Jan 2017 12:11
Mr Love
Quote: "after Lucy3.ogg has played I want Her to stand still"

I noticed only "state=4" takes it to state=7 ? Did you also want "state=6" to go to
state=7 ???
I still have these sounds files, I'll run some tests and see what happens.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 13th Jan 2017 06:10
Quote: "I noticed only "state=4" takes it to state=7 ? Did you also want "state=6" to go to
state=7 ??? "


Yea, I think I tried to use state=6 instead of 7 and the script didnt work out, as I remember it..

Quote: "I still have these sounds files, I'll run some tests and see what happens. "


Nope, You dont have the two latest soundfiles. I made them Yesterday. (But if You need them I can post them)


ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 13th Jan 2017 10:44
Mr Love
Quote: "You dont have the two latest soundfiles"

No problem. I just made some up.
I just looked over the script, noticed I have to also setup the "hero Point"
scripts. No problem, I'll let you know how it goes.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 14th Jan 2017 07:58
I did add some fpgcrawtext into the script. It now looks like this:

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


:state=0:state=1
:state=1,plrdistwithin=100:waypointstop,animate=4,rotatetoplr,sound=audiobank\dialog\Lucy1.ogg,etimerstart,state=2
:state=2:fpgcrawtextsize=32,fpgcrawtextfont=Arial,fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=50,fpgcrawtexty=80
:state=2:fpgcrawtext=Hi Walter! Weisman is expecting You...
:state=2,etimergreater=3000:fpgcrawtextoff,state=3
:state=3,plrdistfurther=100:waypointstate=0,state=1,animate=2,waypointstart

:activated=2:waypointstop,resetmarkers,rotatetoplr,followplr,animate=2,setanimatespeed=100,state=4
:state=4,plrdistwithin=75:animate=1,setanimatespeed=0,state=5,freeze
:state=4:sound=audiobank\dialog\Lucy2.ogg
:state=4:fpgcrawtextsize=32,fpgcrawtextfont=Arial,fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=50,fpgcrawtexty=80
:state=4:fpgcrawtext=Cardiac arrest! We need adrenaline fast...
:state=4,vargreater=hpcounter 75:stopsound,hudreset,state=7
:state=4,varless=timecounter 1:state=8
:state=5,animate=1,plrdistfurther=100:resetmarkers,rotatetoplr,followplr,animate=2,setanimatespeed=100,state=6

:state=6:waypointstop,resetmarkers,rotatetoplr,followplr,animate=2,setanimatespeed=100
:state=7,plrdistwithin=75:animate=1,setanimatespeed=0,freeze
:state=7:sound=audiobank\dialog\Lucy3.ogg

:state=8,varless=hpcounter 75:stopsound,hudreset
:state=8:waypointstop,resetmarkers,rotatetoplr,animate=2,setanimatespeed=0,state=9
:state=9,plrdistwithin=75:animate=1,setanimatespeed=0,freeze
:state=9:sound=audiobank\dialog\Lucy4.ogg


Perhaps it wourld be easyer in the future, if I change it to hudtext instead? What do You think?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 14th Jan 2017 12:46
Mr Love
I ran this script a couple times, I see where there may be problems.
If the script gets to "state=5" then "state=6" it hits a dead end.
The same goes for "state=7" & "state=9" Unless that's what you want?
It's hard for me to tell what your trying to achieve from here.
Quote: " I dont want Lucy to follow Me after the timer is "0" its after Lucy3.ogg has played I want Her to stand still"

What's happening is you could/do have BOTH conditions true at "state=4" ( More than 75 points and timer is at "0" )
Try something like this

But you have a lot going on here.
Quote: "would be easier in the future, if I change it to hudtext instead?"

Not really, you would have the same problems with the script running thru the
conditions & actions correctly.








My games never have bugs. They just develop random features..
Lots and lots of random features...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 15th Jan 2017 22:04
Mr Love
See if this is close to what your after. She stops when you have +75points or timer runs out...
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 16th Jan 2017 05:18
Your script works fine as long a You get the 25 points.. But when You are to late with the syringe, Lucy4.ogg shourld be played but instead Lucy1.ogg is played.. But I have fixed all bugs and cleaned the script, for example the "Cardiac arrest" text now only shows when close to Lucy. I solved that by moving the text from state=4 to state=5. I courld see that You removed the text as well, but I do want the text in the game... I do have one problem though, I want to use "subvar=hpcounter 15" when You are to late with the syringe, but no matter where I put it I get problem.. I have tried to put it in the Timer-script and I have tried to put it in Lucyfollow-script, How can I remove 15 points without a bug showing up?

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


:state=0:state=1
:state=1,plrdistwithin=100:waypointstop,animate=4,rotatetoplr,sound=audiobank\dialog\Lucy1.ogg,etimerstart,state=2
:state=2:fpgcrawtextsize=32,fpgcrawtextfont=Arial,fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=50,fpgcrawtexty=80
:state=2:fpgcrawtext=Hi Walter! Weisman is expecting You...
:state=2,etimergreater=3000:fpgcrawtextoff,state=3
:state=3,plrdistfurther=100:waypointstate=0,state=1,animate=2,waypointstart

:activated=2:waypointstop,resetmarkers,rotatetoplr,followplr,animate=2,setanimatespeed=100,state=4
:state=4,plrdistwithin=75:animate=1,setanimatespeed=0,state=5,freeze
:state=4:sound=audiobank\dialog\Lucy2.ogg
:state=4,vargreater=hpcounter 75:stopsound,hudreset,state=6
:state=4,varless=timecounter 1:state=8
:state=5:fpgcrawtextsize=32,fpgcrawtextfont=Arial,fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=50,fpgcrawtexty=80
:state=5,plrdistwithin=75:fpgcrawtext=Cardiac arrest! We need adrenaline fast...
:state=5,varless=timecounter 10:fpgcrawtextoff
:state=5,animate=1,plrdistfurther=100:fpgcrawtextoff

:state=6:waypointstop,resetmarkers,rotatetoplr,animate=2,setanimatespeed=0,state=7
:state=7,plrdistwithin=75:animate=1,setanimatespeed=0,freeze
:state=7:sound=audiobank\dialog\Lucy3.ogg

:state=8,varless=hpcounter 75:stopsound,hudreset
:state=8:waypointstop,resetmarkers,rotatetoplr,animate=2,setanimatespeed=0,state=9
:state=9,plrdistwithin=75:animate=1,setanimatespeed=0,freeze
:state=9:sound=audiobank\dialog\Lucy4.ogg


ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 17th Jan 2017 10:57
Mr Love Happy you got it to work.
Quote: " I want to use "subvar=hpcounter 15" when You are to late with the syringe"

I still feel that this area of the code might cause problems

Both of these conditions could be true at the same time. If true it doesn't know
which state to go to?
Try this in a test and see if it works...
Remove the line ":state=4,varless=timecounter 1:state=8" from your code.
Place this near top of script. ":varless=timecounter 1:subvar=hpcounter 15,state=8"
This way if at anytime the "timer" is at zero (no matter which state the script is at )
it should remove 15 points and jump to state=8.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 17th Jan 2017 14:00 Edited at: 17th Jan 2017 14:03
I really think it is a hacker-prank that cause this problem. It shourld work!!!


BTW Here is the hitbox script if You want to try......


;Triggers
:state=0,vargreater=timecounter 0:state=2
:state=1,varless=timecounter 1:nobulletcol
:state=2:state=3,addvar=hpcounter 25,suspend,coloff,state=3
:state=3:hudunshow=timeleft,hudunshow=timecounter,activateifused=5
:state=3:etimerstart,hudreset,state=4
:state=4:fpgcrawtextsize=32,fpgcrawtextfont=Arial,fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=50,fpgcrawtexty=40
:state=4:sound=audiobank\misc\ping.wav
:state=4:hudtext=You Collected 25 Hero Points
:state=4,etimergreater=3500:fpgcrawtextoff


Attachments

Login to view attachments
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 18th Jan 2017 10:42 Edited at: 18th Jan 2017 22:19
Mr Love I see, the "hitbox" script is not what I thought.
What is it for and what is it suppose to do? Is it attached to a trigger
or entity? I'm lost here.

Edit: just noticed this in your script ":state=2:state=3,addvar=hpcounter 25,suspend,coloff,state=3"
You have "state=3" twice on that line. Can't do that. Might be part of the problem.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 19th Jan 2017 11:24 Edited at: 19th Jan 2017 11:25
Well the script works, but only the states 0,1,2 are important (None of the hud scripts really works). If You courld reprogram this script so We courld add subvar=hpcounter 15 that works (When You are to late with the syringe)...
That wourld be great!
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 19th Jan 2017 11:59
Mr Love
Quote: "subvar=hpcounter 15...........(When You are to late with the syringe"

I understand, but is this script attached to a trigger or an entity after you picked up?
Because this code line "state=4:hudtext=You Collected 25 Hero Points"
Did you pickup this entity or just attach script to an entity that sits there?

Also this part of script, the timer at first is always greater than 0.

Do you want this script to run UNTIL timer runs out, THEN subvar 15 points?
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 20th Jan 2017 11:56 Edited at: 20th Jan 2017 12:33
Quote: " but is this script attached to a trigger or an entity after you picked up?"

It is the destroy-hitbox-script. An entity that cover the mans upper body, so the syringe will work...

Quote: "Do you want this script to run UNTIL timer runs out, THEN subvar 15 points?"

Yes, as long the Player are to late with the syringe.

I have tried this, didnt work:

:state=0,vargreater=timecounter 0:state=2
:state=1,varless=timecounter 1:subvar=hpcounter 15,nobulletcol
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 21st Jan 2017 12:25 Edited at: 21st Jan 2017 13:05
Mr Love
Quote: "It is the destroy-hitbox-script"

Ah, I see. That makes a big difference. I thought it was the "Main" script. Try this and see if it works?


But how are you activating the destroy script for this entity?
Also, what do you want the script to do if "timer" less than zero?
Right now it sub's 15 hero points, that's all.

Edit: found some bugs in script, updated it.
My games never have bugs. They just develop random features..
Lots and lots of random features...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 21st Jan 2017 14:04 Edited at: 21st Jan 2017 14:05
Mr Love
To expand on this script I added "You Lose 15 Hero Points"
If timer has ran out...
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 21st Jan 2017 15:09
Close but no cigar!

Now, I do get -15 points when Im to late, but only if I stick him with the needle when He is dead.. Perhaps You courld use health=0 or something like that. I think You are better than Me coming up with a solution...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 21st Jan 2017 16:33
Mr Love
Quote: "but only if I stick him with the needle when He is dead"

That's why I questioned this script since it is the DESTROY script. I thought is was the AI MAIN script.
First,
Will this object/entity be destroyed after syringe sticks him or can it be destroyed?
Second,
What is the "activateifused=5" for in the code at state=3?

What I could do is use "plrdistwith" and then "mouseclick or mousestate"
to run the "destroy" script....maybe?
What I need is the script you are using for this entity that is on the dead body
that get the syringe. Lets start with that.

My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 21st Jan 2017 20:07
Ok, Ill see if I courld help You. The activateifused=5 is for the ECG alttexture. (And for something else that I dont remember right now)

Quote: "What I need is the script you are using for this entity that is on the dead body
that get the syringe. Lets start with that."


That IS the hitbox-script, the script You just scripted... Perhaps it wourld be better to use both a main-script and a destroy-script???

ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 21st Jan 2017 23:19
Mr Love
What I mean is I need the "Main AI" script your using for the entity if this is the "destroy" script.
If the "hitbox" script is set in the "destroy" field then it only runs when the entity is destroyed!

Quote: "Perhaps it wourld be better to use both a main-script and a destroy-script???"

Yes, if your not using a "Main AI" script then your entity will not react as intended.
Most likely it's defaulting to the "default.fpi" script.

My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 22nd Jan 2017 11:37 Edited at: 22nd Jan 2017 12:39
Just checked it up, and it is true I am not using a main-script on the "hitbox". I mean, I had no reason to belive that the destroy-script shourldnt work... (It almost did) But if You courld make a working main-script and a destroy-script that works perfectly, I wourld be very greatful! We do script differently, I script .fpi like basic, because I learned basic on My commodore 64 and later AMIGA, and even later darkbasic... .fpi does have some simularity to basic but also some stuff is diffrent... You script .fpi like .fpi! I wish I courld script like You...

ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 22nd Jan 2017 15:36
Mr Love
Quote: "I am not using a main-script on the "hitbox""

Ah, ok, there's the problem the whole time. Ok, just made a script, tested and works great
when timer is or is not at zero.
Place this whole script in the entity "hitbox" as it's "AI Main"

I tested over & over and works fine. On the "hitbox" make sure you have "appear1.fpi" for the appear script
and use something like "disappear1.fpi" for the destroy script.
Note: I left the code "activateifused=5" in there as it may be needed for something else?
Remove if not needed.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 22nd Jan 2017 17:35
Quote: "Ah, ok, there's the problem the whole time. "

I dont think so. I get the same old problem again(!) I have to use the needle on The Hitbox when the time is up, or else I wont get the -15 HeroPoints... Im starting to give up......
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 22nd Jan 2017 19:50 Edited at: 22nd Jan 2017 20:00
Mr Love
Quote: " I have to use the needle on The Hitbox when the time is up, or else I wont get the -15 HeroPoints"

I'm sorry, I thought that's how you wanted it? That's my fault. Don't give up.
Here's a new script for both the timer & "hitbox" main script.
Which "count down" timer are you using? I have the one where it plays a sound/music when time runs out.

Noticed on line "state=7" I subvar=ph counter 15 now in timer script. Works better.

Here is a new "hitbox" script. I striped it down to just basics. Put name of "count down timer" in
the "Hitbox" Ifused field.

Now with these new script, no matter where you are if time runs out it subtracts 15 hero points.
If you get to "hitbox" with time left and use syringe player gets 15 points.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 23rd Jan 2017 16:03 Edited at: 23rd Jan 2017 17:42
Great job, it seems to work quite well(!) I tried to let the 30 seconds run out and it does take away 15 HeroPoints. I have not tried to save His life yet, but that shourld work fine...
At first it didnt work at all, so I throw away the timer-script. But thank God for giving it a second chance! The activated=1 function didnt seem to work, so it caused alot of trouble and the numeric didnt show up at all (also the hudtext was missing)
So I did make these changes. Why dosnt it work with the text "You have lost 15 HeroPoints"???

The elevator to level2 is so close now, I can smell it.. Here is code changes:

Attachments

Login to view attachments
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 24th Jan 2017 00:05
Mr Love
Quote: " The activated=1 function didnt seem to work"

Did you add the name of the "Timer" to the "Hitbox" ifused field?
Quote: "and the numeric didnt show up at all (also the hudtext was missing)"

If set up correctly it all works great.

Left of center the "Time Left" text shows and numeric displays.

By deleting the condition "activated=1" when the "Hitbox" script gets to
"state=5" it tries to activate the "Timer" script to "hudunshow=timeleft,hudunshow=timecounter,destroy"
This line of code without a "colon" or state is making it act crash.
Need to put it back as ":activated=1:hudunshow=timeleft,hudunshow=timecounter,destroy"
Then in Hitbox ifused field put exact name of the Timer
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
19
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 24th Jan 2017 15:07 Edited at: 24th Jan 2017 15:08
Quote: "Did you add the name of the "Timer" to the "Hitbox" ifused field?"

No, I courldnt do that. Its place is already taken by Lucy and the ECG Machine (Also named Lucy)

But Im happy now! No problems what so ever. No reason to change anything when everything works perfectly fine...
Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 7th Mar 2017 05:40
:::::Bump:::::

Login to post a reply

Server time is: 2024-11-21 13:00:20
Your offset time is: 2024-11-21 13:00:20