Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!Im not sure what I've done I may have deleted something accidentally but long story short I can compile and build the map but then I go to launch it on BO3 it crashed and gives me this error
****1 script error(s):
"D15f3cea" with no parameters in
"Scripts/zm/zm_mapname.gsc" at line 0****
****Unresolved external "D15f3cea" with 0 parameters in
"Scripts/zm/zm_mapname.gsc****
Can anyone tell me which this means
I am not confident of the code.
This is part_shader_logic code I touched.function part_shader_logic(shader, position, size_x, size_y){
hud = position - 1;
self.shader_var[hud] = NewClientHudElem(self);
self.shader_var[hud].alignX = "right";
self.shader_var[hud].alignY = "top";
self.shader_var[hud].horzAlign = "user_right";
self.shader_var[hud].vertAlign = "user_top";
if(self IsSplitScreen())
self.shader_var[hud].y = ((size_y * position) + 10) - 25;
else
self.shader_var[hud].y = ((size_y * position) + 10);
self.shader_var[hud].x = -5;
self.shader_var[hud] setShader(shader, size_x, size_y);
self waittill("power_crafted");
self waittill("pap_crafted");
foreach(shader in self.shader_var){
shader Destroy();
}
}
self waittill("pap_crafted")
player notify("pap_crafted")
self waittill("pap_crafted")
self.bombstopwatch Destroy();
So, you need to create your custom zombie in APE, there you can setup its life and strength, look about custom zombies in YouTube or some shit like that and hopefully you can setup this boss.
zombie.health = 1000;
switch(entity_num)
{
case 0;
perk = "zombie_perk_bottle_revive"; //The bottle & weapon have the same name, only 1 var needed.
hint = "revive soda";
break;
case 1;
perk = "zombie_perk_bottle_jug";
hint = "Juggernog";
break;
case 2;
perk = "zombie_perk_bottle_doubletap";
hint = "ze Root Beer";
break;
case 3;
perk = "zombie_perk_bottle_sleight";
hint = "Speed Cola";
break;
}
perk_bottle SetModel(perk);
level.w_trigger SetHintString("Press ^3&&1 ^7to get " + hint + "!");
self waittill("trigger", player);
player GiveWeapon(perk);
player SwitchToWeapon(perk);
wait(3);
player TakeWeapon(perk);
#using scripts\codescripts\struct;
#using scripts\shared\flag_shared;
#using scripts\shared\array_shared;
#using scripts\shared\util_shared;
#using scripts\shared\ai\zombie_utility;
#using scripts\zm\_zm_utility;
#using scripts\zm\_zm_score;
#using scripts\zm\_zm_unitrigger;
#using scripts\shared\math_shared;
#using scripts\zm\_zm_traps;
#using scripts\zm\_zm_weap_gravityspikes;
#using scripts\zm\_zm_spawner;
#using scripts\shared\hud_util_shared;
#using scripts\zm\_zm_powerups;
#using scripts\zm\crate_powerup_logic;
#using scripts\zm\vial_spawn;
#precache("fx", "custom/arch_robot_propulsion");
#precache("fx", "custom/arch_robot_laser");
//#precache("xanim", "arch_robot_anim_test");
//#precache("xanim", "arch_robot_dance");
//#precache("xanim", "arch_robot_hack_loop");
//#precache("xanim", "arch_robot_idle_passive");
//#precache("xanim", "arch_robot_idle");
#precache("xanim", "arch_robot_v7_idle");
#precache("xanim", "arch_robot_v7_combat_idle");
#precache("xanim", "arch_robot_v7_focus_atk");
#precache("xanim", "arch_robot_v7_laser_fire");
#precache("xanim", "arch_robot_v7_laser_aim_idle");
#precache("xmodel", "arch_robot_v7");
#precache("xmodel", "arch_robot_laser_gun");
#using_animtree("arch_drone_anims");
#namespace arch_drone_ai;
function init()
{
level flag::wait_till("all_players_connected");
level flag::init("inRadius", false);
level._effect["robot_propulsion"] = "custom/arch_robot_propulsion";
level._effect["robot_laser"] = "custom/arch_robot_laser";
trig = GetEnt("robot_test", "targetname");
trig SetCursorHint("HINT_NOICON");
trig SetHintString("Press &&1 to test anim");
trig thread follow();
}
function follow()
{
self waittill("trigger", player);
org = positionBot(player);
self.robot = Spawn("script_model", player.origin + org);
self.robot.angles = (0, -90, 0);
self.mover = Spawn("script_model", player.origin + org);
wait(0.2);
self.mover SetModel("tag_origin");
self.robot SetModel("arch_robot_v7");
self.robot EnableLinkTo();
self.robot LinkTo(self.mover, "tag_origin");
PlayFXOnTag(level._effect["robot_propulsion"], self.robot, "tag_origin");
self.robot.animState = "idle";
//self.robot SetScale(2.0);
self.robot UseAnimTree(#animtree);
wait(0.2);
tag = self.robot GetTagOrigin("tag_right_elbow");
self.robot.laser = Spawn("script_model", tag);
self.robot.laser SetModel("arch_robot_laser_gun");
self.robot.laser LinkTo(self.robot, "tag_right_elbow", (15, 0, 1.5), (0, -90, 0));
self.robot.laser Hide();
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_idle);
self thread robot_animState_watcher();
self thread robot_positioning_system(player);
while(1)
{
org = positionBot(player);
self.mover MoveTo(player.origin + org, .2);
wait(.2);
}
}
function positionBot(player)
{
//Forward and to the right of players view
f = AnglesToForward(player.angles) * 125;
org = AnglesToRight(player.angles) * 40 + (f + (0,0,75));
return org;
}
function robot_positioning_system(player)
{
while(1)
{
switch(self.robot.animState)
{
case "combat_idle":
case "focus_atk":
case "laser_atk":
//Decide robot's facing direction
zombies = GetAISpeciesArray("axis", "all");
closestZombie = ArrayGetClosest(self.mover.origin, zombies, 500);
//Target nearest enemy
tag = closestZombie GetTagOrigin("tag_eye");
vectorToFace = self.mover.origin - (tag[0], tag[1], tag[2] + 25);
//vectorToFace = self.mover.origin - (closestZombie.origin[0], closestZombie.origin[1], closestZombie.origin[2] + 120);
angle2Face = VectortoAngles(vectorToFace);
self.mover RotateTo((angle2Face[0], angle2Face[1] + 180, angle2Face[2]), .2);
break;
case "idle":
//If no zombies are in range, robot follows players direction
angles = player GetPlayerAngles();
self.mover RotateTo(angles, .2);
break;
}
wait(0.2);
}
}
function robot_animState_watcher()
{
while(1)
{
zombies = GetAISpeciesArray("axis", "all");
closest = ArrayGetClosest(self.robot.origin, zombies);
dist = Distance2D(self.robot.origin, closest.origin);
if(!isdefined(closest) || dist > 500 && self.robot.animState != "idle")
{
switch(self.robot.animState)
{
//void <entity> AnimScripted(<notify>,<origin>,<angles>,<animation>,[mode],[root],[rate],[blend],[lerp],[animation time],[is_scene_animation],[showPlayerWeaponInFirstPerson])
case "combat_idle":
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_idle, "normal", %arch_robot_v7_combat_idle, 1, 1, 1);
break;
case "focus_atk":
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_idle, "normal", %arch_robot_v7_laser_aim_idle, 1, .5, .5);
break;
case "laser_atk":
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_idle, "normal", %arch_robot_v7_laser_fire, 1, .5, .5);
break;
}
self.robot.animState = "idle";
}
if(isdefined(closest) && dist < 500 && dist > 200 && self.robot.animState != "combat_idle")
{
switch(self.robot.animState)
{
case "idle":
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_combat_idle, "normal", %arch_robot_v7_idle, 1, .5, .5);
break;
case "focus_atk":
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_combat_idle, "normal", %arch_robot_v7_laser_aim_idle, 1, .5, .5);
break;
case "laser_atk":
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_combat_idle, "normal", %arch_robot_v7_laser_fire, 1, .5, .5);
break;
}
self.robot.animState = "combat_idle";
}
if(isdefined(closest) && dist < 200 && dist > 50 && self.robot.animState != "focus_atk")
{
switch(self.robot.animState)
{
case "combat_idle":
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_laser_aim_idle, "normal", %arch_robot_v7_combat_idle, 1, .5, .5);
break;
case "idle":
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_laser_aim_idle, "normal", %arch_robot_v7_idle, 1, .5, .5);
break;
case "laser_atk":
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_laser_aim_idle, "normal", %arch_robot_v7_laser_fire, 1, .5, .5);
break;
}
self.robot.animState = "focus_atk";
self thread projectile_logic();
}
/*
if(isdefined(closest) && dist < 50 && self.robot.animState != "laser_atk")
{
switch(self.robot.animState)
{
case "combat_idle":
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_laser_fire, "normal", %arch_robot_v7_combat_idle, 2, .5, .5);
break;
case "idle":
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_laser_fire, "normal", %arch_robot_v7_idle, 2, .5, .5);
break;
case "focus_atk":
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_laser_fire, "normal", %arch_robot_v7_laser_aim_idle, 2, .5, .5);
break;
}
self.robot.animState = "laser_atk";
}
*/
wait(.5);
}
}
function projectile_logic()
{
self.robot.laser Show();
while(self.robot.animState == "focus_atk")
{
zombies = GetAIArray("axis", "all");
zombie = ArrayGetClosest(self.mover.origin, zombies);
//laserOrg = Spawn("script_model");
//laserOrg SetModel("tag_origin");
PlayFXOnTag(level._effect["robot_laser"], self.mover, "tag_origin");
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_laser_fire, "normal", %arch_robot_v7_laser_aim_idle, 2, .05, .05);
//self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_laser_fire);
//PlayFXOnTag(level._effect["robot_laser"], self.mover, "tag_origin");
/*traceArray = BulletTrace(self.mover.origin, (zombie.origin[0], zombie.origin[1], zombie.origin[2] + 100), true, self.robot);
foreach(val in traceArray)
{
IPrintLnBold(val);
}
*/
self.robot waittill("anim_done");
wait(0.5);
self.robot AnimScripted("anim_done", self.robot.origin, self.robot.angles, %arch_robot_v7_laser_aim_idle, "normal", %arch_robot_v7_laser_fire, 1, .2, .2);
wait(1);
if(self.robot.animState != "focus_atk")
{
break;
}
}
self.robot.laser Hide();
}
function robot_combat_logic()
{
//void <entity> DoDamage(<health>,<source position>,[attacker],[inflictor],[hitloc],[mod],[dflags],[weapon],[infdestructible_piece_indexlictor],[forcePain])
}
Hey guys,
I want to know if it is possible to attach a light to the players.
I want to put in my map a buildable flashlight or just a simple flashlight. who can be used like a weapons or the sheild.
Thanks for your help.
//This example counts 10 player slide actions, prints the total to the screen, then breaks out of the loop & ends the function.
function example_loop()
{
slides = 0;
max_slides = 10;
players = GetPlayers();
player = players[0];
while(1)
{
if(player isSliding())
{
slides++;
IPrintLnBold("[" + slides + "] Slides have been detected");
if(slides >= max_slides)
{
break;
}
}
wait(1);
}
}
//This ex. uses a for() loop, counts & prints the array of zombies alive. You don't need a break statement as 'i' counts up with zombies.size.
//Once 'i' is greater than zombies.size, then middle statement in the loop becomes false, breaking the loop.
function example_loop2()
{
zombies = GetAISpeciesArray("axis", "all");
for(i = 0; i < zombies.size; i++)
{
IPrintLnBold("[" + i + 1 + "] zombies have been detected");
}
}
//Or you could do
function example_loop3()
{
i = 0;
foreach(zombie in GetAISpeciesArray("axis", "all"))
{
IPrintLnBold("[" + i + 1 + "] zombies have been detected");
i++;
}
}
you can move an FX, but what you will want to do is use the function namedwhere 'id' is the FX id, ent is the script_model that you want to play the FX on, and tag is the model tag you where you want the FX attached.fx = playfxontag(id, ent, tag);
example:fx = PlayFxOnTag(level._effect["bouledefeu"], level.model, "tag_origin");
PS: if you ran it in developer mode you should have gotten an error saying "Type String is not an entity and cannot call EnableLinkTo"
Is it possible to move an fx, that we spawned or not?
This script spawn the model and the fx but doesn't move the fx:
function move_fx()
{
level flag::wait_till( "initial_blackscreen_passed" );
struct1 = struct::get("struct1","targetname");
level.model = spawn( "script_model", struct1.origin );
level.model SetModel( "p7_skulls_bones_head_02" );
level._effect["bouledefeu"] = "Symbo/test3";
PlayLoopedFX(level._effect["bouledefeu"], 1, struct1.origin);
level.model enablelinkto();
level._effect["bouledefeu"] linkto(level.model);
fx_trigger = GetEnt("fx_trigger", "targetname");
fx_trigger waittill("trigger", player);
level.model moveY(-338,2);
}
//First, you need to pre-cache your fx file before init(). (Certain fx are pre-cached by default, there is a list in the forums here)
#precache("fx", "Symbo/test3");
function init()
{
level flag::wait_till("initial_blackscreen_passed");
level._effect["bouledefeu"] = "Symbo/test3"; //Defining the fx
temp = struct::get("struct1", "targetname");
//In radiant, put a new struct where the skull moves to - name it "destination"
destination = struct::get("destination", "targetname");
skull = Spawn("script_model", temp.origin);
skull SetModel("p7_skulls_bones_head_02");
skull.destination = destination.origin;
temp Delete(); //If only using as an origin point - no longer needed
destination Delete();
fx_trigger = GetEnt("fx_trigger", "targetname");
fx_trigger waittill("trigger");
skull thread move_fx();
}
//level.model enablelinkto();
//level._effect["bouledefeu"] linkto(level.model);
//***You do not call EnableLinkTo() on the fx ^ or the model here. The fx in gsc is only a string pointing to the fx file,
//PlayFXOnTag() solves that, the fx will move with the model
function move_fx()
{
PlayFXOnTag(level._effect["bouledefeu"], self, "tag_origin");
//If you want to get fancy, you could make the skull look towards the destination point as it moves there
//I wrote an easy function for that at the bottom of the page
self face_target(self.destination);
//Then move it there
self MoveTo(self.destination, 2);
//If feeling extra fancy you could make the skull 'look' at the nearest player
while(1)
{
players = GetPlayers();
searchDist = 500; //500 is the search distance for players - change as needed
nearestPlayer = ArrayGetClosest(self.origin, players, searchDist);
if(!isdefined(nearestPlayer) || Distance2D(self.origin, nearestPlayer.origin) > searchDist)
{
wait(1);
}
else
{
target = nearestPlayer GetTagOrigin("tag_eye");
self face_target(target);
wait(0.2);
}
}
}
//Syntax: <entity> face_target(<vector3>)
function face_target(target)
{
vectorToFace = self.origin - target;
angleToFace = VectortoAngles(vectorToFace);
self RotateTo(angleToFace, 0.25);
}