UGX-Mods

Call of Duty 5: World at War => Tutorial Desk => Scripting => Topic started by: MZslayer11 on March 05, 2015, 03:12:49 am

Title: [Script] Hitmarkers (Updated)
Post by: MZslayer11 on March 05, 2015, 03:12:49 am
[Script] Hitmarkers (Updated)


This is an updated version of an old script that I posted a while ago. This new script addresses many issues with the old script and is much better. Remove all scripting that you did for the old script before using this script. Thanks.


Preview Video:
[You are not allowed to view external links. Register or Login to see them]


Download and simply put the files where they belong. The sound files are default WaW files just placed correctly for you. Then just copy the mod.csv lines into your mod.csv and continue with the tutorial.



Step 1
------------------------------
In mapname.gsc above
maps\_zombiemode::main();
add
precacheShader( "damage_feedback" );

Step 2
-------------------------------
In _zombiemode_spawner.gsc in the function
zombie_death_event( zombie ) { CODE }
below
zombie waittill( "death" );
add
if( IsDefined( zombie.attacker ) && IsPlayer( zombie.attacker ) ) zombie.attacker thread maps\_damagefeedback::updateDamageFeedback( zombie );

Step 3
--------------------------------
In _zombiemode_spawner.gsc in the function
zombie_damage( mod, hit_location, hit_origin, player ) { CODE }
below
if( !IsDefined( player ) )
{
return;
}
add
if( IsDefined( player ) && IsPlayer( player ) ) player thread maps\_damagefeedback::updateDamageFeedback( self );

Step 4
--------------------------
Do the same thing in Step 3 for Step 4 but this time in the zombie_damage_ads function
zombie_damage_ads( mod, hit_location, hit_origin, player ) { CODE }

Step 5
--------------------------
In _zombiemode.gsc find
onPlayerSpawned() { CODE }
and below
self add_to_spectate_list();
add
if( !IsDefined( self.hud_damagefeedback ) )
self thread maps\_damagefeedback::init();

Step 5
--------------------------
Make sure all scripts are checked in your mod builder and build you mod.

DONE



If you use this script in your map, give credit to PROxFTW and MZslayer11
Title: Re: [Script] Hitmarkers
Post by: PROxFTW on March 05, 2015, 03:32:58 am
There were a few reasons why I never posted this, not cause I didn't want anyone to know, but if you can tell, the sound doesn't exactly work, I believe the SP_hit_alert was changed to MP_hit_alert for the sound, and maybe something else but can't remember. And there was an issue where you could get hitmarkers on an already killed zombie. I was just never in the mood to exactly go about fixing any of this, so why I never posted it, and wanted to redo the script a bit. Also, the one you copied had an issue in co-op, just if you are going to keep it just update it, the updated script was like 3 post below.
Title: Re: [Script] Hitmarkers
Post by: MZslayer11 on March 05, 2015, 03:39:07 am
There were a few reasons why I never posted this, not cause I didn't want anyone to know, but if you can tell, the sound doesn't exactly work, I believe the SP_hit_alert was changed to MP_hit_alert for the sound, and maybe something else but can't remember. And there was an issue where you could get hitmarkers on an already killed zombie. I was just never in the mood to exactly go about fixing any of this, so why I never posted it, and wanted to redo the script a bit. Also, the one you copied had an issue in co-op, just if you are going to keep it just update it, the updated script was like 3 post below.

I believe I actually copied the script from the last one down and it seems to be working fine (except sounds, I will mention this in the tutorial). I test coop with my friend and it worked fine. Also, I haven't noticed hitmarkers on killed zombies so that's good.  ;)
Title: Re: [Script] Hitmarkers
Post by: Ege115 on March 05, 2015, 05:03:56 am
There were a few reasons why I never posted this, not cause I didn't want anyone to know, but if you can tell, the sound doesn't exactly work, I believe the SP_hit_alert was changed to MP_hit_alert for the sound, and maybe something else but can't remember. And there was an issue where you could get hitmarkers on an already killed zombie. I was just never in the mood to exactly go about fixing any of this, so why I never posted it, and wanted to redo the script a bit. Also, the one you copied had an issue in co-op, just if you are going to keep it just update it, the updated script was like 3 post below.
You could just check if the zombie is alive after they get damaged,
if(isAlive(zombie))
Title: Re: [Script] Hitmarkers
Post by: Harry Bo21 on March 05, 2015, 05:06:08 am
Finally, Ive been trying to find this for literally ages lol

