Page 1 of 1

BCNM Menus with Multiple Options

Posted: Sat Jan 17, 2015 9:42 pm
by Joe
I was looking into the BCNM menu problem and found something interesting that I am no longer able to duplicate. This is the code that I am using for the onTrigger() function to play around with the menu in the Ghelsba Outpost at the hut door.

file: darkstar\scripts\zones\Ghelsba_Outpost\npcs\Hut_Door.lua

Code: Select all

function onTrigger(player,npc)

	local menuTest = 0xFFFFFFFF;

	local RemoveSaveTheChildren = false;
	local RemoveTheHolyCrest = false;
	local RemoveWingsOfFury = false;
	local RemovePetrifyingPair = false;
	local RemoveToadalRecall = false;
	local RemoveMirrorMirror = false;
	local Removedots = true;

	if( RemoveSaveTheChildren) then menuTest = menuTest - 1;  end
	if( RemoveTheHolyCrest) then menuTest = menuTest - 2;  end
	if( RemoveWingsOfFury) then menuTest = menuTest - 4;  end
	if( RemovePetrifyingPair) then menuTest = menuTest - 8;  end
	if( RemoveToadalRecall) then menuTest = menuTest - 16; end
	if( RemoveMirrorMirror) then menuTest = menuTest - 32; end
	if( Removedots) then 
		menuTest = menuTest - 64;
		menuTest = menuTest - 128;
		menuTest = menuTest - 256;
		menuTest = menuTest - 512;
		menuTest = menuTest - 1024;
		menuTest = menuTest - 2048;
		menuTest = menuTest - 4096;
		menuTest = menuTest - 8192;
		menuTest = menuTest - 16384;
		menuTest = menuTest - 32768;
		menuTest = menuTest - 65536;
		menuTest = menuTest - 131072;
		menuTest = menuTest - 262144;
		menuTest = menuTest - 524288;
		menuTest = menuTest - 1048576;
		menuTest = menuTest - 2097152;
		menuTest = menuTest - 4194304;
		menuTest = menuTest - 8388608;
		menuTest = menuTest - 16777216;
		menuTest = menuTest - 33554432;
		menuTest = menuTest - 67108864;
		menuTest = menuTest - 134217728;
		menuTest = menuTest - 268435456;
		menuTest = menuTest - 536870912;
		menuTest = menuTest - 1073741824;
	end

	player:startEvent(0x7d00, 0, 0, 0, menuTest, 0, 0, 0);
end;
The problem with the menu is that 'option' always returns as 255, usually that is. At least it always returns 255 at first. For a while, and this is what I am unable to duplicate now for some reason, there was another 0x05b packet sent after the 0x5c packet. It is in that packet that the value for 'option' corresponds to the selected menu item. These are the values that I have for the menu items:

0x01 Save The Children
0x11 The Holy Crest
0x21 Wings of Fury
0x31 Petrifying Pair
0x41 Toadal Recall
0x51 Mirror, Mirror

In the file bcnm.lua there are some comments concerning multiple event update packets. Is there any way to cycle through these until you get a value that is not 255 or 0?

Re: BCNM Menus with Multiple Options

Posted: Sat Jan 24, 2015 9:12 am
by Joe
I realized what I was doing wrong. The last packet, the one with the value indicating which menu option was selected, is actually available in onEventFinish(). The problem though is that when dealing with BCNMs, currently, when you try to register a BCNM, which is done in onEventUpdate(), you have to have the bcnm id. Because of the way the menu actually works, you can't know the correct bcnm id until onEventFinish. I haven't thouroughly looked over all of the code dealing with BCNMs, but it seems that it needs to be modified so that you can register an instance of a battlefield(during onEventUpdate()) and then upon entering the battlefield you need to be able to tell it which particular bcnm you have actually selected(during onEventFinish()).

Re: BCNM Menus with Multiple Options

Posted: Sat Jan 24, 2015 3:40 pm
by whasf
BCNM system is a mess right now.. Let me add that to the Worklist