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 a trade from Player to Harry, And from Harry To Player...

Author
Message
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 16th Jan 2018 18:07 Edited at: 17th Jan 2018 09:51
First The hudicon works fine the first time I meet harry, Im getting a blanket for Him, but then the hudicon is invisible when I am about to talk to Him again. (Want it to work same as I meet Harry for the first time.)
Also another problem here is that Harry will give Me a wrench, so I can open cell "9". I dont know exactly how I can do that.. ...Any ideas, help please...
I send a zip with the scripts and the sounds:

Attachments

Login to view attachments
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 18th Jan 2018 21:59 Edited at: 19th Jan 2018 10:22
Mr Love
Quote: " but then the hudicon is invisible when I am about to talk to Him again"

It looks like the line at state=10 & 2 go in circles...here try this and see if it works better ?
+ Code Snippet
"activateifused=15" is that correct ??? (15) This should show the hud each time player approaches the "blanket"
but if you take the "blanket" the script ends, is that what you wanted ?

Second, what is the "harry_talk.fpi script for ? Was it an extra script in the folder and not needed?

[/quote]give Me a wrench, so I can open cell "9" ...how I can do that[quote=]
Very easy, do you have the "wrench" entity already made? Also, does the "Cell Door #9" have any extra scripts running
for it. If not good, use one of the "key" scripts for the wrench to open the Cell Door.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 19th Jan 2018 21:34
I think I need a "little" more help. What I want is...

1. Talkicon shows up within=80 from Character
2. Pressaction and Talk Harry1 sound play
3. Talkicon shows up within=80 from Character (only if player got the blanket)
4. (plr has blanket) Pressaction and Talk Harry2 sound play
5. (plr get wrench from Harry) show toolpicture for about 5 seconds.
6. Outside cell "9" show "tool" icon and set it within=80 from the cell-door
7. Hold down actionbutton for about 15 seconds and play "wrench-sound" and the cell-door opens after 15 seconds.
8. I dont want the tool-icon to show up before I get the wrench.. (Possible?)
9. Now the cell-door can open and close as usual...

It looks like mutch work(!) But I dont think it takes so many scripts...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 19th Jan 2018 22:04
Your script didnt work out. The problem is in the "Harry Talk" script. I just cant find the problem...
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 19th Jan 2018 22:23
Mr Love I think the problem is at "state=10" in both of these scripts.
+ Code Snippet
state=10 goes to state=2, then goes right back to state=10 without player doing anything ?
Seems like a loop/cycle is going on No problem to fix.
I have tonight free and will take your info above and work on it
My games never have bugs. They just develop random features..
Lots and lots of random features...
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 19th Jan 2018 22:33
Mr Love I already noticed first problem, your sound file harry1.ogg is 25 seconds long and the timer is set for only 7 sec's ?
Also please if you can send/upload the "talk" hud image so I can make sure everything works correctly.
Is the "blanket" something player picks up , And when/where does the "wrench" come into play ? How does player get "wrench" ?
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 19th Jan 2018 22:38
No the problem must be in the end-part of the script. When I got the blanket the talk-icon doesnt show up, the problem shourld be after activated=15 (I think):

:state=20:etimerstart,sound=audiobank\dialog\prison\harry1.ogg,plrfreeze=7000,state=21
:state=21,etimergreater=7000:state=22

:state=22,activated=15:state=3
:state=3,plrdistwithin=80,plrusingaction=1:hudshow=talk,hudfadeout=talk,state=30
:state=30,plrusingaction=1:etimerstart,sound=audiobank\dialog\prison\harry2.ogg,plrfreeze=20000,state=31
:state=31,etimergreater=20000:state=51

Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 19th Jan 2018 23:07
This is not the icon I use. but they looks almost exactly the same. You courld have made Your own icon, it doesnt really matter, does it???
Anyways, its placed very low in the middle of the screen...


Attachments

