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 / hard script need help

Author
Message
Fruitless CRUNK
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: DRINKING MY HOT COFFEE =:-)
Posted: 18th Jun 2008 07:31
Hi

I've been working on this script for a long time and got no were. I want to shoot a gun then music fads in then stays there 5 secs after the action like in the Darkness or Devel Maycry.

BOOM!!!!!! HEAD SHOT!!!
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 18th Jun 2008 12:28 Edited at: 18th Jun 2008 12:31
Ah, so you're looking to have some sort of "Battle Music" that'll only be around for when you're fighting.

Hmmmm... well, since there's no way to detect if the player has shot their weapon or not, you're kinda SOL. However, Ply's Mod V1.06 has a "mouseclick=X" condition, which would allow you to determine if the player has left clicked. But again, you'll run into some problems... like, the music would still cue if the player left clicked when they don't have a weapon.

But, that seems to be your best bet for going that route.


Here's a thought:

- In all of your enemy scripts, if they spot the player and are currently engaging the player, then have them set a variable to 1 (All of them would use the same variable for this)
- Now, set up a script that will act as a control script for your battle music. It will constantly check if the variable used by your enemies is set to 1. If it is, then you know one of them has engaged the player and you can then fade in the proper music. (I would suggest fading from a music volume of -100 to 100)
- Now, your control script will set the variable back to 0 immediately and start up a timer. If the timer reaches 5 seconds, then it'll fade out the music and reset. However, if the variable goes BACK to 1 while the timer is still going, then reset the timer and set the variable back to 0. This will keep your music going during the fight.


To save you some effort, and because I'm feeling generous right now, here's the control script as I see it.... using Ply's Mod, but you can alter it to use the variables from the official updates, I chose to use Ply's Mod because of how simple the script will be with it:

(This code will have the music play for 1.5 seconds after the battle ends)



Now, whenever your enemies are shooting at the player, include this line of code (assuming you're using their Shoot AI for engaging the player):




That should do it.

Maybe Conjured willl wander here at some point and make you an official update version of this.


The one and only,


Fruitless CRUNK
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: DRINKING MY HOT COFFEE =:-)
Posted: 19th Jun 2008 22:27 Edited at: 19th Jun 2008 22:28
Thanks for the script I will defently try it in FPSCX9 but, I wanted for X10. There is no way for you to know that, it was my fualt. Another error in FPSCX10 no sorce code.

PS I didn't know about the FPSCX10 new forums untell 20 mins after I had posted this.

BOOM!!!!!! HEAD SHOT!!!
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 20th Jun 2008 08:01
Lol, well I don't know the differences between the X10 scripting language and the one for X9.

From what I've heard, though, X10 has not yet seen the light of variables, so it may be a bit harder to accomplish.


How about this instead for X10:

Have each enemy set up so that when they engage the player, they activate the control script for the music with a value of 1. This could be used in place of the variable.


That might work ebtter for you, but I can't whip up a script for ya. Don't have X10 so I won't know whether it'll work or not.


At least, people can now have battle music for either version, though.


The one and only,


Login to post a reply

Server time is: 2024-11-24 09:55:34
Your offset time is: 2024-11-24 09:55:34