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

Help scripting a boss zombie

broken avatar :(
Created 12 years ago
by whippytrout
0 Members and 1 Guest are viewing this topic.
3,157 views
broken avatar :(
×
broken avatar :(
Location: usgeorgia
Date Registered: 24 April 2013
Last active: 3 years ago
Posts
560
Respect
Forum Rank
Zombie Enslaver
Primary Group
Mapper
×
whippytrout's Groups
Mapper Has released one or more maps to the UGX-Mods community.
whippytrout's Contact & Social LinksWhippyTroutWhippyTrout
Hey guys I have been working on a boss zombie recently and used some of this tutorial found here: http://www.zombiemodding.com/index.php?topic=4099.0
It works alright I changed it a little but the one issue that I cant figure out is how to disable points when you shoot the boss. I've tried adding a check in zombie_damage() and zombie_damage_ads() in zombiemode_spawner.gsc but I cant figure out a way to write it. Every time I try to add a check it just disables points for all zombies. Is there a way I can set some kind of variable for the boss so only he doesn't have points?
This is one example of what I tried which takes all points away:
Code Snippet
Plaintext
if(level.boss == true)  // I need some kind of variable here
{
        set_zombie_var( "zombie_score_kill", 0 );
set_zombie_var( "zombie_score_damage", 0 );
set_zombie_var( "zombie_score_bonus_melee", 0 );
set_zombie_var( "zombie_score_bonus_head", 0 );
set_zombie_var( "zombie_score_bonus_neck", 0 );
set_zombie_var( "zombie_score_bonus_torso", 0 );
set_zombie_var( "zombie_score_bonus_burn", 0 );

}

Any help would be appreciated.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Majority(if not all) of the scoring logic is handled in _zombiemode_score.gsc. I wouldn't know exactly what you would need to change because i've never made a boss zombie before or seen the script that your making so yeah.  :P

If nothing else you could (probably) take the points away as the player receives them, but it'd look real stupid. lol
Marked as best answer by whippytrout 12 years ago
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 3 years ago
Posts
5,544
Respect
6,646Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Your logic is incorrect. You are looking at the wrong place to take over the score values. Looking at your example it is very clear why you are only able to change the points for all zombies and not just the boss.

In _zombiemode_spawner there is a function which handles the damage the zombies recieve from players. What you need is a .variable on the boss zombie (set it when he spawns) so that you can do a check similarly to:

Code Snippet
Plaintext
if(!self.boss_zombie)
where self is the zombie ent in the damage function. Add your logic for this bool to the zombie_spawn_init() function in _zombiemode_spawner. All non-boss zombies should be set to false.

As far as where to put the check, look at the first ~20 lines of zombie_damage() in _zombiemode_spawner.

Adding the above logic to the existing code, it should look like this:
Code Snippet
Plaintext
if( self zombie_flame_damage( mod, player ) )
{
if( self zombie_give_flame_damage_points() )
{
if(isDefined(self.boss_zombie) && !self.boss_zombie)
player maps\_zombiemode_score::player_add_points( "damage", mod, hit_location, self enemy_is_dog() );
}
}
else if( self maps\_zombiemode_tesla::is_tesla_damage( mod ) )
{
self maps\_zombiemode_tesla::tesla_damage_init( hit_location, hit_origin, player );
return;
}
else
{
if(isDefined(self.boss_zombie) && !self.boss_zombie)
player maps\_zombiemode_score::player_add_points( "damage", mod, hit_location, self enemy_is_dog() );
}
If you have a tesla gun in your map you will need to handle that as well.

Majority(if not all) of the scoring logic is handled in _zombiemode_score.gsc. I wouldn't know exactly what you would need to change because i've never made a boss zombie before or seen the script that your making so yeah.  :P

If nothing else you could (probably) take the points away as the player receives them, but it'd look real stupid. lol
Both of your suggestions would be handling the problem after-the-fact, which by definition is not the way to go about preventing something.

None of the scoring logic that he would need is handled in that file. That file handles the scores that the scripts have already determined should be given - it should not be responsible for checking the validity of incoming scores. If you don't want a score to happen, don't call the score function. Simple as that.

 
Loading ...