How do I go about this? I know what file the game looks at for gun prices but I have no idea how to make the custom map read from my own edited version of that file. Any help would be nice. Thanks guys!
I have copied the zm_levelcommon_weapons.csv file into my custom map's scripts file. I have added this line of code to the map file's zone file (zm_tutorial.zone):
******************************************************************************** UNRECOVERABLE ERROR: ^1SCRIPT ERROR: No generated data for 'scripts/zm/zm_levelcommon_weapons.csv'
Linker will now terminate. ********************************************************************************
The lighting in my map seems to be doing some weird things, as you can see in the picture below. Not sure what is causing this. I've been trying to fix it for a while but nothing I do seems to be working. Any ideas on how to fix this?
No idea how to do this, just curious on how to replace the starting MR6 in the mod tools!
Also, if anyone knows how, how would I go about including the Marshal 16's in my map, maybe even replacing this starting pistol? Any help would be much appreciated, thanks!
Hi, just wondering how to replace the starting pistol with the Marshal 16's. I know they aren't in the beta, but is there some way to import them into the mod files so that I can replace the MR6? Also, no idea how I would replace the MR6, that might help too XD
I'm not sure you can currently give the player ragnarok dg4's in the beta.
Okay cool, but can you see what I'm doing wrong in my code? Thanks for the help again man, really appreciate it, just really new to scirpting/the mod tools XD
Do you have _zm_perks.gsc included at the top of the file like this?:
Code Snippet
Plaintext
#using scripts\zm\_zm_perks;
also change it from _zm_perks:: to zm_perks::
Here, could you take a look at my code? Not quite sure what's wrong. Also, what code would I need to do in order to have it say, give the player the Ragnarok DG4's instead? My map's name is zm_tutorial, and this is in the zm_tutorial.gsc file.
// Allows you to add your own code to execute when a player spawns, without having to directly edit the function in _globallogic_player callback::on_spawned( &on_player_spawned );
// Searches the map for triggers and threads the logic function for them, assigning an id as well level.shootable_triggers = getEntArray( "ec_perk_trigger", "targetname" ); if( isDefined( level.shootable_triggers ) ) { id = 0; foreach( trigger in level.shootable_triggers ) { trigger thread shootable_trigger_think(id); id++; } } }
function usermap_test_zone_init() { level flag::init( "always_on" ); level flag::set( "always_on" ); // Your code here, depends on if you have zones setup /* zm_zonemgr::add_adjacent_zone( "start_zone", "zone_2", "zone_1_to_2_trigger" ); zm_zonemgr::add_adjacent_zone( "zone_2", "zone_4", "zone_2_to_4_trigger" ); zm_zonemgr::add_adjacent_zone( "zone_2", "zone_6", "zone_2_to_6_trigger" ); zm_zonemgr::add_adjacent_zone( "zone_2", "zone_3", "zone_2_to_3_trigger" ); zm_zonemgr::add_adjacent_zone( "zone_3", "zone_6", "zone_3_to_6_trigger" ); zm_zonemgr::add_adjacent_zone( "zone_2", "zone_5", "zone_2_to_5_trigger" ); */ }
function custom_add_weapons() { zm_weapons::load_weapon_spec_from_table("gamedata/weapons/zm/zm_levelcommon_weapons.csv", 1); }
function on_player_spawned() { self notify( "shootable_trigger_destroy" );
self.shootable_triggers_shot = 0;
// Used so multiple players can do the process, rather than tying progress to the teddies self.shootable_triggers_personal = []; for( i = 0; i < level.shootable_triggers_personal.size; i++ ) { self.shootable_triggers_personal[i] = false; } }
function shootable_trigger_think( id ) { while(1) { self waittill( "damage", amount, attacker, directionVec, point, type );
// They have hit every teddy if( count >= level.shootable_triggers.size ) { // Adds the perk, but doesn't handle the HUD part self zm_perks::give_perk( "marathon_perk" ); } }
In my custom map I have three teddy bears that, when shot, give the player the electric cherry perk. I have the script mostly working for this thanks to Xylozi, but near the end of the script, I have the code
However, I get an error when building/linking that says this: "^1ERR(6E) scripts/zm/zm_tutorial.gsc (155,1) : Compiler Internal Error : Unresolved external '_zm_perks::give_perk'"
// Allows you to add your own code to execute when a player spawns, without having to directly edit the function in _globallogic_player callback::on_spawned( &on_player_spawned );
// Searches the map for triggers and threads the logic function for them, assigning an id as well level.shootable_triggers = getEntArray( "shootable_trigger", "targetname" ); if( isDefined( level.shootable_triggers ) ) { id = 0; foreach( trigger in level.shootable_triggers ) { trigger thread shootable_trigger_think(id); id++; } } }
function usermap_test_zone_init() { // Your code here, depends on if you have zones setup /* zm_zonemgr::add_adjacent_zone( "start_zone", "zone_2", "zone_1_to_2_trigger" ); zm_zonemgr::add_adjacent_zone( "zone_2", "zone_4", "zone_2_to_4_trigger" ); zm_zonemgr::add_adjacent_zone( "zone_2", "zone_6", "zone_2_to_6_trigger" ); zm_zonemgr::add_adjacent_zone( "zone_2", "zone_3", "zone_2_to_3_trigger" ); zm_zonemgr::add_adjacent_zone( "zone_3", "zone_6", "zone_3_to_6_trigger" ); zm_zonemgr::add_adjacent_zone( "zone_2", "zone_5", "zone_2_to_5_trigger" ); */ }
function custom_add_weapons() { zm_weapons::load_weapon_spec_from_table("gamedata/weapons/zm/zm_levelcommon_weapons.csv", 1); }
function on_player_spawned() { self notify( "shootable_trigger_destroy" );
self.shootable_triggers_shot = 0;
// Used so multiple players can do the process, rather than tying progress to the teddies self.shootable_triggers_personal = []; for( i = 0; i < level.shootable_triggers_personal.size; i++ ) { self.shootable_triggers_personal[i] = false; } }
function shootable_trigger_think( id ) { while(1) { self waittill( "damage", amount, attacker, directionVec, point, type );
// They have hit every teddy if( count >= level.shootable_triggers.size ) { // Adds the perk, but doesn't handle the HUD part self _zm_perks::give_perk( "marathon_perk" ); } }
Okay cool, thanks again for the help!
However, when I ad the #using command for the _zm_perks script, it still gives me that same error when linking. It says that unresolved external thing for the command "_zm_perks::give_perk"
EDIT: When implementing this into the the mapname.gsc file, I get two errors: one that happens when I load the map, the map crashes and this error is given: "Error during initialization: attempting to PMem_Free 'PerLocalClient' but it is not at the top of the stack".
I also get an error when building/linking that says this: "^1ERR(6E) scripts/zm/zm_tutorial.gsc (155,1) : Compiler Internal Error : Unresolved external '_zm_perks::give_perk'"
1. Would need to export the machine from BO2 and make the prefab yourself 2. BO3 doesnt have machine for EC, so there is no hintstring setup for it, cos its only in Wunderfizz. Just replace &"ZOMBIE_PERK_WIDOWSWINE" with "Hold ^3[{+activate}]^7 to Buy Electric Cherry [Cost: 2000]"
Becuase I'm kind of a newb here, would you be able to explain to me or send me a link of how to export the machine from BO2 and make the prefab? Also, is there a way that I could make the hintstring for EC? I just would like to see the EC code in as close to the same format as the rest of the perks, but thanks again so much! That actually really helped!
This should be pretty simple for you to implement. What you'll need to do is setup some trigger_damage brushes around the teddy bear models and monitor when players shoot them.
Here is code that will do that for you:
In the main function add:
Code Snippet
Plaintext
callback::on_spawned( &on_player_spawned );
This will allow you to use on_player_spawned within your file.
And this, which checks your map for any triggers with the "teddy_trigger" targetname and sets up the logic for them:
Add the on_player_spawned function. This sets a variable to monitor how many teddies the player has shot, and ties the not shot/shot state to the player, meaning progress towards the perk is personal for each player.
Code Snippet
Plaintext
function on_player_spawned() { self notify( "teddy_check" );
self.teddy_triggered_count = 0;
// Used so multiple players can do the process, rather than tying progress to the teddies self.teddy_states = []; for( i = 0; i < level.teddy_triggers.size; i++ ) { self.teddy_states[i] = false; } }
Add the logic for the teddy triggers:
Code Snippet
Plaintext
function teddy_think( id ) { while(1) { self waittill( "damage", amount, attacker, directionVec, point, type );
This monitors the trigger for any damage events, and once one happens, checks that it comes from player. If the player hasn't shot the teddy before, it will set that teddy to true for the player, and check the player's progress.
// They have hit every teddy if( count >= level.teddy_triggers.size ) { self _zm_perks::give_perk( "marathon_perk" ); } }
This is called when the player hits any of the teddies, so once they've hit all of them they will be granted the perk.
Thanks so much man! This is really detailed and I understand it very well. Just two questions for ya though: 1) Do I put this code in it's own script file? As in it's own .gsc, .csc or .gsh file? Or do I just put it in the mapname.gsc script inside of the map's script folder? 2) Would there be any way to make it check for a specific type of damage, for example, splash damage from a Widow's Wine grenade? If not that's cool, I'm happy with how it works already!
I'm very new to scripting and the mod tools in general. I have gotten a map somewhat developed and I think I want to start adding some Easter Egg stuff. What I am trying to do right now is have it so that when the player shoots the three teddy bears that I have around the map, they are given the Electric Cherry perk. I could have this just be another buyable perk, which is what I currently have, but I kind of want it to be an easter egg type thing.
Any ideas on how I would go about achieving this? Again, very new to scripting and the mod tools, so please try to be as specific as possible and try to talk like you would to a child
I'm not sure about electric cherry, will probably be similar to how you add widows wine.
EDIT: Adding electric cherry should be the exact same as adding widows wine just change the name for the scripts you are including and referencing.
However you may need to port a model from somewhere else since they might not have included the models for it.
Cool, thanks so much man! I got Widow's Wine working and Electric Cherry is buyable and I have made that work, but there are some things about it that don't quite work.
1) Where might I be able to find a model or prefab to port from black ops 2 into 3? 2) In the code for Widow's Wine, for Example, on line 63 of the GSC file, where is says &"ZOMBIE_PERK_WIDOWSWINE", this seems to be where the code is located to be able to make the perk machine in game have the "Hold (X/F) to Buy Widow's Wine [Cost: 4000]". There is code for this in the Electric Cherry GSC file, but in the same line of code (line 52 in the EC GSC), it says the same as Widow's Wine instead of for Electric Cherry.
So in my map, the model for EC is Stamin-Up, and the text that appears says "Hold (X/F) to Buy Widow's Wine" for 2,00 points (I changed this value in the EC GSC file). I would like to change that text to say "Hold (X/F) to Buy Electric Cherry [Cost: 2000]", but I don't know how to do that.