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

Dog rounds random powerup

HOT
broken avatar :(
Created 9 years ago
by Deer2014
0 Members and 1 Guest are viewing this topic.
5,935 views
broken avatar :(
×
broken avatar :(
Location: hu
Date Registered: 20 July 2014
Last active: 3 months ago
Posts
89
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Deer2014's Groups
Deer2014's Contact & Social Links
Hi guys,

Is possible random power-ups at the end of dogs round?
I want insta-kill and max-ammo appear randomly.

I would like to ask for help.
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 22 September 2014
Last active: 4 years ago
Posts
360
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Here to make epic maps
×
pcmodder's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
pcmodder's Contact & Social Linkspcmodderugxken5hir0
Hey man i do not use dogs in my map but i believe this is where you would change that . In zombiemode_dogs.gsc ( which can be located in raw/ maps and added to your mapname/maps folder and ticked in launcher.

Code Snippet
Plaintext
dog_round_aftermath()
{

level waittill( "last_dog_down" );

power_up_origin = level.last_dog_origin;

if( IsDefined( power_up_origin ) )
{
//level thread randomize_dog_powerup_drop(power_up_origin);
for ( i = 0; i < level.zombie_powerup_array.size; i++ )
{
if ( level.zombie_powerup_array[i] == "full_ammo" ) <------ in dlc3 code the power ups are listed
{
level.zombie_powerup_index = i;
break;
}
}

But this will not give a random drop only you may be able to add it there somehow. I did not add dogs to my map as i think not many players like the dogs rounds but i may be wrong :D ( + i prefer to kill the zombs  )
broken avatar :(
×
broken avatar :(
Location: hu
Date Registered: 20 July 2014
Last active: 3 months ago
Posts
89
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Deer2014's Groups
Deer2014's Contact & Social Links
Yes, I found this piece of code. It is necessary to change it.

Unfortunately, I'm not a professional scripter but I care ::), will take some time until I'll do a function that the randomly power-ups (only two power-ups: max-ammo and insta-kill. That's it.).

If anyone can help me, thank.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21'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.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Code Snippet
Plaintext
dog_round_aftermath()
{
        rand = undefined;

level waittill( "last_dog_down" );

power_up_origin = level.last_dog_origin;

if( IsDefined( power_up_origin ) )
{
                rand = randomIntRange(0, level.zombie_powerup_array.size );
                level.zombie_powerup_index = rand;
        }


That might do it - untested
Last Edit: January 12, 2015, 12:59:41 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: hu
Date Registered: 20 July 2014
Last active: 3 months ago
Posts
89
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Deer2014's Groups
Deer2014's Contact & Social Links
Code Snippet
Plaintext
dog_round_aftermath()
{
        rand = undefined;

level waittill( "last_dog_down" );

power_up_origin = level.last_dog_origin;

if( IsDefined( power_up_origin ) )
{
                rand = randomIntRange(0, level.zombie_powerup_array.size );
                level.zombie_powerup_index = rand;
        }


That might do it - untested

Thanks for your time and the script.

It does not work because the first dog born in an open area, the other dogs are born in a closed area. :(
Only two power-ups needed to be random: max ammo and the insta-kill.  :P
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21'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.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
eh? try explaining that again
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 22 September 2014
Last active: 4 years ago
Posts
360
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Here to make epic maps
×
pcmodder's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
pcmodder's Contact & Social Linkspcmodderugxken5hir0
Thanks for your time and the script.

It does not work because the first dog born in an open area, the other dogs are born in a closed area. :(
Only two power-ups needed to be random: max ammo and the insta-kill.  :P
It sounds like he has dogs spwning in zones that are not activated to me XD Check your dogs are blocked by the script_flag of the trigger for the area
broken avatar :(
×
broken avatar :(
Location: hu
Date Registered: 20 July 2014
Last active: 3 months ago
Posts
89
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Deer2014's Groups
Deer2014's Contact & Social Links
Harry Bo21 your script is ok. Sorry, I made a mistake.  :P

I found the cause of the problem about the stuck dogs.
I just copied the dog's script_struct from zone 3 to zone 4  and forgot to rewrite the script_struct's targetname.
Therefore, when I activated the zone 3, the dogs born in the zone 4, which of course was closed.  ::)

How can I solve that dogs can only give two random powerup (max ammo and insta-kill)?
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21'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.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
It should be totally random?

Code Snippet
Plaintext
level.zombie_powerup_array.size 

This line is accessing all powerups stored in the level data? Try it a few more times
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
It should be totally random?

Code Snippet
Plaintext
level.zombie_powerup_array.size 

This line is accessing all powerups stored in the level data? Try it a few more times

I think he is asking how can he make it so he ONLY gets insta kill or a max ammo
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21'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.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Oh?

Code Snippet
Plaintext
dog_round_aftermath()
{
        rand = undefined;
        tempValue = undefined;

level waittill( "last_dog_down" );

power_up_origin = level.last_dog_origin;

if( IsDefined( power_up_origin ) )
{
                rand = randomIntRange( 0, 2 );
                if ( rand == 0 )
                {
                        tempValue = "full_ammo";
                }
                else
                {
                        tempValue = "insta_kill"
                }
               
                for ( i = 0; i < level.zombie_powerup_array.size; i++ )
{
if ( level.zombie_powerup_array[i] == tempValue )
{
level.zombie_powerup_index = i;
break;
}
}
        }

I think that will do it, let me know if you get a error as not at home, wrote this from work

One thing ill note though, is "is it a good idea to have dogs drop a insta kill?"

If the windows are boarded up, the instakill will run out before the players get a chance to kill anything i think


This could also work, Ive not looked at statements without {} in GSCs yet
Code Snippet
Plaintext
dog_round_aftermath()
{
        rand = undefined;
        tempValue = undefined;

level waittill( "last_dog_down" );

power_up_origin = level.last_dog_origin;

if( IsDefined( power_up_origin ) )
{
                rand = randomIntRange( 0, 1 );
                if ( rand == 0 ) tempValue = "full_ammo";
                else tempValue = "insta_kill"
               
                for ( i = 0; i < level.zombie_powerup_array.size; i++ )
{
if ( level.zombie_powerup_array[i] == tempValue )
{
level.zombie_powerup_index = i;
break;
}
}
        }
Last Edit: January 21, 2015, 12:41:19 am by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: hu
Date Registered: 20 July 2014
Last active: 3 months ago
Posts
89
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Deer2014's Groups
Deer2014's Contact & Social Links
Quote
"is it a good idea to have dogs drop a insta kill?"

Not the best idea, but it's fun.  :P
Maybe I'll change later from Insta-kill to Carpenter...  or something else. ::)

Harry Bo21 thanks for the script help.


broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21'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.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
no problem :)
broken avatar :(
×
broken avatar :(
Location: hu
Date Registered: 20 July 2014
Last active: 3 months ago
Posts
89
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Deer2014's Groups
Deer2014's Contact & Social Links
Hi Harry Bo21

I tested your script, but always given max_ammo.
the "rand" variable = 0 always.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21'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.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
I think "insta-kill" is under a differnet name to what i put it as

Youll need to check what the power up is called, think its in DLC3code

 
Loading ...