.GSC Scripts for Zombies Only
-
I'm having a problem with GSC scripts. I have created and been simply running scripts through the Plutonium\storage\t5\scripts folder. The scripts work fine and everything, it is just the problem is I am trying to figure out how I can get certain scripts to only load for zombies. I know that for T6, you create a sub-folder called "zm" and put them in there. However, when I do that same process for T5, the scripts are never executed. The main reason why this is a problem is because when the game loads the front end (main menu), by my understanding, when the script attempts to compile, it can't read a function such as "give_perk" from "maps/_zombiemode_perks" because the front end fast file does not have that script, resulting in a crash. I have tried putting the scripts into "sp/zom", but with no success. Any help with this would be greatly appreciated!
Here is one of the scripts that I have created, which puts my issue onto display. It simply gives a player juggernog for free when they spawn. The script works fine if you put it into the scripts folder AFTER loading the game, and then boot into a zombies map. But upon going to the main menu, the game will crash, because it can't find the script "maps/_zombiemode_perks":
#include common_scripts\utility; #include maps\_utility; init() { if (GetDvarInt("zombiemode") == 0 || !IsSubStr(level.script, "zombie_") || isdefined(level.zombietron_mode)) { return; } flag_init("initial_blackscreen_passed"); level thread on_player_connect(); level thread on_fade_in_complete(); } on_player_connect() { for (;;) { level waittill("connecting", player); player thread on_player_spawned(); } } on_player_spawned() { self endon("disconnect"); level endon("end_game"); for (;;) { self waittill("spawned_player"); self thread give_free_juggernog(); } } give_free_juggernog() { self notify("end_give_free_juggernog"); self endon("end_give_free_juggernog"); self endon("death"); self endon("disconnect"); self endon("player_downed"); level endon("end_game"); flag_wait("initial_blackscreen_passed"); if (is_juggernog_active() && !self HasPerk("specialty_armorvest")) { self maps\_zombiemode_perks::give_perk("specialty_armorvest", false); } } on_fade_in_complete() { level endon("end_game"); level waittill("fade_in_complete"); flag_set("initial_blackscreen_passed"); } is_juggernog_active() { vending_triggers = GetEntArray("zombie_vending", "targetname"); for (i = 0; i < vending_triggers.size; i++) { perk = vending_triggers[i].script_noteworthy; if (perk == "specialty_armorvest") { return true; } } return false; } -
there should be a scripts/sp/zom folder, and you can put your zombie only scripts in there
-
there should be a scripts/sp/zom folder, and you can put your zombie only scripts in there
FragsAreUs As I said in my post, I have already tried that, and the scripts are never executed unfortunately. The only one that gets executed is the one in there, called "zm_spawn_fix.gsc", which I believe Plutonium adds automatically.
-
For me sp/zom folder scripts only load on server. For now best option for me has been file replace with maps folder.
-
FragsAreUs As I said in my post, I have already tried that, and the scripts are never executed unfortunately. The only one that gets executed is the one in there, called "zm_spawn_fix.gsc", which I believe Plutonium adds automatically.
Gremulock change your init to main and they should load
-
For me sp/zom folder scripts only load on server. For now best option for me has been file replace with maps folder.
@dontknowletsplay FragsAreUs Thanks for the help guys, I appreciate it!
-
Gremulock change your init to main and they should load
FragsAreUs Could you explain what you mean by your comment?
I don't understand "change your init to main and they should load"
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login