After endless testing and help from the forums, I have found the correct way to do blockers and fix the 'Undefined is not an array index' error. Thanks to all those who have helped with this stuff.
script_model
1) Create a script_model and choose a model that you want it to be. I am using static_berlin_couch.
2) Press 'N' to open the Entity window. Type the following KVPs ("key" "value")
"script_linkto" "1"
"script_noteworthy" "jiggle"
"targetname" "couch1"
"spawnflags" "1"
script_struct
1) Create a script_struct where you want the couch to move to.
2) Press 'N' to open the Entity window. Type the following KVPs ("key" "value"):
"script_linkname" "1"
trigger_use
1) Create a trigger_use and place it by the couch, or where you want the person to be able to press the 'Use' key to buy the blocker.
2) Open the Entity window and type the following KVPs:
"script_flag" "" (yes, it is blank, this fixes the 'Undefined is not an array index' error)
"target" "couch"
"zombie_cost" "1000" (or any other price defined, otherwise you will have to define it yourself in one of the files)
"targetname" "zombie_debris"
nazi_zombie_YOURMAP.gsc
Code:
#include common_scripts\utility;
#include maps\_utility;
main()
{
level thread maps\_callbacksetup::SetupCallbacks();
include_weapons();
include_powerups();
maps\nazi_zombie_YOURMAP_fx::main();
maps\_zombiemode::main();
init_sounds();
// If you want to modify/add to the weapons table, please copy over the _zombiemode_weapons init_weapons() and paste it here.
// I recommend putting it in it's own function...
// If not a MOD, you may need to provide new localized strings to reflect the proper cost.
}
init_sounds()
{
maps\_zombiemode_utility::add_sound( "break_stone", "break_stone" );
}
// Include the weapons that are only inr your level so that the cost/hints are accurate
// Also adds these weapons to the random treasure chest.
include_weapons()
{
// Pistols
//include_weapon( "colt" );
//include_weapon( "colt_dirty_harry" );
//include_weapon( "walther" );
include_weapon( "sw_357" );
// Semi Auto
include_weapon( "m1carbine" );
include_weapon( "m1garand" );
include_weapon( "gewehr43" );
// Full Auto
include_weapon( "stg44" );
include_weapon( "thompson" );
include_weapon( "mp40" );
// Bolt Action
include_weapon( "kar98k" );
include_weapon( "springfield" );
// Scoped
include_weapon( "ptrs41_zombie" );
include_weapon( "kar98k_scoped_zombie" );
// Grenade
include_weapon( "molotov" );
// JESSE: lets go all german grenades for consistency and to reduce annoyance factor
// include_weapon( "fraggrenade" );
include_weapon( "stielhandgranate" );
// Grenade Launcher
include_weapon( "m1garand_gl" );
include_weapon( "m7_launcher" );
// Flamethrower
include_weapon( "m2_flamethrower_zombie" );
// Shotgun
include_weapon( "doublebarrel" );
include_weapon( "doublebarrel_sawed_grip" );
include_weapon( "shotgun" );
// Bipod
include_weapon( "fg42_bipod" );
include_weapon( "mg42_bipod" );
include_weapon( "30cal_bipod" );
// Heavy MG
include_weapon( "bar" );
// Rocket Launcher
include_weapon( "panzerschrek" );
// Special
include_weapon( "ray_gun" );
}
include_powerups()
{
include_powerup( "nuke" );
include_powerup( "insta_kill" );
include_powerup( "double_points" );
include_powerup( "full_ammo" );
}
include_weapon( weapon_name )
{
maps\_zombiemode_weapons::include_zombie_weapon( weapon_name );
}
include_powerup( powerup_name )
{
maps\_zombiemode_powerups::include_zombie_powerup( powerup_name );
}
nazi_zombie_YOURMAP_fx.gsc
Code:
#include maps\_utility;
#include common_scripts\utility;
main()
{
scriptedFX();
footsteps();
}
footsteps()
{
animscripts\utility::setFootstepEffect( "asphalt", LoadFx( "bio/player/fx_footstep_dust" ) );
animscripts\utility::setFootstepEffect( "brick", LoadFx( "bio/player/fx_footstep_dust" ) );
animscripts\utility::setFootstepEffect( "carpet", LoadFx( "bio/player/fx_footstep_dust" ) );
animscripts\utility::setFootstepEffect( "cloth", LoadFx( "bio/player/fx_footstep_dust" ) );
animscripts\utility::setFootstepEffect( "concrete", LoadFx( "bio/player/fx_footstep_dust" ) );
animscripts\utility::setFootstepEffect( "dirt", LoadFx( "bio/player/fx_footstep_sand" ) );
animscripts\utility::setFootstepEffect( "foliage", LoadFx( "bio/player/fx_footstep_dust" ) );
animscripts\utility::setFootstepEffect( "gravel", LoadFx( "bio/player/fx_footstep_sand" ) );
animscripts\utility::setFootstepEffect( "grass", LoadFx( "bio/player/fx_footstep_sand" ) );
animscripts\utility::setFootstepEffect( "ice", LoadFx( "bio/player/fx_footstep_snow" ) );
animscripts\utility::setFootstepEffect( "metal", LoadFx( "bio/player/fx_footstep_dust" ) );
animscripts\utility::setFootstepEffect( "mud", LoadFx( "bio/player/fx_footstep_mud" ) );
animscripts\utility::setFootstepEffect( "paper", LoadFx( "bio/player/fx_footstep_dust" ) );
animscripts\utility::setFootstepEffect( "plaster", LoadFx( "bio/player/fx_footstep_dust" ) );
animscripts\utility::setFootstepEffect( "rock", LoadFx( "bio/player/fx_footstep_sand" ) );
animscripts\utility::setFootstepEffect( "sand", LoadFx( "bio/player/fx_footstep_sand" ) );
animscripts\utility::setFootstepEffect( "snow", LoadFx( "bio/player/fx_footstep_snow" ) );
animscripts\utility::setFootstepEffect( "water", LoadFx( "bio/player/fx_footstep_water" ) );
animscripts\utility::setFootstepEffect( "wood", LoadFx( "bio/player/fx_footstep_dust" ) );
}
scriptedFX()
{
level._effect["large_ceiling_dust"] = LoadFx( "env/dirt/fx_dust_ceiling_impact_lg_mdbrown" );
level._effect["poltergeist"] = LoadFx( "misc/fx_zombie_couch_effect" );
}
The steps above work for me. Let me know of any issues!