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

Fx and sounds in my script

broken avatar :(
Created 7 years ago
by Cxwh
0 Members and 1 Guest are viewing this topic.
1,813 views
broken avatar :(
×
broken avatar :(
Location: at
Date Registered: 26 November 2016
Last active: 6 years ago
Posts
45
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Signature
12 year old music critic, quadrasexual Minecrafter, Linkin Park fan, Hentai enthusiast, intelligent atheist and vegan.
×
Cxwh's Groups
Cxwh's Contact & Social LinksCxwhModsGodAspire
So I'm making my own gobblegum/weapon script/idk and I'm kind of lost when it comes to fx and sounds

I tried to exlpain what I was thinking as good as I can
Code Snippet
Plaintext
function bgb_activate()
{
self endon("disconnect");
if(!isDefined(self.bgb_active))
{
self.bgb_active = true;
self upgrade_knuckle_crack_begin();
self waittill("weapon_change_complete");

self upgrade_knuckle_crack_end();
self.bgb_active = undefined;
}
}

function upgrade_knuckle_crack_begin()
{
self zm_utility::increment_is_drinking();
self zm_utility::disable_player_move_states(true);

primaries = self GetWeaponsListPrimaries();

original_weapon = self GetCurrentWeapon();
weapon = GetWeapon("zombie_knuckle_crack");

if(original_weapon != level.weaponNone && !zm_utility::is_placeable_mine(original_weapon) && !zm_equipment::is_equipment(original_weapon))
{
self notify("zmb_lost_knife");
self TakeWeapon(original_weapon);
}
else
return;

self GiveWeapon(weapon);
self SwitchToWeapon(weapon);
}

function upgrade_knuckle_crack_end()
{
self zm_utility::enable_player_move_states();
weapon = GetWeapon("zombie_knuckle_crack");

if(self laststand::player_is_in_laststand())
{
self TakeWeapon(weapon);
return;
}
self zm_utility::decrement_is_drinking();
self TakeWeapon(weapon);

primaries = self GetWeaponsListPrimaries();
if(IS_DRINKING(self.is_drinking))
return;
else
self zm_weapons::switch_back_primary_weapon();
self thread bgb_action();
}

function bgb_action()
{
self endon("bgb_done");

range = 120;
rangeSQ = range**2; //since we're using distanceSquared
self thread electrocuting_ambient(range); //would be cool to have a cool 'electrocuting' sound

//kills = 0;
//max_kills = 12;

AI = GetAITeamArray("axis");
AI = self getClosestSQ(AI, rangeSQ);
for(i = 0; i < AI.size; i++)
{
if(isDefined(AI[i].is_brutus))
continue;

fx_duration = RandomFloatRange(0.2, 0.3);
AI[i] FreezeControls(true); //idk how to freeze a zombie lol ;(
AI[i] SetElectrified(fx_duration); //idk if this plays an fx on the zombies

wait RandomFloatRange(0.1, 0.2); //or time divided by 10 if I use IntRange
self notify("electrocuting_zombies"); //starting the earthquake and the sound
AI[i] SetPlayerCollision(false); //hopefully makes me able to walk through the zombies

while(fx_duration <= 0)
{
//bo2's fx - electric_cherry_reload_fx
//or a fire fx idk what looks good zombie/fx_aat_blast_furnace_zmb
PlayFxOnTag(level._effect["electric_cherry_explode"], AI[i], "j_head");
PlayFxOnTag(level._effect["electric_cherry_explode"], AI[i], "J_Spine1");
PlayFxOnTag(level._effect["electric_cherry_explode"], AI[i], "J_Spine4");
PlayFxOnTag(level._effect["electric_cherry_explode"], AI[i], "pelvis");
fx_duration -= 0.09; //just to add more randomness
wait 0.05;
}
wait 0.05;
AI[i] FreezeControls(false);
AI[i] DetachAll();
AI[i] DoDamage(AI[i].health + 1, self.origin, self);

//self zm_score::add_to_player_score(100); //or less idk
wait 0.05;
}
}

//idk how else I can do this in a 'clean' way
function electrocuting_ambient(range) //doing this so that there's only one eathquake
{
self endon("bgb_done");

self waittill("electrocuting_zombies");
PlaySoundAtPosition("zmb_cherry_explode", self.origin);
Earthquake(0.22, 0.3, self.origin, range);
}

function getClosestSQ(ents, rangeSQ) //SQ = squared
{
index = 0; //index for the new array
newArr = [];
for(i = 0; i < ents.size; i++)
{
if(DistanceSquared(self.origin, ents[i].origin) <= rangeSQ) //using distance squared since its faster
{
newArr[index] = ents[i];
index++;
}
}
return newArr;
}
Last Edit: December 26, 2016, 02:06:34 am by Cxwh
broken avatar :(
×
broken avatar :(
Location: nzChristchurch
Date Registered: 8 June 2014
Last active: 6 years ago
Posts
77
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Can I do this?
Signature
×
IDontEvenKnow's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
What is it you want? I can't get anything from a wall of a script.
broken avatar :(
×
broken avatar :(
Location: at
Date Registered: 26 November 2016
Last active: 6 years ago
Posts
45
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Cxwh's Groups
Cxwh's Contact & Social LinksCxwhModsGodAspire
What is it you want? I can't get anything from a wall of a script.
Need someone to help me set up sounds and effects for it
broken avatar :(
×
broken avatar :(
Location: nzChristchurch
Date Registered: 8 June 2014
Last active: 6 years ago
Posts
77
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Can I do this?
×
IDontEvenKnow's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
http://steamcommunity.com/sharedfiles/filedetails/?id=833247074
That's a tut on dynamically playing Fx, add me on Steam, I might try get some motivation to make a sound tutorial later tonight since I have a FX and model one.

 
Loading ...