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

Weapon impact

HOT
broken avatar :(
Created 9 years ago
by fanmagic
0 Members and 1 Guest are viewing this topic.
8,218 views
broken avatar :(
×
broken avatar :(
Location: usEarth
Date Registered: 30 July 2015
Last active: 4 years ago
Posts
118
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Current project: Afterlife
Signature
"The only time you should look back, is to see how far you've come."
Off topic, but that fx looks familiar  ::)
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 9 months ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
Personal Quote
Payback
Signature
Tears Of The Fallen | Join the project https://discord.gg/8gDNQRj
×
fanmagic's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
Off topic, but that fx looks familiar  ::)
Pretty cool fx ;)  :D
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 9 months ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
Personal Quote
Payback
×
fanmagic's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
Everything works fine, but when i restart the map the fx is'nt playing on the impact point and my script to kill the zombies doesnt work anymore. It's only working correct when i start the map again with 'map' or 'devmap'. Is it possible to fix this isue?

Spoiler: click to open...
Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
    flag_wait("all_players_connected");
level.max_frozen = 24;
    level.max_freeze_distance = 300;
players = GetPlayers();
array_thread(players, ::weapon_fired);
}

weapon_fired()
{
self endon( "disconnect" );
self waittill( "spawned_player" );
for( ;; )
{
self waittill( "projectile_impact", weapon, impact );
if (weapon == "zombie_colt")
{
self thread impact_fx( impact );
}

}
}

impact_fx( impact )
{
level.bullet = spawn("script_model", impact);
level.bullet SetModel("tag_origin");
playfx( level._effect["ww"], level.bullet.origin  + ( 0, 0, 40 ));
iprintlnbold("Play fx on tag");

zombs = GetAISpeciesArray( "axis", "all" );
    get_AI = zombs;
close_zoms = get_array_of_closest( impact, get_AI, undefined, level.max_frozen, level.max_freeze_distance );

move_them = [];
for( i = 0; i < close_zoms.size; i++ )
{
        if(IsDefined(close_zoms[i].in_the_ground) && close_zoms[i].in_the_ground == true)
{
            close_zoms[i] super_kill();
            continue;
        }
move_them[i] = spawn("script_model", close_zoms[i].origin);
move_them[i] SetModel("tag_origin");
close_zoms[i] LinkTo( move_them[i] );
move_them[i] thread zombie_wobble();
close_zoms[i] thread kill_zoms();
}

wait (6);
for( i = 0; i < close_zoms.size; i++ )
{
close_zoms[i] unLink( move_them[i] );
move_them[i] delete();
}

level.bullet delete();
}

zombie_wobble()
{
while (isdefined(self))
{
self moveTo(level.bullet.origin, .5, .05, .05);
waittime = randomfloatrange(2.5, 5);
yaw = RandomInt( 360 );
if( yaw > 300 )
{
yaw = 300;
}
else if( yaw < 60 )
{
yaw = 60;
}
yaw = self.angles[1] + yaw;
self rotateto ((-60 + randomint(120), yaw, -45 + randomint(90)), waittime, waittime * 0.5, waittime * 0.5);
wait randomfloat (waittime - 0.1);
self thread kill_zoms();
}
}

kill_zoms()
{
wait(1.5);
self DoDamage( self.maxhealth+666, self.origin );
iprintlnbold("7 is Love. 7 is Life.");
    self thread NotifyPlayersOnSpatter();
self hide();
thread GivePlayersScore(60);
wait(1.5); 
}

super_kill()
{
self DoDamage( self.maxhealth+666, self.origin );
    if(IsDefined(self.animname) && self.animname != "zombie_dog" || self.animname != "quad_zombie") {
        self thread NotifyPlayersOnSpatter();
    }
self hide();
    thread GivePlayersScore(60);
}

blur_vision()
{
self SetBlur(10.3, 1);
wait(1);
self SetBlur(0, 1);
}

wait_for_bloodspatter() {
    for(;;) {
       // self iprintlnbold("Waiting for spatter notify");
       self waittill("spatter", zomb);
       if(DistanceSquared(zomb.origin, self.origin) <= 120000) {
           self.spatter = 1;
           // self iprintlnbold("Should splatter");
           wait(1);
           // self iprintlnbold("Splatter should be done");
           self.splatter = 0;
       }
       else {
           continue;
       }
    }
}

NotifyPlayersOnSpatter() {
    players = GetPlayers();
    for(i=0;i<players.size;i++) {
        players[i] notify("spatter", self);
    }
}

GivePlayersScore(score) {
    players = GetPlayers();
    for(i=0;i<players.size;i++) {
        players[i] maps\_zombiemode_score::add_to_player_score(score*level.zombie_vars["zombie_point_scalar"]);
    }
}
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 9 months ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
Personal Quote
Payback
×
fanmagic's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
Delete your mod in appdata. Sometimes appdata doesnt get updated properly
Tried out 3 times. Doesn't work.
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 7 months ago
Posts
1,864
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
My Groups
More
Personal Quote
ok
Signature
Aye mate you don't know me so y don't you shut tf up ok buddy :)