Thanks for sharing MZslayer11

And thanks for the script PROxFTW :)
Title: Re: [Script] Hitmarkers
Post by: MrDunlop4 on March 05, 2015, 05:18:12 am
Nice Thanks for sharing :D

MrDunlop4
Title: Re: [Script] Hitmarkers
Post by: sethnorris on March 05, 2015, 09:56:00 am
I know this is a silly question but could you upload some sort of video/pic so non-scripters know what this is about? I understand this but i would like to see it in a more visual way.
Title: Re: [Script] Hitmarkers
Post by: Harry Bo21 on March 05, 2015, 10:08:23 am
Its the same thing as you get in multiplayer

If you hit someone (in this case a zombie) you hear a noice, and see a little crosshair appear for about a second.

If you get them in the head, its usually a slightly different noise

Its literally just to indicate the bullet hit a "opponent"
Title: Re: [Script] Hitmarkers
Post by: PROxFTW on March 05, 2015, 12:34:04 pm
You could just check if the zombie is alive after they get damaged,
if(isAlive(zombie))
Yah I know, was going to be my way to fix it, but just got to lazy to ever do it.
Title: Re: [Script] Hitmarkers
Post by: Andy Whelan on March 16, 2015, 05:44:15 am
Thank You for sharing
Title: Re: [Script] Hitmarkers
Post by: HitmanVere on March 16, 2015, 07:51:48 am
If I remember correctly, this plays for everyone, so if you shoot zombie, friends can see your hitmarkers  :-\
Title: Re: [Script] Hitmarkers
Post by: MZslayer11 on March 16, 2015, 10:43:08 am
If I remember correctly, this plays for everyone, so if you shoot zombie, friends can see your hitmarkers  :-\

Nope. That was a similar script. This one is fixed, and I tested it coop  ;)
Title: Re: [Script] Hitmarkers
Post by: Dust R I P on March 25, 2015, 04:42:17 pm
Idk if I'M doing something wrong but this seems to lag my map and delay everything
Title: Re: [Script] Hitmarkers
Post by: MZslayer11 on March 26, 2015, 03:33:21 am
Idk if I'M doing something wrong but this seems to lag my map and delay everything

Hmm... I'm not sure what to tell you as I have not experienced this problem and I am not particularly experienced in scripting.
Title: Re: [Script] Hitmarkers
Post by: PROxFTW on April 20, 2015, 01:22:42 am
This is an updated version of the hitmarkers. Not really necessary to update but should be a little better than the original script. This includes headshot sounds and no longer shows hitmarkers on dead zombies. This does require a little more scripting but should be more reliable. Also MZslayer11 if you want to update you can but up to you. If there are any issues let me know. My files are completely different so I tried to determine the exact spots they should be but I could have messed something up still.

Step 1
------------------------------
In mapname.gsc above
maps\_zombiemode::main();
add
precacheShader( "damage_feedback" );

Step 2
-------------------------------
In _zombiemode_spawner.gsc in the function
zombie_death_event( zombie ) { CODE }
below
zombie waittill( "death" );
add
if( IsDefined( zombie.attacker ) && IsPlayer( zombie.attacker ) ) zombie.attacker thread maps\_damagefeedback::updateDamageFeedback( zombie );

Step 3
--------------------------------
In _zombiemode_spawner.gsc in the function
zombie_damage( mod, hit_location, hit_origin, player ) { CODE }
below
if( !IsDefined( player ) )
{
return;
}
add
if( IsDefined( player ) && IsPlayer( player ) ) player thread maps\_damagefeedback::updateDamageFeedback( self );

Step 4
--------------------------
Do the same thing in Step 3 for Step 4 but this time in the zombie_damage_ads function
zombie_damage_ads( mod, hit_location, hit_origin, player ) { CODE }

Step 5
--------------------------
In _zombiemode.gsc find
onPlayerSpawned() { CODE }
and below
self add_to_spectate_list();
add
if( !IsDefined( self.hud_damagefeedback ) )
self thread maps\_damagefeedback::init();

Step 6
---------------------------
Download: https://www.mediafire.com/?p1clt5klq6g1lny (https://www.mediafire.com/?p1clt5klq6g1lny)
And simply put the files where they belong. The sound files are default waw files just placed correctly for you. There are also 2 csv files because the sound info came from 2 different csv files and I didn't feel like modifying them to work in 1. Then just copy the mod.csv lines into your mod.csv and done.

