You don't need to include anything extra in your GSC file to deduct points, assuming the rest of your code works (buyable max ammo function) try the following instead:
Code Snippet
Plaintext
player maps\_zombiemode_score::minus_to_player_score(trigger1cost);
Make sure you also have the following at the top of your GSC file:
If that doesn't work because of the structure of your mod, use the Tom FastFile Extractor to get a copy of _zombiemode_score.gsc from common_zombie_patch.ff and use that GSC file in your mod, the same way you'd use others.
Last Edit: December 03, 2023, 09:33:26 pm by ReubenUKGB
You don't need to include anything extra in your GSC file to deduct points, assuming the rest of your code works (buyable max ammo function) try the following instead:
Code Snippet
Plaintext
player maps\_zombiemode_score::minus_to_player_score(trigger1cost);
Make sure you also have the following at the top of your GSC file:
If that doesn't work because of the structure of your mod, use the Tom FastFile Extractor to get a copy of _zombiemode_score.gsc from common_zombie_patch.ff and use that GSC file in your mod, the same way you'd use others.
thank you very much!it works, I replaced the line with the one you wrote,(player cards \ _zombie mode_score::minus_to_player_score (trigger1cost) I'll even record a video guide for buying the maximum amount of ammunition for the BO1 but how do I made that there is some kind of sound when buying?I buy ammunition, but at this time there is no sound, silence
Last Edit: December 06, 2023, 10:33:43 am by Дмитрий78
Double Post Merge: December 06, 2023, 10:24:19 am thank you very much!it works, I replaced the line with the one you wrote,(player cards \ _zombie mode_score::minus_to_player_score (trigger1cost) I'll even record a video guide for buying the maximum amount of ammunition for the BO1 but how do I made that there is some kind of sound when buying?I buy ammunition, but at this time there is no sound, silence
You can add the following to introduce sound to your buy function:
Code Snippet
Plaintext
if (player.score >= trigger1cost) { player maps\_zombiemode_score::minus_to_player_score(trigger1cost); play_sound_at_pos("purchase", self.origin); } else { play_sound_at_pos("no_purchase", self.origin); }
This plays predone sounds in the game's soundalias at the position of self.origin, exactly the way Treyarch does it if you look at their source files, you can customise which origin it plays at but in this code it plays from self's origin. You can also customise the sound that's played by editing your own soundalias in your mod, using purchase and no_purchase as a base and replacing it with something else (make sure to edit the custom sound to work in-engine if you go this route).
Last Edit: December 06, 2023, 03:01:47 pm by ReubenUKGB
You can add the following to introduce sound to your buy function:
Code Snippet
Plaintext
if (player.score >= trigger1cost) { player maps\_zombiemode_score::minus_to_player_score(trigger1cost); play_sound_at_pos("purchase", self.origin); } else { play_sound_at_pos("no_purchase", self.origin); }
This plays predone sounds in the game's soundalias at the position of self.origin, exactly the way Treyarch does it if you look at their source files, you can customise which origin it plays at but in this code it plays from self's origin. You can also customise the sound that's played by editing your own soundalias in your mod, using purchase and no_purchase as a base and replacing it with something else (make sure to edit the custom sound to work in-engine if you go this route).
Assuming the soundalias name is valid, such as purchase and no_purchase.
that's it, I did it, I added two lines-play_sound_at_pos( "purchase", player.origin ); and play_sound_at_pos( "no_purchase", player.origin ); I don't understand what the treyarch source files had to do with it
Last Edit: December 06, 2023, 05:50:22 pm by Дмитрий78
I don't understand, where should I look?you're talking about Treyarch, which Treyarch source files are you talking about?
Double Post Merge: December 06, 2023, 05:04:11 pm that's it, I did it, I added two lines-play_sound_at_pos( "purchase", player.origin ); and play_sound_at_pos( "no_purchase", player.origin ); I don't understand what the treyarch source files had to do with it
I was suggesting to have a look at the default .gsc files for reference.
I wouldn't play the sound on the player, I'd play the sound on the entity being interacted with, so in this case it would be trigger.origin.