Change area display name in game through script

yep everything looks fine there. But where have you copied minimap.xml and what does it look like now? Here’s the relevant bits in the one i just tested:

<UIScene name="SCREEN_MINIMAP" x=ALIGN_LEFT y=ALIGN_TOP width=215 height=208 priority="SCENE_INGAME" 
draggable=true dragregion_x=0 dragregion_y=0 dragregion_width=215 dragregion_height=29 scriptloadable="true" />

    <UIText name="AREA_NAME_TEXT" x=ALIGN_CENTER y=7 height=22 width=176 align=center valign=middle fontfamily="Special_Font" style="3" multiline=false
    update=true OnUpdate='UIObject_Misc_ExecuteServerScript("gui_updatearealabel")' />

    <UIText name="AREA_NAME_TEXT_LARGE" x=ALIGN_CENTER y=14 height=22 width=212 align=center valign=middle fontfamily="NWN1_Dialog" style="1" multiline=false
    update=true hidden=true OnUpdate='UIObject_Misc_ExecuteServerScript("gui_updatearealabel")' />

    <UIText name="AREA_NAME_TEXT_COLLAPSE" x=ALIGN_CENTER y=7 height=22 width=176 align=center valign=middle fontfamily="Special_Font" style="3" multiline=false
    update=true hidden=true OnUpdate='UIObject_Misc_ExecuteServerScript("gui_updatearealabel")' />

If you put a SendMessageToPC() at the top of ‘gui_updatearealabel’ it should spam the chatbox.

 
my guess is there’s a minimap.xml that’s taking priority away from the one you think,

and if not, well, do what ya gotta do

oh ok  :)

i didn’t have to do that but it’s better than cloning areas eh

Yes, your xml text looks exactly like mine. The minimap.xml I put in the override folder.

jestemwlodzimierz sollution was this: I got his minimap.xml and and areamap.xml files.

The minimap.xml looks like this:

<?xml version="1.0" encoding="utf-8"?>

<!-- 
	MiniMap
	Adam Brennecke - 01/04/06
	Obsidian Entertainment
	Copyright 2006

	Because the minimap DEPENDS on scale and we do not enforce aspect ratio, we do not rescale the minimap.
-->

