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 / Show a HUD after an entity completes a waypoint.

Author
Message
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 13th Jan 2008 19:23
After an entity finishes following a waypoint, I want a HUD to be displayed, as well as a sound play. I've scripted the entity to follow the waypoint and then stop at the end of it like this:



And I can make a HUD display while playing a sound like this:



But how could I combine the two scripts to show a HUD, and play a specified sound after the character finishes the waypoint?

0 Geoff 0
17
Years of Service
User Offline
Joined: 3rd Aug 2007
Location:
Posted: 13th Jan 2008 21:36 Edited at: 13th Jan 2008 21:54
This should work a waypoint state of 5 is when you say what you want when the entity reaches the end of the waypoint.


Let me know if it works alright.
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 13th Jan 2008 22:08
Ok, that sort of worked. The sound plays, but it doesn't stop playing! It just loops until the game is ended. Also, the character didn't stop animating, the character stopped moving, but it was still animated like it was walking.

Also, is it possible to make it so after the sound is played (just once), the AI character begins following waypoints again?

0 Geoff 0
17
Years of Service
User Offline
Joined: 3rd Aug 2007
Location:
Posted: 13th Jan 2008 22:19
i edited the script after about a miniute from posting to fix the animation and i don't see why the sound is still on a loop that was just copyed and pasted from your sound with a changing of the states.

Try this for making the character follow waypoints after the sound and tell me if it's still on a loop.
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 14th Jan 2008 08:17
The character follows the waypoint, stops (the animation stops too), but then the HUD doesn't display, and no sound plays either.

0 Geoff 0
17
Years of Service
User Offline
Joined: 3rd Aug 2007
Location:
Posted: 14th Jan 2008 14:08 Edited at: 14th Jan 2008 14:08
Ok this should work(as i thought it always should)
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 14th Jan 2008 15:31
Ok, the sound plays, except the HUD doesn't show, and the character keeps repeating the waypoint forever. After it walks the waypoint twice, i'd like it to stop and not follow the waypoint again.

Also, after the character walks the waypoint once, i'd like it to stop following the waypoint until the HUD is hidden from the screen and the sound has stopped playing before it resumes walking along the waypoint once more.

Thanks for all your help so far! It's really appreciated!

0 Geoff 0
17
Years of Service
User Offline
Joined: 3rd Aug 2007
Location:
Posted: 14th Jan 2008 18:35
The reason the hud is'nt showing is because the directory is typed in wrong you will have to do that yourself as i don't know what you want shown same with the sound playing it may be incorrect.

Heres a script that dose what you want but the second time the character comes to the end of the waypoint it will do the same as the first, "sound and hud" also to get the character to stop after the second time you will have to adjust the second timer length to what fits for that waypoint at the moment it stops 10secs after the waypoint is started the second time.



Heres a script that is a bit of an experiment it means the hud and sound will not show the second time but i have no clue if it will work as im away from my FPSC computer for the last week
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 14th Jan 2008 19:17 Edited at: 14th Jan 2008 19:32
Ahh, that second experimental script is the one i'm after, because I don't want a HUD to show, or a sound to play at the end of the second waypoint. I'll try it out now.

EDIT: Now the character doesn't follow the first waypoint at all, just stands there.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 15th Jan 2008 08:34 Edited at: 15th Jan 2008 08:35



That oughta do it for ya.

Just a little problem with the colons and a little bit of an issue with "Create HUD to infinite, until the guy reaches the end of the waypoints", lol.


The one and only,
~PlystirE~

Urlforce:
Dude, I'd rather be declared a dbpro noob than an fpsc legend any day!
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 15th Jan 2008 23:20
Hey Plystire,

Very nice, thanks! Only problem is after the character walks the waypoint for the second time he doesn't stop and stay there, he keeps walking the waypoint. I want him to stop after the 2nd time, and then not do anything at all.

Thanks again!

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 16th Jan 2008 00:00 Edited at: 16th Jan 2008 00:00
Ah, okay, yeah I did change that part. Lol, my bad.

Just change this line:


to this




That oughta solve the problem.


The one and only,
~PlystirE~

Urlforce:
Dude, I'd rather be declared a dbpro noob than an fpsc legend any day!
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 16th Jan 2008 03:05 Edited at: 16th Jan 2008 03:30
Hmm, doesn't work. Everything works fine now, except on the first time the character walks the waypoint, the HUD isn't displayed. My filenames and all that are checked, and are all ok. What can be wrong?

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 16th Jan 2008 08:23
Well, if everything worked before you changed the line, how about changing it to this:



It's a little crude, but freezing the entity should make it stop moving.


The one and only,
~PlystirE~

Urlforce:
Dude, I'd rather be declared a dbpro noob than an fpsc legend any day!
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 16th Jan 2008 14:45
Hmm, still no luck. I don't think it actually did work before that change though either, because I had the HUD name wrong, I thought it had worked. Sorry about that.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 17th Jan 2008 06:31
Okay, can do you do me a favor and write out a detailed list of what you want to have happen versus what is actually happening? That way I'll have a better understanding of what's going wrong and be able to edit the script accordingly.


The one and only,
~PlystirE~

Urlforce:
Dude, I'd rather be declared a dbpro noob than an fpsc legend any day!
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 17th Jan 2008 07:25
Yep, sure.

I want a character to walk along a waypoint, and once it reaches the end of the waypoint, a HUD will be shown, and at the same time a sound will be played. After the sound has finished playing, the character will turn around and walk the waypoint again, to get back to his starting position. After walking the waypoint to get back to his starting position, he is no longer needed, and so can just stand there doing nothing.

What is happening is the character follows the waypoint once, stops, plays the sound, and after the sound is finished, walks the waypoint again, gets to the end and stops. The HUD isn't shown at the same time as the sound is playing, which is the problem.

Thanks!

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 17th Jan 2008 10:38
Hmmm, nothing seems to be wrong with the script, so, how about you try some testing with that HUD.

Can you get that specific HUD to show up using a simple script?


The one and only,
~PlystirE~

Urlforce:
Dude, I'd rather be declared a dbpro noob than an fpsc legend any day!
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 17th Jan 2008 19:28
Eek! I had two HUD's in the same level, and they both had the same hudname (6), so only the first one would display, and the second one (this script) wouldn't because of the same hudname. Changing the hudname worked perfectly.

Thanks a lot to Plystire and 0 Geoff 0 for all your help with this!

Login to post a reply

Server time is: 2024-11-24 04:02:25
Your offset time is: 2024-11-24 04:02:25