Fading Brushmodels

broken avatar :(
Created 1507 days ago
by MrGVSV
0 Members and 1 Guest are viewing this topic.
1,360 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 July 2016
Last active: 1504 days ago
Posts
3
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
MrGVSV's Groups
MrGVSV's Contact & Social Links
I just wrote a script (it's based around MakeCents' awesome window breakables prefab link: https://ugx-mods.com/forum/index.php?topic=4602.0) that lets me simulate glass shattering upon shooting at it. However, once the brushmodels get launched in whatever direction,they still have their collision which makes navigating passed them in-game difficult. Any way I could remove their collision and/or have them fade away (the delete() function is just so ugly).

This is the code I thread to in my mapname.gsc
breakStuffTrigger()
{
break_trigger_array = getEntArray("break_trigger", "targetname");
for (i = 0; i<break_trigger_array.size; i++)
{
break_trigger_array[i] thread breakStuff();
}
}

breakStuff()
{
self waittill("trigger");
stuff_break = getEntArray(self.target, "targetname");
self playsound("glass_00");
for(i=0; i<stuff_break.size; i++){
if(isdefined(stuff_break[i].script_sound)){
stuff_break[i] playsound(stuff_break[i].script_sound);
}else{
stuff_break[i] playsound("wallcrash");
}
stuff_break[i] PhysicsLaunch( stuff_break[i].origin , (randomintrange(-10000,10000),randomintrange(-100000,10),10000) );
}
wait 5;
for(p=0;p<stuff_break.size;p++){
stuff_break[p] delete();
}
self delete();
}

(Side note: the playsound functions don't seem to work :-\) Any help is appreciated!
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 12 days ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
respect the dead

donates greatly appreciated :) [You are not allowed to view external links. Register or Login to see them]
discord server:
[You are not allowed to view external links. Register or Login to see them]
×
death_reaper0's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
for the sound try
playsoundatposition ("glass_00", self.origin);
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 27 days ago
Posts
1,187
Respect
1,393Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
[RELEASED] Greenhouse Realism 3.0: [You are not allowed to view external links. Register or Login to see them]

NUK370WN Realism 3.0: [You are not allowed to view external links. Register or Login to see them]
Industrial Estate Realism 3.0: [You are not allowed to view external links. Register or Login to see them]

Support my work here:  [You are not allowed to view external links. Register or Login to see them]
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Quote
Any way I could remove their collision
stuff_break[i] notsolid();



You cant have them fade out, maybe you could let them sink into the ground before you delete them. You could also try this, from animscripts\death.gsc:

gib_delete()
{
wait( 10 + RandomFloat( 5 ) );
for( i = 0; i < 100; i++ )
{
if( !self IsBeingWatched() )
{
break;
}

wait( 1 );
}
self Delete();
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 1 January 2014
Last active: 360 days ago
Posts
397
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Signature
×
vinnyz500's Groups
vinnyz500's Contact & Social Linkspsn_hackedlobbies4uXxMrPotatoxXvinnyz500
Or to put it simply, make those brush models non colliding... Right click in 3D view and click non colliding
EDIT: If collision is a problem before breaking, make a clip and delete it or move it when you break the glass
Last Edit: August 10, 2016, 12:10:11 am by vinnyz500

 

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
Loading ...