UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Easy Client Scripted FX/Sound

broken avatar :(
Created 8 years ago
by alaurenc9
0 Members and 1 Guest are viewing this topic.
5,352 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
My preferred name is "xSanchez78".
Check me out here: www.steamcommunity.com/id/xSanchez78
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
Hi guys, welcome to a unique release that I hope people find interest in.
Today I am releasing my ClientScripted Fx System.
This allows you to play fx and sound in client scripts easily from GSC.
This system has also been used in WARDOGSK93's Perk System.

MEGA:

MediaFire:

This system allows you to use basic functions in GSC to play sounds and fx in CSC.
CSC has easily proven itself to be better for playing sound and fx for reasons like
it saves g_spawn space, fx runs at client speed, and it can be only heard/seen by
a specific targetted player.

Init The Scripts:

Open maps\_zombiemode.gsc
in the top function main()
underneath this:
Code Snippet
Plaintext
maps\_zombiemode_auto_turret::init();
add this:
Code Snippet
Plaintext
maps\_xS78_fx_system::init();
Save & Close.
Now go into clientscripts\{MAPNAME}.csc
in the top function main()
underneath this:
Code Snippet
Plaintext
clientscripts\_load::main();
add this:
Code Snippet
Plaintext
clientscripts\_xS78_fx_system::init();
Save & Close.

Learn The Functions:

Function: create_loop_fx_to_player( player, identifier, fx_var, origin, angles )
What It Does: play's an fx that can be saved and destroyed later
Arguments: player - the player who sees the fx played
      identifier - string to identfy the fx. you can only play one fx on
         the same identifier. trying to play another fx on an
         already used identifier will result in nothing happening.
      you can use the same identifier for two different players.
      fx_var - the key used to identify the fx to be played. whatever key you
      use in the array of level._effect is what you put in here.
      Make sure all fx is loaded in GSC and CSC with the same key.
      origin - the origin of the fx
      angles - the angles of the fx. if you don't have specific angles, put ( 0, 0, 0 )

Function: destroy_loop_fx_to_player( player, identifier )
What It Does: destroy's a loop fx created based on the identifier
Arguments: player - the player who sees the fx played
      identifier - string to identify the fx in order to destroy it.
      once destroyed, this identity is cleared and can be re-used.
      trying to destroy an fx on an identity that doesn't exist
      results in nothing happening.

Function: play_oneshot_fx_to_player( player, fx_var, origin, angles )
What It Does: play's an fx that is not saved so it cannot be destroyed.
Arguments: player - the player who sees the fx played
      fx_var - the key used to identify the fx to be played. whatever key you
      use in the array of level._effect is what you put in here.
      Make sure all fx is loaded in GSC and CSC with the same key.
      origin - the origin of the fx
      angles - the angles of the fx. if you don't have specific angles, put ( 0, 0, 0 )

Function: create_loop_sound_to_player( player, identifier, alias, origin, fade_time )
What It Does: play's a loop sound that is saved and can be stopped later.
Arguments: player - the player who hears the sound played
      identifier - string to identfy the sound. you can only play one
      sound on the same identifier. trying to play another sound on
      an already used identifier will result in nothing happening.
      you can use the same identifier for two different players.
      alias - the alias name of the sound to play
      origin - the origin of the sound
      fade_time - the fade in time of the loop sound. if you don't want a fade in, put 0.

Function: destroy_loop_sound_to_player( player, identifier, fade_time )
What It Does: destroy's a loop sound created based on the identifier
Arguments: player - the player who hears the sound played
      identifier - string to identify the sound in order to destroy it.
      once destroyed, this identity is cleared and can be re-used.
      trying to destroy an sound on an identity that doesn't exist
      results in nothing happening.
      fade_time - the fade out time of the loop sound. if you don't want a fade out, put 0.

Function: play_oneshot_sound_to_player( player, alias, origin )
What It Does: play's a one shot sound at a position
Arguments: player - the player who hears the sound played
      alias - the alias name of the sound to play
      origin - the origin of the sound

WARNINGS:
   1. This system registers a Client System. World at War is limited to only 8
      client systems max being registered, and 7 are taken up by default. So if you
      have a custom client system of your own registered and you didn't de-register
      any other's already in world at war, this wont work because you are hitting
      the limit. There are some unused systems I'm sure you can safely unregister to
      make room, but I haven't looked into this myself. Otherwise, you should be good.

   2. This system has absolutely NO failsafes put in, so everything must be done correctly.
      Remember to follow all the steps and make sure you put in each argument for the
      functions used correctly. Make sure that nothing 'undefined' ever gets put in.
      As long as everything is correct, you should experience no error's.

This script was 100% created by me, and took alot
of time and effort to get right, so make sure to credit me.
If there is anything else that should be added to
the system, let me know. Thanks and Peace.
Last Edit: November 18, 2015, 10:48:20 pm by alaurenc9
broken avatar :(
×
broken avatar :(
Location: usrhode island
Date Registered: 22 February 2014
Last active: 5 years ago
Posts
75
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Brains
×
fiveseven hd's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Oil Rig Beta Access
Oil Rig Beta Access
fiveseven hd's Contact & Social Linksjaminboggs76561198122502681FiveSevenHD
i really like the idea of this, unfortunately I dont quite understand how to set this up. I understand and really like how you explain each fucntion. I just dont know what I need to do in radiant/set up for the scripting part.  Im trying to learn this whole scripting thing as best I can on my own but its hard as shit. When I progress a bit more i'll def come back to this tho. Looks pretty amazing man.
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
i really like the idea of this, unfortunately I dont quite understand how to set this up. I understand and really like how you explain each fucntion. I just dont know what I need to do in radiant/set up for the scripting part.  Im trying to learn this whole scripting thing as best I can on my own but its hard as shit. When I progress a bit more i'll def come back to this tho. Looks pretty amazing man.
you dont need to do anything in Raiant for this you just call 2 init functions after that you just call the functions explained above to do things (fx / sounds) per player

Code Snippet
Plaintext
// Called in maps\_zombiemode::main() after maps\_zombiemode_auto_turret::init()
maps\_xS78_fx_system::init();

// Called in clientscripts\{MAPNAME}::main() after clientscripts\_load::main()
clientscripts\_xS78_fx_system::init();

EDIT:

Just note that if you want to playFx using this you need to load the fx both in GSC and CSC
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
Fixed loop sounds not being able to fade out. Before, even if you added a fade out time greater than 0, it would just stop immediately. now its fixed.
broken avatar :(
×
broken avatar :(
Location: usrhode island
Date Registered: 22 February 2014
Last active: 5 years ago
Posts
75
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Brains
×
fiveseven hd's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Oil Rig Beta Access
Oil Rig Beta Access
fiveseven hd's Contact & Social Linksjaminboggs76561198122502681FiveSevenHD
I was actually looking for somthing like this...great job man. Im playing around with it right now .
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
I was actually looking for somthing like this...great job man. Im playing around with it right now .

thank you very much.

i have re-updated this post now with 100% confirmed and working loop sound fade out.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Signature
Hey if you had tons of fun on playing my maps please DONATE :)

play ESTATE now, and claim your mansion back from the undead!
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
what did i do wrong?

Code Snippet
Plaintext
maps\_xS78_fx_system::create_loop_fx_to_player(players[i], "snow" + players[i].entity_num, "snow_thick", players[i].origin, (0,0,0));

Code Snippet
Plaintext
level._effect["snow_thick"]	= LoadFx( "env/weather/fx_snow_blizzard_intense" );

is in both gsc and csc

and i have


Code Snippet
Plaintext
fx,env/weather/fx_snow_blizzard_intense

Double Post Merge: November 09, 2015, 11:20:55 am
also tried

maps\_xS78_fx_system::play_oneshot_fx_to_player(self, "snow_thick", self.origin, (0,0,0));

Double Post Merge: November 09, 2015, 11:33:06 am
nevermind, lol wasnt even calling the function.. need to go to bed



just gotta change to rain :)
Last Edit: November 09, 2015, 11:33:07 am by jei9363
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
what did i do wrong?

Code Snippet
Plaintext
maps\_xS78_fx_system::create_loop_fx_to_player(players[i], "snow" + players[i].entity_num, "snow_thick", players[i].origin, (0,0,0));

Code Snippet
Plaintext
level._effect["snow_thick"]	= LoadFx( "env/weather/fx_snow_blizzard_intense" );

is in both gsc and csc

and i have


Code Snippet
Plaintext
fx,env/weather/fx_snow_blizzard_intense

Double Post Merge: November 09, 2015, 11:20:55 am
also tried

maps\_xS78_fx_system::play_oneshot_fx_to_player(self, "snow_thick", self.origin, (0,0,0));

Double Post Merge: November 09, 2015, 11:33:06 am
nevermind, lol wasnt even calling the function.. need to go to bed

(Image removed from quote.)

just gotta change to rain :)

So this works 100% for you now?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
yeah sorry, i was sleepy. works fine. not going to use it for rain, but will probably for snow in the future because right now the UGX snow I dont think uses this so you probably get a lot of snow with 4 players
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
- Updated

The CSC was made neater, and it no longer spawns structs to save everything.

 
Loading ...