Page 1 of 1

Avatar's name in conversations

Posted: Tue Dec 18, 2018 8:24 pm
by agentorangeguy
I'm kind of curious as to how you can actually tell npcs what your avatar name is, like how in the original it would be like :

What is your name?

"your name here", The Avatar

where you could tell them your actual name, or just a generic name. I can get the "name" to populate in the conversation option, but you can't click on it... how do I do this?

Re: Avatar's name in conversations

Posted: Tue Dec 18, 2018 10:08 pm
by Knight Captain
At the top of the function, define the variable:

var name;

After listing the variables, define this variable:

name = getAvatarName();

In a say line, you need to escape the string of text to use the variable:

say("@Forgive my rudeness, ", name, ". I fear I am not yet accustomed to the title of SubCommander.@");

If you want to offer the choice, like in Draxinar's conversation:

avatar_or_name = chooseFromMenu(["I am the Avatar", ("I am " + name)]);
if (avatar_or_name == "I am the Avatar")
say("@How interesting.@");
else if (avatar_or_name == ("I am " + name))
say("@I see.@");

Re: Avatar's name in conversations

Posted: Thu Dec 20, 2018 11:34 am
by agentorangeguy
I need it in the initial conversation before the npc is officially met. Here's the lines in question:

Code: Select all

	if (!UI_get_item_flag(item, MET))
		{
		item.say("@I am Nomaan. What is thy name, " + polite_title + "?@");
		var avatar_or_name = chooseFromMenu2(["I am the Avatar", ("I am " + player_name)]);
			if (avatar_or_name == "I am the Avatar") 
			item.say("He bows stiffly. @Well met, " + polite_title + ".@");
			
			else if (avatar_or_name == ("I am " + player_name))
			item.say("He bows stiffly. @Well met, " + player_name + ".@");

		UI_set_item_flag(item, MET);	
		}	
The choices will populate and you can click on them, however nothing happens, it just stays on the first line "I am Nomaan.." The regular conversation options (name, job, bye) show up then.

Re: Avatar's name in conversations

Posted: Thu Dec 20, 2018 4:00 pm
by Knight Captain
It works if you use chooseFromMenu instead of chooseFromMenu2.

Code: Select all

		if (!UI_get_item_flag(NOMAAN, MET))
		{
			say("@I am Nomaan. What is thy name, ", polite_title, "?@");
			avatar_or_name = chooseFromMenu(["I am the Avatar", ("I am " + player_name)]);

			if (avatar_or_name == "I am the Avatar")
				say("He bows stiffly. @Well met, ", polite_title,".@");
			
			else if (avatar_or_name == ("I am " + player_name))
				say("He bows stiffly. @Well met, ", player_name, ".@");

			UI_set_item_flag(NOMAAN, MET);
		}

Re: Avatar's name in conversations

Posted: Thu Dec 20, 2018 8:27 pm
by agentorangeguy
I coudln't get it to work, i guess the function wasn't defined anywhere

Re: Avatar's name in conversations

Posted: Thu Dec 20, 2018 11:02 pm
by Knight Captain
It may be that everything I do is based off SI, and everything you do is based off BG. This should help:

Code: Select all


var chooseFromMenu 0x956 (var choices)
{
	var selection;

	UI_push_answers();
	add(choices);
	selection = UI_select_from_menu();
	UI_pop_answers();
	return selection;
}

var chooseFromMenu2 0x957 (var choices)
{
	var selection;

	UI_push_answers();
	add(choices);
	selection = UI_select_from_menu2();
	UI_pop_answers();
	return selection;
}

Re: Avatar's name in conversations

Posted: Fri Dec 21, 2018 4:36 pm
by agentorangeguy
Ah thanks, I'll check it out!