Problem with Message Menu

Post » Fri Nov 18, 2011 2:35 pm

I hav a problem with the message menu, because the code selected by the buttons will not run.

This part works ok. It just uses the H key to cause the npc to wait and stop waiting. If the player is to far away, then a radio is used automatically, instead of activating a radio in the inventory.

The code is part of a quest script
	if IsKeyPressed 35 ; HKEY		if VNPCFollowers.bVeronicaHired == 1			if player.GetDistance VeronicaREF < 4000				if VeronicaREF.Waiting == 0					set VeronicaREF.Waiting to 1					VeronicaREF.evp					VeronicaREF.sayto player GOODBYE				else					set VeronicaREF.Waiting to 0					VeronicaREF.evp				endif			else				set useRadio to 1			endif		;elseif other followers hired			;do later		endif	endif


Next code block, when the npc to far away to call, use radio instead.
The problem is that the code in the menu does not execute. The NPC will carry on waiting. Also I made sure ButtonVar == 1 matches the message button index numbers,

	if useRadio == 1		ShowMessage radioTransmitterMSG		set buttonVar to GetButtonPressed		if buttonVar > -1		set useRadio to 0			if buttonVar == 0				;do later			elseif buttonVar == 1				set VeronicaREF.Waiting to 0				VeronicaREF.evp				showMessage DEBUG1 buttonVar			elseif buttonVar == 2                                                                      ;do later                                                     ;more elseif''s etc...			endif			if buttonVar == 7				set RexREF.Waiting to 0				RexREF.evp			endif			if buttonVar == 8                                                                       ;FINISH - EXIT				set buttonVar to -1			endif		endif	endif

Any ideas why the menu is not working
User avatar
Vahpie
 
Posts: 3447
Joined: Sat Aug 26, 2006 5:07 pm

Post » Fri Nov 18, 2011 11:34 pm

I JUST made a menu like this myself, so I'll lay out what I did:
if iActivate	if iActivate <= 1		set iActivate to 2		ShowMessage QMxMessage	endif	if iActivate <= 2		set iReturn to GetButtonPressed		if iReturn > -1			set iActivate to 0			; return code logic goes here		endif	endifendif

Without explaining things in excrutiating detail, the ShowMessage only occurs once, then the script keeps looping waiting on the player to select one of the menu options. ShowMessage doesn't pause the script, you have to keep looping by to see if there's a result in GetButtonPressed.

Queue
User avatar
CArla HOlbert
 
Posts: 3342
Joined: Wed Feb 21, 2007 11:35 pm

Post » Fri Nov 18, 2011 12:02 pm




Thanks
User avatar
Danny Warner
 
Posts: 3400
Joined: Fri Jun 01, 2007 3:26 am


Return to Fallout: New Vegas