Custom Door Error?

broken avatar :(
Created 336 days ago
by andrizzlepc
0 Members and 1 Guest are viewing this topic.
841 views
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 25 July 2018
Last active: 109 days ago
Posts
6
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
andrizzlepc's Groups
andrizzlepc's Contact & Social Links
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();

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();
}
}
Last Edit: July 25, 2018, 04:46:25 pm by sevengpluke
Marked as best answer by andrizzlepc on Today at 10:35:08 am
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 3 days ago
Posts
290
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksDistenc5Teffrie
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();


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("v_trigger", player);

if (player.score >= level.trapCost)
{
player zm_score::minus_to_player_score(level.trapCost);
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();
}

Fixed some bugs and I think you had too many brackets, try this
Last Edit: July 25, 2018, 06:57:25 pm by gympie6
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 25 July 2018
Last active: 109 days ago
Posts
6
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
andrizzlepc's Groups
andrizzlepc's Contact & Social Links
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.

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();
}
Last Edit: July 26, 2018, 03:21:43 pm by Lukkie1998
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 10 days ago
Posts
3,997
Respect
Forum Rank
Eviscerator
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
×
HitmanVere's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
v_trigger wattill("v_trigger", player);

Should be:

v_trigger waittill("trigger", player);
Last Edit: July 26, 2018, 04:45:19 pm by HitmanVere
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 25 July 2018
Last active: 109 days ago
Posts
6
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
andrizzlepc's Groups
andrizzlepc's Contact & Social Links
Thanks lmao can't believed I missed that, it compiles now but when i run the map it just black screens and never loads??
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 47 days ago
Posts
6,879
Respect
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
v_trigger is not a proper waittill
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 25 July 2018
Last active: 109 days ago
Posts
6
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
andrizzlepc's Groups
andrizzlepc's Contact & Social Links
What do you mean?
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 25 July 2018
Last active: 109 days ago
Posts
6
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
andrizzlepc's Groups
andrizzlepc's Contact & Social Links
If anyone looks at this post and had same issues I fixed it this is what it is when it works lol.

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();
}
Last Edit: July 31, 2018, 05:04:22 pm by sevengpluke
broken avatar :(
×
broken avatar :(
Location: frLuketown
Date Registered: 8 June 2013
Last active: 26 days ago
Posts
293
Respect
Forum Rank
Mr. Elemental
Primary Group
UGX Site Moderator
My Groups
More
My Contact & Social Links
More
Personal Quote
Welcome to Luketown
×
sevengpluke's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Oil Rig Beta Access
Oil Rig Beta Access
sevengpluke's Contact & Social Linksdalukesevengplukesevengplukesevengplukesevengpluke
Next time use the code tags around script. Makea it easier to read. This is the 2nd time I've had to edit it for you. Thanks.
broken avatar :(
×
broken avatar :(
Location: usWashington, DC
Date Registered: 24 October 2018
Last active: 237 days ago
Posts
1
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
Signature
Did you [You are not allowed to view external links. Register or Login to see them] or not?
×
waynen's Groups
waynen's Contact & Social LinksFitness Donkey
Next time use the code tags around script. Makea it easier to read. This is the 2nd time I've had to edit it for you. Thanks.

Thanks for the fix. Appreciate it.

 

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 Twitch
Loading ...