<UIScene name="SCREEN_MINIMAP" x=ALIGN_LEFT y=ALIGN_TOP width=215 height=208 scriptloadable=true priority="SCENE_INGAME" 
	draggable=true dragregion_x=0 dragregion_y=0 dragregion_width=215 dragregion_height=29 />

	<UIText name="AREA_NAME_TEXT" x=ALIGN_CENTER y=7 height=22 width=176 align=center valign=middle fontfamily="Special_Font" style="3" multiline=false
	update=true OnUpdate=UIText_OnUpdate_DisplayLocalVar(local:1) />
    
    <UIText name="AREA_NAME_TEXT_LARGE" x=ALIGN_CENTER y=14 height=22 width=212 align=center valign=middle fontfamily="NWN1_Dialog" style="1" multiline=false
	update=true hidden=true OnUpdate=UIText_OnUpdate_DisplayLocalVar(local:1) />
    
    <UIText name="AREA_NAME_TEXT_COLLAPSE" x=ALIGN_CENTER y=7 height=22 width=176 align=center valign=middle fontfamily="Special_Font" style="3" multiline=false
	update=true hidden=true OnUpdate=UIText_OnUpdate_DisplayLocalVar(local:1) />
    
    <UIPane name="MINIMAP_HEADER" x=21 y=8 width=170 height=28 OnLeftDoubleClick=UIPane_Input_MiniMapCollapse() tupple=true capturemouseclicks=false > </UIPane>
    
    <UIPane name="MINIMAP_HEADER_LARGE" x=13 y=10 width=226 height=32 OnLeftDoubleClick=UIPane_Input_MiniMapCollapse() hidden=true tupple=true capturemouseclicks=false > </UIPane>

    <UIPane name="MINIMAP_HEADER_COLLAPSE" x=21 y=8 width=170 height=28 OnLeftDoubleClick=UIPane_Input_MiniMapMakeSmall() hidden=true tupple=true capturemouseclicks=false > </UIPane>

	<!-- Mini Map Zoom In -->
	<UIButton name="MINIMAP_ZOOM_IN" x=22 y=34 width=30 height=30 OnLeftClick=UIButton_Input_MiniMapZoomIn()>
		<UIFrame state=up		fill="button_rzoomin_normal.tga" />
		<UIFrame state=down		fill="button_rzoomin_hover_pressed.tga" />
		<UIFrame state=focused	fill="button_rzoomin_normal.tga" />
		<UIFrame state=hilited	fill="button_rzoomin_hover.tga" />
		<UIFrame state=hifocus	fill="button_rzoomin_hover.tga" />
		<UIFrame state=disabled	fill="button_rzoomin_disabled.tga" />
	</UIButton>		

	<!-- Mini Map Zoom Out -->
	<UIButton name="MINIMAP_ZOOM_OUT" x=163 y=34 width=30 height=30 OnLeftClick=UIButton_Input_MiniMapZoomOut()>
		<UIFrame state=up		fill="button_rzoomout_normal.tga" />
		<UIFrame state=down		fill="button_rzoomout_hover_pressed.tga" />
		<UIFrame state=focused	fill="button_rzoomout_normal.tga" />
		<UIFrame state=hilited	fill="button_rzoomout_hover.tga" />
		<UIFrame state=hifocus	fill="button_rzoomout_hover.tga" />
		<UIFrame state=disabled	fill="button_rzoomout_disabled.tga" />
	</UIButton>	
    
    
    <!-- Mini Map Zoom In Large-->
	<UIButton name="MINIMAP_ZOOM_IN_LARGE" hidden=true x=13 y=44 width=41 height=41 OnLeftClick=UIButton_Input_MiniMapZoomIn()>
		<UIFrame state=up		fill="button_rzoomin_normal.tga" />
		<UIFrame state=down		fill="button_rzoomin_hover_pressed.tga" />
		<UIFrame state=focused	fill="button_rzoomin_normal.tga" />
		<UIFrame state=hilited	fill="button_rzoomin_hover.tga" />
		<UIFrame state=hifocus	fill="button_rzoomin_hover.tga" />
		<UIFrame state=disabled	fill="button_rzoomin_disabled.tga" />
	</UIButton>		

	<!-- Mini Map Zoom Out Large-->
	<UIButton name="MINIMAP_ZOOM_OUT_LARGE" hidden=true x=201 y=44 width=41 height=41 OnLeftClick=UIButton_Input_MiniMapZoomOut()>
		<UIFrame state=up		fill="button_rzoomout_normal.tga" />
		<UIFrame state=down		fill="button_rzoomout_hover_pressed.tga" />
		<UIFrame state=focused	fill="button_rzoomout_normal.tga" />
		<UIFrame state=hilited	fill="button_rzoomout_hover.tga" />
		<UIFrame state=hifocus	fill="button_rzoomout_hover.tga" />
		<UIFrame state=disabled	fill="button_rzoomout_disabled.tga" />
	</UIButton>	
	
	<!-- These must be above the radar frame, so that they draw over it -->
	<UIPane name="PARTY_OFFSCREEN_PANE"  x=36 y=45 width=150 height=150 ignoreevents=true capturmouseclicks=false capturemouseevents=false />
	<UIPane name="PERCEPTION_OFFSCREEN_PANE"  x=36 y=45 width=150 height=150 ignoreevents=true capturmouseclicks=false capturemouseevents=false />
	<UIPane name="MAPPOINT_OFFSCREEN_PANE"  x=36 y=45 width=150 height=150 ignoreevents=true capturmouseclicks=false capturemouseevents=false />
	<UIPane name="TARGET_OFFSCREEN_PANE"  x=36 y=45 width=150 height=150 ignoreevents=true capturmouseclicks=false capturemouseevents=false />

	<UIIcon name="RADAR_FRAME" width=215 height=208 img="radar_frame.tga" ignoreevents=true />
    
    <UIIcon name="RADAR_FRAME_LARGE" hidden=true width=253 height=275 img="radar_frame_big.tga" ignoreevents=true />
    
    <UIIcon name="RADAR_FRAME_COLLAPSE" hidden=true width=186 height=43 img="minimap_minimized.tga" ignoreevents=true />
	
	<UIIcon name="PLAYER_ARROW" width=18 height=22 img="radar_player_arrow.tga" color="silver" />
	<UIIcon name="PLAYER_CAMERA" width=49 height=144 img="radar_camera_direction.tga" />

	<UIIcon name="PARTY_MARKER" width=14 height=18 img="radar_player_arrow.tga" color="0x8BDAE9" />
	<UIIcon name="PARTY_OFFSCREEN_MARKER" width=16 height=8 img="radar_marker00_offradar.tga" color="0x8BDAE9" />
	<UIPane name="PARTY_PANE"  x=36 y=45 width=150 height=150 ignoreevents=true capturmouseclicks=false capturemouseevents=false/>

	<UIIcon name="PERCEPTION_MARKER" width=20 height=21 img="radar_p_marker01.tga" />
	<UIIcon name="PERCEPTION_OFFSCREEN_MARKER" width=16 height=8 img="radar_marker00_offradar.tga" />
	<UIPane name="PERCEPTION_PANE"  x=36 y=45 width=150 height=150 ignoreevents=true capturmouseclicks=false capturemouseevents=false/>

	<UIIcon name="MAPPOINT_MARKER" width=16 height=16 img="radar_map_marker.tga" color="0xE0C69B" />
	<UIIcon name="MAPPOINT_OFFSCREEN_MARKER" width=16 height=15 img="radar_marker01_offradar.tga" color="0xE0C69B" />
	<UIPane name="MAPPOINT_PANE"  x=36 y=45 width=150 height=150 ignoreevents=true capturmouseclicks=false capturemouseevents=false/>

	<UIIcon name="TARGET_MARKER" width=20 height=21 img="radar_p_marker02.tga" />
	<UIIcon name="TARGET_OFFSCREEN_MARKER" width=16 height=16 img="radar_marker02_offradar.tga" />
	<UIPane name="TARGET_PANE"  x=36 y=45 width=150 height=150 ignoreevents=true capturmouseclicks=false capturemouseevents=false/>
	
	<!-- Mini Map Special Image -->
	<!-- This pane control is mandatory and it's name will be held onto by the rootscene for use in other callbacks -->
	<UIPane name="MINIMAP_IMAGE_PANE" x=36 y=45 width=150 height=150 update=true OnUpdate=UIPane_OnUpdate_UpdateMiniMap() ignoreevents=true capturmouseclicks=false capturemouseevents=false></UIPane>
    
    <UIPane name="MINIMAP_IMAGE_PANE_LARGE" x=26 y=50 width=200 height=200 update=false ignoreevents=true capturmouseclicks=false capturemouseevents=false></UIPane>

