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

problems opening menu file

broken avatar :(
Created 8 years ago
by buttkicker845
0 Members and 1 Guest are viewing this topic.
1,822 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
Signature
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
im trying to open a menu file once each player is spawned that will allow them to pick specific weapons to be spawned with. but the menu file will not open.
this is what i have
Code Snippet
Plaintext
onPlayerSpawn()
{
self endon("disconnect");
self waittill( "spawned_player" );
self SetClientDvars( "cg_deadChatWithDead", "1",
"cg_deadChatWithTeam", "1",
"cg_deadHearTeamLiving", "1",
"cg_deadHearAllLiving", "1",
"compass", "0",
"hud_showStance", "1",
"cg_thirdPerson", "0",
"cg_fov", "65",
"friendlyfire_enabled", "0",
"scr_player_healthregentime" ,"99999",
"g_friendlyfireDist", "0",
"g_friendlyNameDist" , "0");
self set_weapons();
self thread onPlayerRespawn();
}
set_weapons()
{

if(!isDefined(self.spawnedOnTeam) || !self.spawnedOnTeam)
{
                self openMenuNoMouse("test_menu");//open the weapon choice menu
weapon = undefined;
startWeapon = undefined;

self takeAllWeapons();
if(!isDefined(self.team))
{
self.team = "allies";
self giveWeapon( "m1garand" );
self giveWeapon( "fraggrenade" );
startWeapon = "m1garand";
rand = randomInt(2);
if(rand == 0)
{
weapon = "bar";
}
else
{
weapon = "thompson";
}
}
else
{
if(self.team == "allies")
{
self giveWeapon( "m1garand" );
self giveWeapon( "fraggrenade" );
startWeapon = "m1garand";
rand = randomInt(2);
if(rand == 0)
{
weapon = "bar";
}
else
{
weapon = "thompson";
}
}
else
{
self giveWeapon( "kar98k" );
self giveWeapon( "stielhandgranate" );
startWeapon = "kar98k";
rand = randomInt(3);
if(rand == 0)
{
weapon = "mp40";
}
else if( rand == 1)
{
weapon = "stg44";
}
else
{
weapon = "fg42_scoped";
}
}
}
//sets the secondary weapon for the current player
self giveWeapon( weapon );
// Switches the player's weapon once he spawns in
self switchToWeapon( startWeapon );
}
self giveWeapon("m8_white_smoke");
self giveweapon("rocket_barrage");
self setactionslot(4,"weapon","rocket_barrage");
self giveMaxAmmo( "rocket_barrage" );
}
the rest of the function runs perfectly fine but the menu file never opens. and i dont get any errors about not prechaching the menu file or not including it in a fastfile
does anyone know why it not opening?
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 3 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
Signature
Overrun
Lockdown
Overrun (Black Ops Mod)
Snowglobe
Leviathan
Abandoned School
Ski Resort
Leviathan Redux
×
JBird632'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 Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
Do you have a menu file in raw\ui\scriptmenus called test_menu.menu ?
Also do you have a csv file that contains the line:
Code Snippet
Plaintext
menufile,ui\scriptmenus\test_menu.menu
And finally do you have the file precached before _zombiemode.gsc is called using the line:
Code Snippet
Plaintext
precachemenu("test_menu");
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
Do you have a menu file in raw\ui\scriptmenus called test_menu.menu ?
Also do you have a csv file that contains the line:
Code Snippet
Plaintext
menufile,ui\scriptmenus\test_menu.menu
And finally do you have the file precached before _zombiemode.gsc is called using the line:
Code Snippet
Plaintext
precachemenu("test_menu");
yes to all. i didnt have the menufile in my raw only in my mod folder but after adding it to my raw still nothing
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 3 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
×
JBird632'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 Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
Well your script looks fine logically, but it would definitely help if you showed how and where you were calling the onPlayerSpawn() function, since I have a suspicion your player isn't actually defined.

Also make sure that your self.spawnedOnTeam really isn't defined or that you set it to false.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
Code Snippet
Plaintext
main()
{
createAiBias();
maps\squad_control::squad_control_init();
level thread onPlayerConnect();
level.alliesLives = 10;
level.axisLives = 10;
}
onPlayerConnect()
{
setDvar("cheats" , "1");
while(1)
{
level waittill( "connecting", player );
player SetClientDvars( "cg_deadChatWithDead", "1",
"cg_deadChatWithTeam", "1",
"cg_deadHearTeamLiving", "1",
"cg_deadHearAllLiving", "1",
"compass", "0",
"hud_showStance", "0",
"cg_thirdPerson", "0",
"cg_fov", "65",
"friendlyfire_enabled", "0",
"scr_player_healthregentime" ,"99999",
"g_friendlyfireDist", "0",
"g_friendlyNameDist" , "0",
"monkeytoy" , "0");//final version will be 1
player thread onPlayerSpawn();

}
}
the main method is called right after maps\_load::main() and im positive that self.spawnedOnTeam either isnt defined or is false since the rest of the method runs fine. it just doesnt open the menu file

 
Loading ...