Video of the updated version for those wondering
Sorry but you are not allowed to view spoiler contents.
Title: Re: [Script] Hitmarkers
Post by: MZslayer11 on April 20, 2015, 01:25:34 am
Nice job man! I will test it and update the op when I get around to it.
Title: Re: [Script] Hitmarkers
Post by: Wolf_Silver on April 27, 2015, 12:59:11 pm
I test it and 1st method doesn't work for me but 2nd work great thanks OP and PROxFTW !
Title: Re: [Script] Hitmarkers
Post by: MZslayer11 on April 27, 2015, 11:23:43 pm
I test it and 1st method doesn't work for me but 2nd work great thanks OP and PROxFTW !

The first one should still work, but 'm glad you got his working. ;) I know I already said this, but I'm lazy af lol. I will update the OP w/ the new script when I get around to it.
Title: Re: [Script] Hitmarkers
Post by: alaurenc9 on May 02, 2015, 02:45:01 pm
maybe instead of adding all that shit in _zombiemode_spawner you could add it in _zombiemode_score in the player_add_points function since that is threaded every time you damage or kill a zombie
Title: Re: [Script] Hitmarkers
Post by: Sithy on May 10, 2015, 04:42:43 am
If anyone is able to help me add this to zombierealism 2.2 that would be awsome.
I get as far as being able to hear the headshot noises in game but no marker shows up.

If i need to post files etc please let me know.
Title: Re: [Script] Hitmarkers
Post by: Sithy on May 10, 2015, 05:50:12 am
Alright got the hitmarkers to work, the only thing that isnt working now is the body hit noises from MP
Title: Re: [Script] Hitmarkers
Post by: alaurenc9 on May 11, 2015, 02:25:06 am
First of all, i added this to my map and hit the sound limit.
I had to rename the files and in mod.csv change all_mp to all_sp
The headshot sound works but not the normal impaact sound.
I had to make my own sound alias and find my own sound
And now everything works
Title: Re: [Script] Hitmarkers (Updated)
Post by: MZslayer11 on May 12, 2015, 12:53:19 am
OP finally updated with the new script. Thanks again PROxFTW for your awesome work ;)
Title: Re: [Script] Hitmarkers (Updated)
Post by: DamianoTBM on May 30, 2015, 04:24:33 pm
 I hear the sound of hitmarker (only headshots) but I do not see the sign
Title: Re: [Script] Hitmarkers (Updated)
Post by: JerTesticleman on August 13, 2015, 01:27:56 am
In the top left corner, i see the damage indicator when i kill a zombies like when i finish a zombie off in the chest it says

zombie_torso

same with the other limbs

zombie_left arm
zombie_right arm

and so on, its really annoying bro
Title: Re: [Script] Hitmarkers (Updated)
Post by: MZslayer11 on August 17, 2015, 06:25:42 pm
In the top left corner, i see the damage indicator when i kill a zombies like when i finish a zombie off in the chest it says

zombie_torso

same with the other limbs

zombie_left arm
zombie_right arm

and so on, its really annoying bro

Are you using Harry Bo21's perks? The text in the top left corner is probably leftover from his scripts because I experienced the same thing from using his perks. This is an easy fix.
Title: Re: [Script] Hitmarkers (Updated)
Post by: Harry Bo21 on August 17, 2015, 08:39:37 pm
Are you using Harry Bo21's perks? The text in the top left corner is probably leftover from his scripts because I experienced the same thing from using his perks. This is an easy fix.
i really should get around to updating that, as literally no one seems to be able to go comment the one line that causes that...
Title: Re: [Script] Hitmarkers (Updated)
Post by: Marsvinking on August 21, 2015, 01:44:12 pm
Works Like a Charm
Title: Re: [Script] Hitmarkers (Updated)
Post by: RCunbeatable on November 09, 2017, 04:21:31 pm
Im still confused how do you get the mod working (into the mods folder in the correct way)?
Title: Re: [Script] Hitmarkers (Updated)
Post by: OwenC on January 13, 2018, 04:52:26 pm
Thanks for sharing this  8)
Title: Re: [Script] Hitmarkers (Updated)
Post by: Fancygamer1738 on March 25, 2018, 07:57:58 pm
Thanks for the tutorial! Really love hitmarkers and my map wouldn't feel the same without 'em.  :nyan: :rainbow: