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 / Script work-arounds (Plystire :P)

Author
Message
Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 7th Dec 2008 07:12 Edited at: 7th Dec 2008 12:53
Hi

Could anyone let me know if there are any commands/work arounds to get the following effects:

FadeSound=X - Sound gradually fades in/out
PlrHit=X - This detects how long it was since the player was last damaged e.g. 3 seconds
FadeHUD=X - fades HUD in or out depending on the value (1-100)

Any ideas?

Free Segment Packs: V1-http://forum.thegamecreators.com/?m=forum_view&t=124552&b=24
V2 - http://forum.thegamecreators.com/?m=forum_view&t=124709&b=24
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 7th Dec 2008 18:52
Quote: "FadeSound=X - Sound gradually fades in/out"


You could script this using the music volume.


Quote: "PlrHit=X - This detects how long it was since the player was last damaged e.g. 3 seconds"


You can script this with a timer and a global variable.


Quote: "FadeHUD=X - fades HUD in or out depending on the value (1-100)"


You can do this with the alphafade commands.
Look in the appear2.fpi for an example.

Don't forget to visit Conjured Entertainment

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 7th Dec 2008 22:08
Individual sounds cannot be faded. You can fade the music volume, though, as CE pointed out. The best you can do for sounds is the "soundscale=X" command, but that will scale the volume of 3D sounds.


Quote: "You can script this with a timer and a global variable."


I'd be interested in seeing that.
I would have used a Mod for this, but if you can do it without one, maybe you should help him out with it.


Fading a HUD (Not an entity) can only be achieved with the "hudfadeout=X" command. This will make the hud fade out as it slowly moves upwards (not an effect that I personally enjoy, either). Also, Your definition would need two parameters, X and Y, one for the HUD's Name and the other for the desired alpha level.


The one and only,


Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 8th Dec 2008 07:22
1. The sound is currently using loopsound=$0, as the sound keeps repeating itself from the start, so music=X is currently not an option (but this one doesn't really matter)

2. I'm not sure how I would achieve the second one, as I don't think there is a plrhit=X condition. The plrcanbeseen condition is an option though, for instance if the player can't be seen for 4 seconds.

3. My HUD would look retarded if it moved upwards, so I think I'll leave that one out. Unless it's possible to use animated HUDs? In which case I could make a fade animation...

Free Segment Packs: V1-http://forum.thegamecreators.com/?m=forum_view&t=124552&b=24
V2 - http://forum.thegamecreators.com/?m=forum_view&t=124709&b=24
maikyy
16
Years of Service
User Offline
Joined: 29th Jul 2008
Location: between my front and back door
Posted: 8th Dec 2008 22:02
i'm sorry if this is a non constructive post but i have to say this,

Why do very much people put plystire in the name of the thread, i mean is he the only one who can help you????
i know plystire is thebest scripter around here on the forums(at leat i think he is)
but don't you think other people can't help you???

sorry for my bad english (i am dutch)
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 9th Dec 2008 03:43
@marc:

I do believe "loopsound" cues a 3D sound that loops, which would be effected by the "ScaleSound" command. You may want to look into it then.

I'm not seeing a decent way to accomplish the "PlrHit=X" with the standard script commands... maybe have to wait until CE comes back in.

For the fading HUD, you could make a bunch of images that are of the same image just with different alpha levels, and then swap them out on the fly to make it look like it's fading out.


@maikyy:

I don't know either, but it does make me want to read them first.


The one and only,


Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 9th Dec 2008 05:07 Edited at: 9th Dec 2008 05:56
Quote: "I'm not seeing a decent way to accomplish the "PlrHit=X" with the standard script commands... maybe have to wait until CE comes back in."

I don't think I could a timer for when the player was last damaged easily, BUT you could easily do when the player was last shot at.
Use multiple timers based on a main timer script that increments multiple variables each second in a one second loop.
Now each of those multiple variables can be used as a timer.
Simply set the timer variables value to zero to start the timer and the main timer script does the rest.
Reading the value will tell you how many seconds have elapsed since the variable was reset.
Now all we have to do is set one of those variable to zero in every enemy script right after the useweapon action.
Now every time a enemy shoots at the player the 'shot at timer' is reset.
Again, reading that variable's value is your shot at timer.

I could do the player damage thing, but it woulld entail copying the player's health to a variable and then doing it again so the two could be compared.
That sounds silly but you have to emulate the value in order to work with it or you would be affecting the players health in the process.
I can do addition and subtraction and a few other things with those variables, but it is complicated. (adding two variables not adding to a variable)
Look at the cash scripts for examples of playing with the numbers.

So, in order to copy the players health to a global variable we can store we have to increase the health while incrementing two variables.
Then one variable would be used to restore the player's health. (decrement the variable while decrementing health)
Leaving the other variable as our stored player health value.

Then that process would be done again later (each second maybe)using two other variables so we store it again.

Then we compare the two stored variables by decrementing each together until one equals zero.
The difference if any is the value of the other variable.

If it equals zero then no player damage has been attained and the shot timer variable would be incremented by one for that one second loop.

If the variable was greater than zero then the player did take damage and we would reset the shot timer variable.

So, bottom line is ...it can be done but not easily.

PS
We would increment the players health to an even hundred higher than they start at rather than decrementing it to zero.
Then we would return it with that second variable I was talking about.
That way we don't kill the player when determining their health's value.

Quote: "i know plystire is thebest scripter around here on the forums(at leat i think he is)"

Yeah, he reminds me of Merranvo , and Merranvo is the best.

Quote: "I'm not seeing a decent way to accomplish the "PlrHit=X" with the standard script commands... maybe have to wait until CE comes back in."

I know you were sticking it to me, but that's ok because it can be done.




Don't forget to visit Conjured Entertainment

Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 9th Dec 2008 08:09
@Conjured

Um OK I'm confused, I'll see what I can do

Free Segment Packs: V1-http://forum.thegamecreators.com/?m=forum_view&t=124552&b=24
V2 - http://forum.thegamecreators.com/?m=forum_view&t=124709&b=24
meteorite
18
Years of Service
User Offline
Joined: 19th Nov 2006
Location: The Capital Wasteland
Posted: 15th Dec 2008 02:35
I know how to do this with Ply's mod, but I dunno if you use that


*slap!*
Quiet yourself, think before posting, and maybe you won't be as ignorant as you seem.
Marc Steene
FPSC Master
18
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 21st Dec 2008 10:46
I don't currently use it (because of the ambience issue with V107) but when the V113 comes out, I will definatly download/purchase it. Maybe Ply could add a PlrHit condition?

Free Segment Packs: V1-http://forum.thegamecreators.com/?m=forum_view&t=124552&b=24
V2 - http://forum.thegamecreators.com/?m=forum_view&t=124709&b=24

Login to post a reply

Server time is: 2024-11-24 17:05:22
Your offset time is: 2024-11-24 17:05:22