Login to view attachments
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 20th Jan 2018 00:16
Its something wrong with the forum now, cant change any text so it will be many posts instead...
The Player gets the wrench from Harry after the Harry2 soundfile has played to an end, then a ping can be heard...
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 20th Jan 2018 00:31
Mr Love
Quote: "something wrong with the forum "

Yes, I know. I tried several times to update a post or make changes and it doesn't do anything
Quote: "You could have made Your own icon"

I just wanted to be on the same page as you. Wasn't sure if it was an image or text or something else ???
Quote: "Player gets the wrench....after the Harry2 soundfile has played to an end"

Ok, Yes i see the "playertake" command now.
My games never have bugs. They just develop random features..
Lots and lots of random features...
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 20th Jan 2018 14:17
Mr Love Ok, scripts work now. I used your file paths to make sure everything was ok.
I assumed your attaching the "talk" script to a character and the "blanket" script to an object..correct?
You can now talk to "harry"..... then get "blanket" .... return to harry to finish conversation.
But, what is your plan on how to give player the "wrench" ?
My games never have bugs. They just develop random features..
Lots and lots of random features...

Attachments

Login to view attachments
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 20th Jan 2018 16:25
Quote: "I assumed your attaching the "talk" script to a character and the "blanket" script to an object..correct?"

LOL! Yes...
Quote: "But, what is your plan on how to give player the "wrench" ?"

I think that courld be in the Harry script as well, that shourld work,or else???
The basic script works fine now, Thanks!
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 20th Jan 2018 16:57
Mr Love
Quote: "be in the Harry script as well"

Yes, that will work very easily. First, is the "cell door" a regular (animated) door?
One that can be "activated" by/with a key? All segment door have this property setting,
does yours ? If not we'll have to activate the cell door to open.
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 20th Jan 2018 17:04
Quote: " First, is the "cell door" a regular (animated) door?"

Yes.
Quote: "One that can be "activated" by/with a key? "

You can make it work with a key ofcourse, but right now its just open and close...
Quote: " All segment door have this property setting,does yours ?"

Segment door, whats that!? Its a dynamic animated entity...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 20th Jan 2018 17:25 Edited at: 20th Jan 2018 18:10
The wrench Hud works well, shows for 5 seconds...
+ Code Snippet

You can take this text if You want. Explains how I want it....

Attachments

Login to view attachments
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 20th Jan 2018 19:21
Mr Love Ok, I got it.... but what "tool" icon ? How about I just use "hudtext" for the cell door?

My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 20th Jan 2018 20:54 Edited at: 20th Jan 2018 21:01
Quote: "but what "tool" icon ?"

Just an icon with tools on that shows when You got the wrench, when You are 80 units close to the door, 128x128, hudx=50 hudy=90
Quote: "How about I just use "hudtext" for the cell door?"

No, I really dont want that, I use a picture of the wrench tool, with a text pasted over "WORKING" (and sound from a wrench tool working) Isnt this the same as lock-picking?
You must hold in the button 10 seconds (While You are working with the wrench) then the door can be opened with the regular door icon. This script is attached to the door...
Courld You help with the door-script???
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 21st Jan 2018 00:01
Mr Love
Quote: "Just an icon with tools on that shows when You got the wrench"

I was just about to upload the scripts, I'll see if I can find a "tool" pic. to plug into the script.

Quote: "I use a picture of the wrench tool, with a text pasted over "WORKING" "

Ok, but the player NEEDS to know that he MUST keep holding the "Enter" key somehow ?
Or else this script resets itself. That's why I added some text so they know to hold key.
Also, I have script set to 15 sec's, you want 10 sec's now?
Quote: " sound from wrench... Isnt this the same as lock-picking?"

Yes, I took a "lock picking" sound file and made it exactly as long as the timer.
Quote: "Courld You help with the door-script???"

