UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - andrizzlepc

I'm having some trouble activating a zone with a custom trigger. I want to activate a zone with a simple trigger that rotates and opens a door. I'm not using a regular "zombie_door" trigger cus I wanted to control the speed of the door opening. My issue is that when I put a "script_flag" KVP on the trigger it doesn't activate the zone. In my script I have.

zm_zonemgr::add_adjacent_zone( "start_zone", "bunker_entrance_zone", "open_bunker" );

The script_flag KVP has the value "open_bunker" but when I enter the zone it kills me instantly. So then I tried putting the add zone code IN the trigger code.

Code Snippet
Plaintext
function vault_door()
{
v_trigger = GetEnt("vault_trigger", "targetname");
v_trigger setHintString("Hold ^3&&1^7 to open the Bunker door [Cost: 1000]");
v_trigger setCursorHint("HINT_NOICON");

v_trigger thread v_open();
}

function v_open()
{
vault_hint = GetEnt("vault_hint", "targetname");
vault_hint setHintString("The Bunker door is sealed");
vault_hint setCursorHint("HINT_NOICON");

handle = GetEnt("vault_switch", "targetname");

door_left = GetEnt("left_door", "targetname");
door_right = GetEnt("right_door", "targetname");
door_clip = GetEnt("door_barrier", "targetname");

level.trapCost = 1000;

while(1)
{
self waittill("trigger", player);

if (player.score >= level.trapCost)
{
player zm_score::minus_to_player_score(level.trapCost);
self playsound("zmb_cha_ching");
handle RotateRoll(-90,0.25);
                        zm_zonemgr::add_adjacent_zone( "start_zone", "bunker_entrance_zone" );
break;
}
else
{
self playsound("deny");
}
}

//open vault door
door_left RotateYaw(150,2);
door_right RotateYaw(-150,2);

self delete();
vault_hint delete();
door_clip delete();
}

Now in this situation I can enter the zone but zombie spawners don't work?? Any help appreciated!!
6 years ago
If anyone looks at this post and had same issues I fixed it this is what it is when it works lol.

Code Snippet
Plaintext
function vault_door()
{
v_trigger = GetEnt("vault_trigger", "targetname");
v_trigger setHintString("Hold ^3&&1^7 to open the Bunker door [Cost: 1000]");
v_trigger setCursorHint("HINT_NOICON");

v_trigger thread v_open();
}

function v_open()
{
vault_hint = GetEnt("vault_hint", "targetname");
vault_hint setHintString("The Bunker door is sealed");
vault_hint setCursorHint("HINT_NOICON");

handle = GetEnt("vault_switch", "targetname");

door_left = GetEnt("left_door", "targetname");
door_right = GetEnt("right_door", "targetname");
door_clip = GetEnt("door_barrier", "targetname");

level.trapCost = 1000;

while(1)
{
self waittill("trigger", player);

if (player.score >= level.trapCost)
{
player zm_score::minus_to_player_score(level.trapCost);
self playsound("zmb_cha_ching");
handle RotateRoll(-90,0.5);
break;
}
else
{
self playsound("deny");
}
}

//open vault door
door_left RotateYaw(120,2);
door_right RotateYaw(-120,2);

self delete();
vault_hint delete();
door_clip delete();
}
6 years ago
What do you mean?
6 years ago
Thanks lmao can't believed I missed that, it compiles now but when i run the map it just black screens and never loads??
6 years ago
Okay I tried your code and compiled and linked however the triggers were just displaying the "Not Available" text, I just tried compiling and linking again and its back to giving me the " Compiler Internal Error :  Uninitialized local variable 'player'
" error. Absolutely no clue what is wrong.

Code Snippet
Plaintext
function main()
{
level.randomize_perk_machine_location = true;

zm_usermap::main();
grow_soul::init(  );

level._zombie_custom_add_weapons =&custom_add_weapons;

//Setup the levels Zombie Zone Volumes
level.zones = ;
level.zone_manager_init_func =&usermap_test_zone_init;
init_zones
[list][o] = "start_zone";
level thread zm_zonemgr::manage_zones( init_zones );

level.pathdist_type = PATHDIST_ORIGINAL;

level.player_starting_points = 500000;

setDvar( "wallrun_enabled", 1 );
level thread setup_wallrun();

level thread checkForPower();
level thread vault_door();
}

function vault_door()
{
v_trigger = GetEnt("vault_trigger", "targetname");
v_trigger setHintString("Hold &&1 to open the Bunker");
v_trigger setCursorHint("HINT_NOICON");

vault_hint = GetEnt("vault_hint", "targetname");
vault_hint setHintString("The Bunker door is sealed");
vault_hint setCursorHint("HINT_NOICON");

door_left = GetEnt("left_door", "targetname");
door_right = GetEnt("right_door", "targetname");

level.trapCost = 1000;

while(1)
{
v_trigger wattill("trigger", player);

if (player.score >= level.trapCost)
{
player zm_score::minus_to_player_score(level.trapCost);
v_trigger playsound("zmb_cha_ching");
break;
}
else
{
v_trigger playsound("deny");
}
}

//open vault door
door_left MoveZ(-200,2);
door_right MoveZ(-200,2);

v_trigger delete();
vault_hint delete();
}
6 years ago
Wondering whats wrong with my script, when i keep it in the main .gsc script i get an error for unresolved local variable "player"? Can't seem to find any help with that online, when I put the script in a different file and include and then call it i get an unresolved external variable. Any help appreciated - thanks.

*in function main()*
level thread vault_door();

Code Snippet
Plaintext
function vault_door()
{
v_trigger = GetEnt("vault_trigger", "targetname");
v_trigger setHintString("Hold &&1 to open the Bunker");
v_trigger setCursorHint("HINT_NOICON");

vault_hint = GetEnt("vault_hint", "targetname");
vault_hint setHintString("The Bunker door is sealed");
vault_hint setCursorHint("HINT_NOICON");

door_left = GetEnt("left_door", "targetname");
door_right = GetEnt("right_door", "targetname");

level.trapCost = 1000;

{
while(1)
{
trigger wattill("v_trigger", player);

if (player.score >= level.trapCost)
{
player zm_score::minus_to_player_score(level.trapCost);
trigger playsound("zmb_cha_ching");
break;
}
else
{
trigger playsound("deny");
}
}

//open vault door
door_left MoveZ(-200,2);
door_right MoveZ(-200,2);

trigger delete();
vault_hint delete();
}
}
6 years ago
Loading ...