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'"
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" ); } }
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" ); } }
I'm not sure you can currently give the player ragnarok dg4's in the beta.
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