Yes, the script is attached to the door, that's the best/easiest way to do this.
The "wrench" is just a key for the door
My games never have bugs. They just develop random features..
Lots and lots of random features...
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 21st Jan 2018 00:43
Ok, attached are the scripts needed for this. I have included a simple map using just stock entities so you can see the setup. It's only four small scripts.
I decided to skip adding a picture of the wrench tool so you can add what you like/need to the door script. Just replace my "text hud" with your image.

The setup is very easy
First, for the Cell-Door "Use Key" field ( Not the If-Used field ) add the name "wrench" ( name of key to unlock door) Give the cell door the "celldoor.fpi" script.
Second...name of character is "harry" in harrys "If Used" field add the name "wrench" also ( he will activate the key ) Give "harry" the "harry_talk.fpi" scipt.
Third... place your "Blanket" make sure it's dynamic. Give it the "pickup_blanket.fpi" script. In it's If Used filed add the name "harry"
Last... take any key or little object ( I used one of the keys from the ww2 pack) Name it "wrench", place it anywhere in your level, does not need to be seen ( I placed mine right behind harry )
Give the wrench (key) the "wrench.fpi" script. That's it ! Test run and it will work perfectly.
My games never have bugs. They just develop random features..
Lots and lots of random features...

Attachments

Login to view attachments
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 21st Jan 2018 19:07 Edited at: 22nd Jan 2018 00:54
Everything works fine now, except that the tool icon still are shown even if You are very far from the door, courld someone help Me with this?
Here is ncmakos modded script:

;Triggers

:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\tools.dds,hudname=tools,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=50,hudimagefine=gamecore\huds\working.dds,hudname=working,hudhide=1,hudmake=display,state=10

:state=10,plrdistwithin=60,plrhaskey=0:hudhide=1
:state=10,plrdistwithin=60,plrhaskey=1:state=1,hudshow=tools

:state=1,plrdistwithin=60,plrusingaction=1:hudunshow=tools,hudshow=working,state=2,etimerstart,sound=audiobank\dialog\prison\picklock.ogg
:state=2,plrusingaction=0:hudunshow=working,hudshow=tools,stopsound,state=10
:state=2,etimergreater=10000:hudunshow=working,hudunshow=tools,state=3

:state=3:setframe=0,state=4
:state=4:incframe=0
:state=4,frameatend=0:state=5,coloff

;End of Script



Attachments

Login to view attachments
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 22nd Jan 2018 01:40 Edited at: 22nd Jan 2018 01:52
Mr Love Let me check my script. I see one problem already, at state=10 your using "hudhide" like an action command?
It's only supposed to be used during the definition of a hud, Not sure if it works that way ? If player does not have "key"
and you don't want a hud .... just omit that line .
At the line state=2 if player stops using the action key "plrusingaction=0:hudunshow=working,hudshow=tools"
it shows the "tools" hud again...even if you walk/go far away

Let me work this out. This is why I needed the "exact" images for the hud and what you intended them to do
before hand so no changes are needed later on.

Ok, I just guessing here since I don't have the hud images. try & test this for the cell door.
+ Code Snippet
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 22nd Jan 2018 02:14 Edited at: 22nd Jan 2018 02:34
Quote: " I see one problem already, at state=10 your using "hudhide" like an action command?"

Yes, but "hudhide" is an action command and that part works fine...

Quote: "Ok, I just guessing here since I don't have the hud images. try & test this for the cell door."

Just make an black 128x128 picture with white text and write "tools" and another one 512x256 with the text "wrench"....
One rule I need to tell You is that the icons ALWAYS disappear when press actionbutton(!!!)

Ok, Your script did behave exactly like My mod script, and has the same problem. When You have past the door and run far away the tool icon still shows! And dont be fooled by the screenshot. The icon and the wrench never appear at the same time...
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 22nd Jan 2018 11:21
Me Love Here, this should do it...
+ Code Snippet
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 22nd Jan 2018 21:23
Worked like a charm ncmako! If You continue like this You must be My lead programmer...
But I still have a problem with the wrench script, I cant make the wrench disappear?? Can You see whats wrong?