The areamap.xml looks like this:

<?xml version="1.0" encoding="utf-8"?>
<!-- Neverwinter Nights 2                       -->
<!-- Copyright © Obsidian Entertainment, Inc.   -->
<!--                                            -->
<!-- Author: Adam Brennecke, 08/11/2006         -->

<UIScene name="SCREEN_AREAMAP" x=100 y=100 width=505 height=563 scriptloadable=true draggable=true priority="SCENE_INGAME" scalescene="true" hidden="true" fadeout="0.2" fadein="0.2" backoutkey=true OnAdd=UIObject_MISC_ExecuteServerScript("gui_areamapname")/>

    <!-- Close Button -->
	<UIButton name="CloseButton" x=468 y=7 style="STYLE_CLOSE_BUTTON" OnLeftClick=UIButton_Input_ScreenClose() />

	<UIText name="AREA_NAME_TEXT" x=20 y=36 width="398" height=23 align=left valign=middle fontfamily="Body_Font" style="1" uppercase=false multiline=false
		update=true OnUpdate=UIText_OnUpdate_DisplayLocalVar(local:1) />
    
    <!-- Area Map Zoom In Large-->
	<UIButton name="AREAMAP_ZOOM_IN_LARGE" x=417 y=33 width=30 height=30 OnLeftClick=UIButton_Input_AreaMapZoomIn()>
		<UIFrame state=up		fill="button_rzoomin_normal.tga" />
		<UIFrame state=down		fill="button_rzoomin_hover_pressed.tga" />
		<UIFrame state=focused	fill="button_rzoomin_normal.tga" />
		<UIFrame state=hilited	fill="button_rzoomin_hover.tga" />
		<UIFrame state=hifocus	fill="button_rzoomin_hover.tga" />
		<UIFrame state=disabled	fill="button_rzoomin_disabled.tga" />
	</UIButton>		

	<!-- Area Map Zoom Out Large-->
	<UIButton name="AREAMAP_ZOOM_OUT_LARGE" x=453 y=33 width=30 height=30 OnLeftClick=UIButton_Input_AreaMapZoomOut()>
		<UIFrame state=up		fill="button_rzoomout_normal.tga" />
		<UIFrame state=down		fill="button_rzoomout_hover_pressed.tga" />
		<UIFrame state=focused	fill="button_rzoomout_normal.tga" />
		<UIFrame state=hilited	fill="button_rzoomout_hover.tga" />
		<UIFrame state=hifocus	fill="button_rzoomout_hover.tga" />
		<UIFrame state=disabled	fill="button_rzoomout_disabled.tga" />
	</UIButton>	
    
    <!-- Area Map Special Image -->
	<!-- This pane control is mandatory and it's name will be held onto by the rootscene for use in other callbacks -->
	<UIPane name="AREAMAP_IMAGE_PANE" x=8 y=66 width=488 height=488 update=true draggable=true OnLeftClick=UIButton_Input_AreaMapTravel() OnUpdate=UIPane_OnUpdate_UpdateAreaMap()>
        <!-- These must be above the radar frame, so that they draw over it -->
        <UIPane name="PARTY_OFFSCREEN_PANE"  x=0 y=0 width=488 height=488 ignoreevents=true />
        <UIPane name="PERCEPTION_OFFSCREEN_PANE"  x=0 y=0 width=488 height=488 ignoreevents=true />
        <UIPane name="MAPPOINT_OFFSCREEN_PANE"  x=0 y=0 width=488 height=488 ignoreevents=true />
        <UIPane name="TARGET_OFFSCREEN_PANE"  x=0 y=0 width=488 height=488 ignoreevents=true />
        
        <UIIcon name="PLAYER_ARROW" width=18 height=22 img="radar_player_arrow.tga" color="silver" hidden=true />
        <UIIcon name="PLAYER_OFFSCREEN_MARKER" width=16 height=8 img="radar_marker00_offradar.tga" color="silver" hidden=true />
        <UIIcon name="NORTH_MARKER" width=32 height=32 img="b_map.tga" hidden=true />

        <UIIcon name="PARTY_MARKER" width=14 height=18 img="radar_player_arrow.tga" color="0x8BDAE9" hidden=true />
        <UIIcon name="PARTY_OFFSCREEN_MARKER" width=16 height=8 img="radar_marker00_offradar.tga" color="0x8BDAE9" hidden=true />
        <UIPane name="PARTY_PANE"  x=0 y=0 width=488 height=488 ignoreevents=true />

        <UIIcon name="PERCEPTION_MARKER" width=20 height=21 img="radar_p_marker01.tga" hidden=true />
        <UIIcon name="PERCEPTION_OFFSCREEN_MARKER" width=16 height=8 img="radar_marker00_offradar.tga" hidden=true />
        <UIPane name="PERCEPTION_PANE"  x=0 y=0 width=488 height=488 ignoreevents=true />

        <UIIcon name="MAPPOINT_MARKER" width=16 height=16 img="radar_map_marker.tga" color="0xE0C69B" hidden=true OnLeftClick=UIButton_Input_AreaMapMark() />
        <UIIcon name="MAPPOINT_OFFSCREEN_MARKER" width=16 height=15 img="radar_marker01_offradar.tga" color="0xE0C69B" hidden=true />
        <UIPane name="MAPPOINT_PANE"  x=0 y=0 width=488 height=488 ignoreevents=true />

        <UIIcon name="TARGET_MARKER" width=20 height=21 img="radar_p_marker02.tga" hidden=true />
        <UIIcon name="TARGET_OFFSCREEN_MARKER" width=16 height=16 img="radar_marker02_offradar.tga" hidden=true />
        <UIPane name="TARGET_PANE"  x=0 y=0 width=488 height=488 ignoreevents=true />
        
        <UIIcon x=0 y=0 width=488 height=488 img="areamap_blackfade.tga" />
        
	</UIPane>
    
    <UIIcon x=9 y=40 width=488 height=32 img="frame1_B.tga" />
    
	<UIFrame width="PARENT_WIDTH" height="PARENT_HEIGHT" topleft="frame1_tl.tga" topright="frame1_tr.tga" bottomleft="frame1_bl.tga"
		bottomright="frame1_BR.tga" top="frame1_t.tga" bottom="frame1_b.tga" left="frame1_l.tga" right="frame1_r.tga" border=32 />	
	
    <UIText name="TITLE" strref="6379" x=20 y="7" width="450" height="23" align=left valign=middle fontfamily="Title_Font" style="2" />
	<UIIcon name="DETAIL_TOP" img="title_large04.tga" x=10 y=8 width=486 height=31 ignoreevents="true" />
	<UIIcon img="frame_main_bg.tga" x=10 y=8 width=486 height=546 />

Then he said:

First create a script called "gui_areamapname" and put this line into it:

SetLocalGUIVariable(GetFirstPC(), "SCREEN_AREAMAP", 1, GetLocalString(GetFirstPC(), "AreaName"));

Now to set the displayed name use this:

string sAreaName = whatever you want;
SetLocalString(GetFirstPC(), "AreaName", sAreaName);
SetLocalGUIVariable(GetFirstPC(), "SCREEN_MINIMAP", 1, GetLocalString(GetFirstPC(), "AreaName"));

If you Use this system you'll have to put those lines into an "OnClientEnter" script of every single one of your areas, so that it doesn't show "blank" when a PC enters.

So my OnClientEnter script looks like this (and I have to make a unique one for each area):

void main()
{

string sAreaName = "MyAreaName";
SetLocalString(GetFirstPC(), "AreaName", sAreaName);
SetLocalGUIVariable(GetFirstPC(), "SCREEN_MINIMAP", 1, GetLocalString(GetFirstPC(), "AreaName"));

}

Then I took this script, made a new one but changed the sAreaName to something else. This script I then called through a conversation, and THAT actually worked in my module.

Strange how your script kevL_s didn’t work for me. All the other scripts you’ve made for me have been fantastic and without error.

Protip - you don’t need to make a unique script for each area. Make ONE script, and use this:

