UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: mobofthedead123 on December 28, 2018, 12:15:56 am

Title: Display Location in Top Left Corner like in Black Ops 4
Post by: mobofthedead123 on December 28, 2018, 12:15:56 am
In Black Ops 4, you can see the name of your location in the top left hand corner. I would like to do this in COD WAW. Any help would be greatly appreciated. Thanks.
Title: Re: Display Location in Top Left Corner like in Black Ops 4
Post by: death_reaper0 on January 05, 2019, 11:55:49 am
decided to make this real quick add this to the bottom of your mapname.gsc file
Code Snippet
cpp
location_display()
{
players = get_players();
for(i=0;i<players.size;i++)
players[i] thread location_display_text();
}

location_display_text()
{
hint_hud = create_simple_hud(self);
hint_hud.alignX = "left";
hint_hud.alignY = "top";
hint_hud.horzAlign = "left";
hint_hud.vertAlign = "top";
hint_hud.fontscale = 2;
hint_hud.color =  (1, .2, .2);
hint_hud.x = 2;
hint_hud.y = 2;
hint_hud.alpha = 1;
text = "";
while(1)
{
text = self get_location_text();
hint_hud SetText( text );
wait .1;
}
}

get_location_text()
{
text = "";
zone_name = "";
zkeys = GetArrayKeys( level.zones );
for( z=0; z<zkeys.size; z++ )
{
zone = level.zones ];
for (i = 0; i < zone.volumes.size; i++)
{
if (self IsTouching(zone.volumes[i]) )
zone_name = zone.volumes[i].targetname;
}
}

switch( zone_name )
{
case "start_zone":
text = "Spawn Room";
break;

case "power":
text = "Power Room";
break;

default:
text = "zone not defined";
break;
}

return text;
}
add
level thread location_display();
under
level thread DLC3_threadCalls2();
at the bottom of the main()
now how it worksat the bottom fuction of this ( get_location_text() ) theres this bit
Code Snippet
Plaintext
	switch( zone_name )
{
case "start_zone":
text = "Spawn Room";
break;

case "power":
text = "Power Room";
break;

default:
text = "zone not defined";
break;
}
this is just an example part ive added, for it to work in your map youwil need to modify this.
the part that says - case "start_zone"
this is the name you gave the zone in radiant
the part directly under it, the part that says "Spawn Room" is what will be displayed when your standing in this zone.
change the example ones to two different zones you have with a name you want to give them and for every other zone you have copy and paste this part and change it to be as you need it
Code Snippet
Plaintext
		case "start_zone":
text = "Spawn Room";
break;
hope this is easy enough to understand,let me know if you have any issues
Title: Re: Display Location in Top Left Corner like in Black Ops 4
Post by: Joeycx on January 08, 2019, 04:28:14 am
decided to make this real quick add this to the bottom of your mapname.gsc file
Code Snippet
cpp
location_display()
{
players = get_players();
for(i=0;i<players.size;i++)
players[i] thread location_display_text();
}

location_display_text()
{
hint_hud = create_simple_hud(self);
hint_hud.alignX = "left";
hint_hud.alignY = "top";
hint_hud.horzAlign = "left";
hint_hud.vertAlign = "top";
hint_hud.fontscale = 2;
hint_hud.color =  (1, .2, .2);
hint_hud.x = 2;
hint_hud.y = 2;
hint_hud.alpha = 1;
text = "";
while(1)
{
text = self get_location_text();
hint_hud SetText( text );
wait .1;
}
}

get_location_text()
{
text = "";
zone_name = "";
zkeys = GetArrayKeys( level.zones );
for( z=0; z<zkeys.size; z++ )
{
zone = level.zones ];
for (i = 0; i < zone.volumes.size; i++)
{
if (self IsTouching(zone.volumes[i]) )
zone_name = zone.volumes[i].targetname;
}
}

switch( zone_name )
{
case "start_zone":
text = "Spawn Room";
break;

case "power":
text = "Power Room";
break;

default:
text = "zone not defined";
break;
}

return text;
}
add
level thread location_display();
under
level thread DLC3_threadCalls2();
at the bottom of the main()
now how it worksat the bottom fuction of this ( get_location_text() ) theres this bit
Code Snippet
Plaintext
	switch( zone_name )
{
case "start_zone":
text = "Spawn Room";
break;

case "power":
text = "Power Room";
break;

default:
text = "zone not defined";
break;
}
this is just an example part ive added, for it to work in your map youwil need to modify this.
the part that says - case "start_zone"
this is the name you gave the zone in radiant
the part directly under it, the part that says "Spawn Room" is what will be displayed when your standing in this zone.
change the example ones to two different zones you have with a name you want to give them and for every other zone you have copy and paste this part and change it to be as you need it
Code Snippet
Plaintext
		case "start_zone":
text = "Spawn Room";
break;
hope this is easy enough to understand,let me know if you have any issues
There's seems to be a bad syntax here
Code Snippet
Plaintext
zone =  level.zones ];
 so i changed it to
Code Snippet
Plaintext
zone = ( level.zones );
it loads but doesn't display the text.
Title: Re: Display Location in Top Left Corner like in Black Ops 4
Post by: death_reaper0 on January 09, 2019, 12:58:17 pm
should of been this, my mistake
Code Snippet
Plaintext
zone = level.zones[ zkeys[z] ];