:state=0:hudreset,hudx=50,hudy=50,hudimagefine=gamecore\huds\wrench.dds,hudname=tool,hudhide=1,hudmake=display,state=10
:state=10,activated=1:etimerstart,state=1,playertake,hudshow=tool,coloff,plrsound=audiobank\misc\ping.wav,state=11
:state=11,etimergreater=3000:hudhide=tool
:state=1:none

Very well done, Thank You!
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 22nd Jan 2018 22:19 Edited at: 22nd Jan 2018 22:19
Mr Love
Quote: " I still have a problem with the wrench script"

That's not the script I uploaded Did you change it Yes, that's why I like the "text hud" scripts, they seem to work flawlessly.
Ok, you added an image hud I see. If you look at the line at "state=10" the script goes to both state=1 and state=11 ??? Easy fix...
And don't use "hudhide" it'll cause problems
+ Code Snippet
Or you can "fade out" the hud after 3 secs, might be easier on the eyes?
+ Code Snippet
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 23rd Jan 2018 16:36 Edited at: 23rd Jan 2018 17:36
Well it shourld work I know.. But it doesnt, the wrench stays on the screen. I think it perhaps interfer with the other scripts perhaps? The hud-text quality is so very bad in FPSC so I wourld hate to use it....


But one thing works, if I remove etimergreater=3000 and use hudfade, I can see the wrench just as long as the text, and it fade away.. If We cant make it perfect, this is the best option...

ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 23rd Jan 2018 21:26
Mr Love Your going to have to make the "wrench" (key) set to "always active" now. That's also why I used "text huds" & hudfadeout before.
When you pickup the "wrench" now the script triggers the hud to show, the "wrench" entity is gone from map, but the script has a timer...
so the hud image remains on screen. Set the "wrench" entity to "always active" and the hud will disappear after 3 secs. BUT, that means your
"wrench" entity & script will always be "active" You could add "destroy" to the script...to kill if off?
Let me see if there's a better way around this?
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 23rd Jan 2018 22:29
Ok I hear You... To make the "wrench" always active is no catastrophe. I was going to use a "null" object with 6 polygons and no animations ofcourse, totally invisible..
But if You can find a better way, then I am the happyest Man...
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 24th Jan 2018 00:16
Mr Love Yes, just set the 'wrench" (key) to "always active" so the script continues to run after being picked up.
You can add the "destroy" command at the very end of the script if you wish. That should stop it from running ?
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 24th Jan 2018 20:55 Edited at: 24th Jan 2018 23:33
Yeah, I must try it out that it works first, then I install everything in level3... BTW I have some problems with Your Objectives system, there is no way to control what Objective that show up, in other levels than level1-
Dont know if Im doing something wrong here. Courld You take a look at it? Ok, Implemented all files and scripts into level3. It worked as a charm first time(!!)
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 24th Jan 2018 23:57
Mr Love Glad it work out for you. So are all scripts working for you, or is there still a problem with
one of them ? By your last line the "Objective system" is now working ???
My games never have bugs. They just develop random features..
Lots and lots of random features...
Mr Love
12
Years of Service
User Offline
Joined: 9th Jun 2005
Playing: MAFIA 2
Posted: 25th Jan 2018 00:07
No all scripts worked fine, just needed to tweak a few things but everything went out perfect!
Im not sure about the objectives system.. Shourld You use one mainscript for every level???

Well done and thanks!
Love Eriksson
ncmako
6
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 25th Jan 2018 10:17
Mr Love
Quote: "Shourld You use one mainscript for every level"

Your referring to this old post ? ....https://forum.thegamecreators.com/thread/219668
Yes, I think placing one "main" script on each level is best for this. All objectives are completed before
going to the next level, correct ??? ( nothing needs to be carried over to the next level ? )
This way you should have fewer problems also
My games never have bugs. They just develop random features..
Lots and lots of random features...

Login to post a reply

Server time is: 2018-02-21 11:03:43
Your offset time is: 2018-02-21 11:03:43