if(GetArea(GetFirstPC())==GetArea(GetObjectByTag( a tag of a unique object in an area )))
{
sAreaName = “MyAreaName”;
}

The script will get pretty big, but it’s WAY better than having like 40 seperate scripts just for area names.

hm, no biggie. jestem’s code looks like it stores the AreaLabel as a local_string on the gui-object itself (instead of on the area-object) – “local:1” – so could/should be faster.

Let me say first that I suck at scripting. Therefore I ask this: Should I put this code after or before this:

string sAreaName = "MyAreaName";
SetLocalString(GetFirstPC(), "AreaName", sAreaName);
SetLocalGUIVariable(GetFirstPC(), "SCREEN_MINIMAP", 1, GetLocalString(GetFirstPC(), "AreaName"));

(I understand that the one script will be pretty big because I need to use the names for all my areas in there and find an object in each area that I can “call”)

I really need to sleep now. My head hurts and it’s almost 1:00 at night…

Here’s what I would do:

void main()
{
string sAreaName;

if(GetArea(GetFirstPC())==GetArea(GetObjectByTag(“lebron”)))
{
sAreaName = “Cleveland";
}

else if(GetArea(GetFirstPC())==GetArea(GetObjectByTag(“durant”)))
{
sAreaName = “Oakland";
}

SetLocalString(GetFirstPC(), “AreaName”, sAreaName);
SetLocalGUIVariable(GetFirstPC(), “SCREEN_MINIMAP”, 1, GetLocalString(GetFirstPC(), “AreaName”));
}

Now - when PC enters the area that contains an object with a tag “lebron” the script will change the displayed name to “Cleveland” and if it contains “durant” it will change it to “Oakland”. Obviously change the names and tags to whatever you need, but you get the idea? If you want to add more area names just add another “else if” segment before the “SetLocalString”.

I don’t know any scripts that could help you with your headache :frowning: Though I think 500mg of paracetamol might do the trick.

Ok. Thanks!

I might have figured it out on my own today, now that I’ve had a night of sleep :grinning:, but yesterday after reading yours and kevL_s threads and going back and forth trying everything (with Aqvilinus suggestions also) for a few hours, without any luck of succeeding…until I got your PM, and finally it worked, well, I was a bit exausted to say the least.