×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
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.
Scobalula's Contact & Social Links
Everything works fine, but when i restart the map the fx is'nt playing on the impact point and my script to kill the zombies doesnt work anymore. It's only working correct when i start the map again with 'map' or 'devmap'. Is it possible to fix this isue?

Spoiler: click to open...
Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
    flag_wait("all_players_connected");
level.max_frozen = 24;
    level.max_freeze_distance = 300;
players = GetPlayers();
array_thread(players, ::weapon_fired);
}

weapon_fired()
{
self endon( "disconnect" );
self waittill( "spawned_player" );
for( ;; )
{
self waittill( "projectile_impact", weapon, impact );
if (weapon == "zombie_colt")
{
self thread impact_fx( impact );
}

}
}

impact_fx( impact )
{
level.bullet = spawn("script_model", impact);
level.bullet SetModel("tag_origin");
playfx( level._effect["ww"], level.bullet.origin  + ( 0, 0, 40 ));
iprintlnbold("Play fx on tag");

zombs = GetAISpeciesArray( "axis", "all" );
    get_AI = zombs;
close_zoms = get_array_of_closest( impact, get_AI, undefined, level.max_frozen, level.max_freeze_distance );

move_them = [];
for( i = 0; i < close_zoms.size; i++ )
{
        if(IsDefined(close_zoms[i].in_the_ground) && close_zoms[i].in_the_ground == true)
{
            close_zoms[i] super_kill();
            continue;
        }
move_them[i] = spawn("script_model", close_zoms[i].origin);
move_them[i] SetModel("tag_origin");
close_zoms[i] LinkTo( move_them[i] );
move_them[i] thread zombie_wobble();
close_zoms[i] thread kill_zoms();
}

wait (6);
for( i = 0; i < close_zoms.size; i++ )
{
close_zoms[i] unLink( move_them[i] );
move_them[i] delete();
}

level.bullet delete();
}

zombie_wobble()
{
while (isdefined(self))
{
self moveTo(level.bullet.origin, .5, .05, .05);
waittime = randomfloatrange(2.5, 5);
yaw = RandomInt( 360 );
if( yaw > 300 )
{
yaw = 300;
}
else if( yaw < 60 )
{
yaw = 60;
}
yaw = self.angles[1] + yaw;
self rotateto ((-60 + randomint(120), yaw, -45 + randomint(90)), waittime, waittime * 0.5, waittime * 0.5);
wait randomfloat (waittime - 0.1);
self thread kill_zoms();
}
}

kill_zoms()
{
wait(1.5);
self DoDamage( self.maxhealth+666, self.origin );
iprintlnbold("7 is Love. 7 is Life.");
    self thread NotifyPlayersOnSpatter();
self hide();
thread GivePlayersScore(60);
wait(1.5); 
}

super_kill()
{
self DoDamage( self.maxhealth+666, self.origin );
    if(IsDefined(self.animname) && self.animname != "zombie_dog" || self.animname != "quad_zombie") {
        self thread NotifyPlayersOnSpatter();
    }
self hide();
    thread GivePlayersScore(60);
}

blur_vision()
{
self SetBlur(10.3, 1);
wait(1);
self SetBlur(0, 1);
}

wait_for_bloodspatter() {
    for(;;) {
       // self iprintlnbold("Waiting for spatter notify");
       self waittill("spatter", zomb);
       if(DistanceSquared(zomb.origin, self.origin) <= 120000) {
           self.spatter = 1;
           // self iprintlnbold("Should splatter");
           wait(1);
           // self iprintlnbold("Splatter should be done");
           self.splatter = 0;
       }
       else {
           continue;
       }
    }
}

NotifyPlayersOnSpatter() {
    players = GetPlayers();
    for(i=0;i<players.size;i++) {
        players[i] notify("spatter", self);
    }
}

GivePlayersScore(score) {
    players = GetPlayers();
    for(i=0;i<players.size;i++) {
        players[i] maps\_zombiemode_score::add_to_player_score(score*level.zombie_vars["zombie_point_scalar"]);
    }
}

Ideally instead of doing array thread you should set up 3 functions to wait for the player to connect and another to wait for the player to spawn, and one to wait for the player to fire, you should take a look at the Tesla script to see how it's done there.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,186
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
×
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 LinksBluntStuffyBluntstuffy@BluntZombieStuffyZombie
try removing the:

Code Snippet
Plaintext
	self waittill( "spawned_player" );

it's not really serving any purpose where it's placed anyway..

EDIT:

Ideally instead of doing array thread you should set up 3 functions to wait for the player to connect and another to wait for the player to spawn, and one to wait for the player to fire, you should take a look at the Tesla script to see how it's done there.

he's having the flag_wait in front, so all players should be connected so it shouldn't matter in this case..

It might also have to do with if you thread the script from mapname.gsc or _zombiemode.gsc btw, but first just try removing the wait like i mentioned above
Last Edit: August 07, 2016, 05:35:30 pm by BluntStuffy

 
Loading ...