“For me, I am driven by two main philosophies: know more today about the world than I knew yesterday and lessen the suffering of others. You'd be surprised how far that gets you.”
It looks like the nuke will go off every 10 seconds when the player is downed? Unless I am mistaken.
You could just add to zombiemode.gsc where it puts the player in laststand to check for the perk and thread a function if they have it, one and done.
In player_damage_override function (between the laststand and the fake death calls) or in the player_fake_death function you could find a place to put:
It looks like the nuke will go off every 10 seconds when the player is downed? Unless I am mistaken.
I was thinking about this as well and forgot one key thing, even though I was thinking about this also. You wont have perk anymore, when you go down, so if perk gets unset after going down, then it would work. If they both happen at same time, it wont work. Your way probs would work, for mine I didnt want to guide him in new script
I was thinking about this as well and forgot one key thing, even though I was thinking about this also. You wont have perk anymore, when you go down, so if perk gets unset after going down, then it would work. If they both happen at same time, it wont work. Your way probs would work, for mine I didnt want to guide him in new script
The perk is unset on the notify in the player_fake_death function, which the OP will need to make sure the if statement is placed before the notify, so threading it in the player_fake_death function above the notify should prob be best for that method. He could use the while loop and figure out something with that wait issue and it wouldn't matter I guess. Which ever function/method he goes with, I would not suggest going with a while loop or repeating the same function again.
Should the rest of the code bne put into the Player_fake_death function? Or should it also be put into _zombiemode_perks?
You weren't quoting me, but I wondered this when you first posted... Did you take care of the perk machine already? Cause that is done in zombiemode_perks, but the reward, if you will, for the perk can be done anywhere its applicable.
I used ZKs tutorial to change things like shader, hintstring, and all that. I just needed to know where the perk function itself went. I did what Hitman said and when i get in game the perk machine only says "power must be activate fist" which im guessing is something that i did wrong on my part.
I used ZKs tutorial to change things like shader, hintstring, and all that. I just needed to know where the perk function itself went. I did what Hitman said and when i get in game the perk machine only says "power must be activate fist" which im guessing is something that i did wrong on my part.
yeah, that has nothing to do with anything in this post. That has to do with the perk script for the machine. Once that is resolved, you buy the perk, and get the shader, you will then be ready to test whatever you did in this thread.
That is kind of why i made this post, everything IS set up now. The machine, the triggers, the perk. My only problem is that it says the power isnt active even though it is, and i followed ZKs tutorial to the teet. Its likely that the files have changed over the years and things have changed but that is what im asking.
That is kind of why i made this post, everything IS set up now. The machine, the triggers, the perk. My only problem is that it says the power isnt active even though it is, and i followed ZKs tutorial to the teet. Its likely that the files have changed over the years and things have changed but that is what im asking.
Well, there are two sides to every swartz, lol. The part you posted is the part that handles what to do once the player has the perk. The part your having issues with right now is the perk machine part. It's waiting for the perk on notify, and something had a typo or wasn't set up for that. There are several easy fixes. If you post your perks script, it should be an easy fix.
Well it would have been a simple fix if you would have posted the entire perks script... maybe. I'm gonna make some assumptions like you have the thread in a good place, and your other perks are working, and your vending_trigger_think is thread on all the triggers with the kvp targetname>zombie_vending, since your getting the power hint. I will also assume your kvps for your machines are targetname>push_machine, although that wouldn't affect your hint or your ability to buy it. Do you see your turn_push_on() function? It's notifying to the vending_trigger_think function, which you didn't include for me to see if it was setup right. It looks right. In the vending_trigger_think function you will find something like this:
That may work but doesn't really solve your issue your having. If it does work, then there could be a typo in your script_noteworthy kvp in radiant. A screen shot always helps troubleshooting better than retyping it.
Your notifying "specialty_boost_power_on" in your script, so from what I see you can try a few things to isolate this issue. Add iprintln("what is happening"); after different areas. Add one before level waittill("sleight_on"); (which you may a not see) then one after it. You may want to print the script_noteworthy as well, and check for typos.
Also, once you get this fixed, you could still have issues with the specialty. Here is a list of all specialties, and I have a ? next to this specialty for some reason. I don't remember the reason, but it seems questionable to me. So you may want to try a different specialty. (you can ignore the stuff after the : its just what I use them for)
Code Snippet
Plaintext
/* SPECIALTIES: *specialty_armorvest: Juggernaut *specialty_bulletaccuracy: DeadShot *specialty_detectexplosive: PHD *specialty_extraammo: Mule Kick *specialty_fastreload: Speed Cola *specialty_fireproof: ZMP *specialty_gpsjammer: shocknade *specialty_longersprint: Staminup *specialty_quickrevive: Quick Revive with solo qr *specialty_rof: Double tap *specialty_shades: Elecric Cherry *specialty_twoprimaries: DoubleMag specialty_boost: ? specialty_bulletdamage: Stopping Power specialty_bulletpenetration: Deep Impact specialty_explosivedamage: Fireworks - like sonic boom in COD4 specialty_gas_mask: Reduces the effects of gas grenade attacks specialty_grenadepulldeath: Martyrdom specialty_holdbreath: Iron lungs specialty_leadfoot: Increase tank's drive speed specialty_ordinance: Faster firing main tank gun specialty_pin_back: Toss back - resets timer on throwing back grenades specialty_pistoldeath: Last stand specialty_quieter: Dead Silence specialty_specialgrenade: Specials Grenades x 3 specialty_water_cooled: Slows the overheating of tank guns X-specialty_doublegrenade: (Doesn't work) X-specialty_flak_jacket: (Doesn't work) X-specialty_greased_bearings: (Doesn't work) X-specialty_recon: (Doesn't work) X-specialty_weapon_betty: (Doesn't work) X-specialty_weapon_flamethrower: (Doesn't work) X-specialty_weapon_rpg: (Doesn't work) X-specialty_weapon_satchel: (Doesn't work) */
i think most perks systems use "specialty_boost" for electric cherry specialty_boost works but you should change it to something different or you will most likely run into problems if using cherry. I made a custom perk and specialty_leadfoot works so maybe try that one or try 1 from the list that Mcents gave you.
all game constantly checking all players for perk is really not needed. you should do something more like what cents told you. only thing with that is all players are going to get 400 points when player goes down but thats an easy fix if you dont want that.
Last Edit: May 26, 2016, 10:57:00 pm by thezombieproject
Okay so i changed my perk to Leadfoot, and added the script to the power. Now when ever i launch my map it looks like im about to spawn (Process bar vaishes after full) and the game crashes. Heres the code for my _zombiemode_perks:
// PI_CHANGE_BEGIN // JMA - in order to have multiple Pack-A-Punch machines in a map we're going to have // to run a thread on each on. // NOTE: In the .map, you'll have to make sure that each Pack-A-Punch machine has a unique targetname turn_PackAPunch_on() { level waittill("Pack_A_Punch_on");
if ( cheat != true ) { //player iprintln( "Already using Perk: " + perk ); self playsound("deny"); player thread play_no_money_perk_dialog();
continue; } }
if ( player.score < cost ) { //player iprintln( "Not enough points to buy Perk: " + perk ); self playsound("deny"); player thread play_no_money_perk_dialog(); continue; }
sound = "bottle_dispense3d"; player achievement_notify( "perk_used" ); playsoundatposition(sound, self.origin); player maps\_zombiemode_score::minus_to_player_score( cost ); ///bottle_dispense switch( perk ) { case "specialty_armorvest": sound = "mx_jugger_sting"; break;
case "specialty_quickrevive": sound = "mx_revive_sting"; break;
case "specialty_fastreload": sound = "mx_speed_sting"; break;
case "specialty_rof": sound = "mx_doubletap_sting"; break;
default: sound = "mx_jugger_sting"; break; }
self thread play_vendor_stings(sound);
// self waittill("sound_done");
// do the drink animation gun = player perk_give_bottle_begin( perk ); player.is_drinking = 1; player waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );
// restore player controls and movement player perk_give_bottle_end( gun, perk ); player.is_drinking = undefined; // TODO: race condition? if ( player maps\_laststand::player_is_in_laststand() ) { continue; }
player SetPerk( perk ); player thread perk_vo(perk); player setblur( 4, 0.1 ); wait(0.1); player setblur(0, 0.1); //earthquake (0.4, 0.2, self.origin, 100); if(perk == "specialty_armorvest") { player.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"]; player.health = level.zombie_vars["zombie_perk_juggernaut_health"]; //player.health = 160; }
player perk_hud_create( perk );
//stat tracking player.stats["perks"]++;
//player iprintln( "Bought Perk: " + perk ); bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type perk", player.playername, player.score, level.round_number, cost, perk, self.origin );
player thread perk_think( perk );
} } play_no_money_perk_dialog() {
index = maps\_zombiemode_weapons::get_player_index(self);
dist = 128 * 128; while(true) { players = get_players(); for( i = 0; i < players.size; i++ ) { if(DistanceSquared( players[i].origin, self.origin ) < dist) { if(!players[i] hasperk(perk) && !(players[i] in_revive_trigger()) && (players[i].perk_hud.size < level.perk_limit) && self.reviveUsesLeft > 0) { //PI CHANGE: this change makes it so that if there are multiple players within the trigger for the perk machine, the hint string is still // visible to all of them, rather than the last player this check is done for if (IsDefined(level.script) && level.script == "nazi_zombie_theater") self setinvisibletoplayer(players[i], false); else self setvisibletoplayer(players[i]); //END PI CHANGE //iprintlnbold("turn it off to player");
//TUEY We need to eventually store the dialog in an array so you can add multiple variants...but we only have 1 now anyway. switch(type) { case "specialty_armorvest": sound_to_play = "vox_perk_jugga_0"; break; case "specialty_fastreload": sound_to_play = "vox_perk_speed_0"; break; case "specialty_quickrevive": sound_to_play = "vox_perk_revive_0"; break; case "specialty_rof": sound_to_play = "vox_perk_doubletap_0"; break; default: sound_to_play = "vox_perk_jugga_0"; break; }
wait(1.0); self maps\_zombiemode_spawner::do_player_playdialog(player_index, sound_to_play, 0.25); } machine_watcher() { //PI ESM - support for two level switches for Factory if (isDefined(level.DLC3.perksNeedPowerOn) && level.DLC3.perksNeedPowerOn) { level thread machine_watcher_factory("juggernog_on"); level thread machine_watcher_factory("sleight_on"); level thread machine_watcher_factory("doubletap_on"); level thread machine_watcher_factory("revive_on"); level thread machine_watcher_factory("Pack_A_Punch_on"); } else { level waittill("master_switch_activated"); //array_thread(getentarray( "zombie_vending", "targetname" ), ::perks_a_cola_jingle);
}
}
//PI ESM - added for support for two switches in factory machine_watcher_factory(vending_name) { level waittill(vending_name); switch(vending_name) { case "juggernog_on": temp_script_sound = "mx_jugger_jingle"; break;
case "sleight_on": temp_script_sound = "mx_speed_jingle"; break;
case "doubletap_on": temp_script_sound = "mx_doubletap_jingle"; break;
case "revive_on": temp_script_sound = "mx_revive_jingle"; break;
case "Pack_A_Punch_on": temp_script_sound = "mx_packa_jingle"; break;