Message Menu with extensive IF Conditions

Post » Tue May 17, 2011 10:33 am

Evening,

well Ive narrowed the problem of my initial issue down to the below.

What's effectively supposed to happen is that the player equips the item from their Pipboy, and a menu pops up.

They press a button, the item unequips and they're teleported. Simples.

Not quite so;

I have 50 if statements all related to the first button, now when I remove gamemode and all of its body from the script, the message pops up.

When I leave it there, the item just equips and were it the norm.

Any theories?

scn vortexManSCRIPTshort buttonfloat rndmbegin OnEquip player	Set rndm to GetRandomPercent	ShowMessage JackHarknessVMendbegin GameModeset Button to GetButtonPressed	if ( Button == 0 ) 		if rndm >= 1 && rndm <= 2			set VMGlobal to 1			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker1		elseif rndm >= 3 && rndm <= 4			set VMGlobal to 2			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker2		elseif rndm >= 3 && rndm <= 4			set VMGlobal to 3			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker3			elseif rndm >= 5 && rndm <= 6			set VMGlobal to 4			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker4				elseif rndm >= 7 && rndm <= 8			set VMGlobal to 5			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker5		elseif rndm >= 9 && rndm <= 10			set VMGlobal to 6			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker6		elseif rndm >= 11 && rndm <= 12			set VMGlobal to 7			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker7		elseif rndm >= 13 && rndm <= 14			set VMGlobal to 8			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker8		elseif rndm >= 15 && rndm <= 16			set VMGlobal to 9			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker9		elseif rndm >= 17 && rndm <= 18			set VMGlobal to 10			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker10		elseif rndm >= 19 && rndm <= 20			set VMGlobal to 11			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker11		elseif rndm >= 21 && rndm <= 22			set VMGlobal to 12			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker12		elseif rndm >= 23 && rndm <= 24			set VMGlobal to 13			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker13		elseif rndm >= 25 && rndm <= 26			set VMGlobal to 14			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker14		elseif rndm >= 27 && rndm <= 28			set VMGlobal to 15			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker15		elseif rndm >= 29 && rndm <= 30			set VMGlobal to 16			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker16		elseif rndm >= 31 && rndm <= 32			set VMGlobal to 17			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker17		elseif rndm >= 33 && rndm <= 34			set VMGlobal to 18			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker18		elseif rndm >= 35 && rndm <= 36			set VMGlobal to 19			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker19		elseif rndm >= 37 && rndm <= 38			set VMGlobal to 20			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker20		elseif rndm >= 39 && rndm <= 40			set VMGlobal to 21			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker21		elseif rndm >= 41 && rndm <= 42			set VMGlobal to 22			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker22		elseif rndm >= 43 && rndm <= 44			set VMGlobal to 23			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker23		elseif rndm >= 45 && rndm <= 46			set VMGlobal to 24			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker24		elseif rndm >= 47 && rndm <= 48			set VMGlobal to 25			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker25		elseif rndm >= 49 && rndm <= 50			set VMGlobal to 26			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker26		elseif rndm >= 51 && rndm <= 52			set VMGlobal to 27			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker27		elseif rndm >= 53 && rndm <= 54			set VMGlobal to 28			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker28		elseif rndm >= 55 && rndm <= 56			set VMGlobal to 29			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker29		elseif rndm >= 57 && rndm <= 58			set VMGlobal to 30			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker30		elseif rndm >= 59 && rndm <= 60			set VMGlobal to 31			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker31		elseif rndm >= 61 && rndm <= 62			set VMGlobal to 32			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker32		elseif rndm >= 63 && rndm <= 64			set VMGlobal to 33			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker33		elseif rndm >= 65 && rndm <= 66			set VMGlobal to 34			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker34		elseif rndm >= 67 && rndm <= 68			set VMGlobal to 35			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker35		elseif rndm >= 69 && rndm <= 70			set VMGlobal to 36			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker36		elseif rndm >= 71 && rndm <= 72			set VMGlobal to 37			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker37		elseif rndm >= 73 && rndm <= 74			set VMGlobal to 38			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker38		elseif rndm >= 75 && rndm <= 76			set VMGlobal to 39			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker39		elseif rndm >= 77 && rndm <= 78			set VMGlobal to 40			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker40		elseif rndm >= 79 && rndm <= 80			set VMGlobal to 41			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker41		elseif rndm >= 81 && rndm <= 82			set VMGlobal to 42			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker42		elseif rndm >= 83 && rndm <= 84			set VMGlobal to 43			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker43		elseif rndm >= 85 && rndm <= 86			set VMGlobal to 44			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker44		elseif rndm >= 87 && rndm <= 88			set VMGlobal to 45			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker45		elseif rndm >= 89 && rndm <= 90			set VMGlobal to 46			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker46		elseif rndm >= 91 && rndm <= 92			set VMGlobal to 47			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker47		elseif rndm >= 93 && rndm <= 94			set VMGlobal to 48			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker48		elseif rndm >= 95 && rndm <= 96			set VMGlobal to 49			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker49		elseif rndm >= 97 && rndm <= 98			set VMGlobal to 50			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker50		elseif rndm >= 99 && rndm <= 100			set VMGlobal to 26			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge			player.moveTo VMmarker26		endif	endif	if ( Button == 1 ) 		if VMGlobal == 1			player.MoveTo VMmarker1			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 2			player.MoveTo VMmarker2			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 3			player.MoveTo VMmarker3			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			;PlaySound AMBElectricArcLarge		elseif VMGlobal == 4			player.MoveTo VMmarker4			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 5			player.MoveTo VMmarker5			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 6			player.MoveTo VMmarker6			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 7			player.MoveTo VMmarker7			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 8			player.MoveTo VMmarker8			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 9			player.MoveTo VMmarker9			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 10			player.MoveTo VMmarker10			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 11			player.MoveTo VMmarker11			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 12			player.MoveTo VMmarker12			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 13			player.MoveTo VMmarker13			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 14			player.MoveTo VMmarker14			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 15			player.MoveTo VMmarker15			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 16			player.MoveTo VMmarker16			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 17			player.MoveTo VMmarker17			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 18			player.MoveTo VMmarker18			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 19			player.MoveTo VMmarker19			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 20			player.MoveTo VMmarker20			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 21			player.MoveTo VMmarker21			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 22			player.MoveTo VMmarker22			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 23			player.MoveTo VMmarker23			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 24			player.MoveTo VMmarker24			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 25			player.MoveTo VMmarker25			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 26			player.MoveTo VMmarker26			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 27			player.MoveTo VMmarker27			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 28			player.MoveTo VMmarker28			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 29			player.MoveTo VMmarker29			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 30			player.MoveTo VMmarker30			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 31			player.MoveTo VMmarker31			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 32			player.MoveTo VMmarker32			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 33			player.MoveTo VMmarker33			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 34			player.MoveTo VMmarker34			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 35			player.MoveTo VMmarker35			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 36			player.MoveTo VMmarker36			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 37			player.MoveTo VMmarker37			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 38			player.MoveTo VMmarker38			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 39			player.MoveTo VMmarker39			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 40			player.MoveTo VMmarker40			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 41			player.MoveTo VMmarker41			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 42			player.MoveTo VMmarker42			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 43			player.MoveTo VMmarker43			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 44			player.MoveTo VMmarker44			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 45			player.MoveTo VMmarker45			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 46			player.MoveTo VMmarker46			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 47			player.MoveTo VMmarker47			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 48			player.MoveTo VMmarker48			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 49			player.MoveTo VMmarker49			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		elseif VMGlobal == 50			player.MoveTo VMmarker50			player.UnequipItem VortexManipulatorItem 1 1			imod FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		endif	endif	if ( Button == 3 ) 	endifend

User avatar
Amy Melissa
 
Posts: 3390
Joined: Fri Jun 23, 2006 2:35 pm

Post » Mon May 16, 2011 10:51 pm

You should never leave a 'gameMode' block open to run all the time like that. Use a variable to control when the gameMode block will run.
You also do NOT need the if statements to check if the value is greater than a number. The IF/ELSEIF structure will do that for you since the first 'true' IF/ELSEIF statement is the one executed.
You also do not need to unequip the item if you create the item with NO body slots selected.

scn vortexManSCRIPTshort buttonfloat rndmshort myStatebegin OnEquip player	Set rndm to GetRandomPercent	set myState to 1	ShowMessage JackHarknessVMendbegin GameMode	if myState == 1		set Button to GetButtonPressed		if ( Button == 0 ) 			set myState to 0			if rndm <= 2				set VMGlobal to 1				player.UnequipItem VortexManipulatorItem 1 1				imod FireExtinguisherISFX				PlaySound JackHarknessVortex				PlaySound AMBElectricArcLarge				player.moveTo VMmarker1			elseif <= 4

User avatar
Lily Something
 
Posts: 3327
Joined: Thu Jun 15, 2006 12:21 pm

Post » Tue May 17, 2011 10:57 am

You should never leave a 'gameMode' block open to run all the time like that. Use a variable to control when the gameMode block will run.
You also do NOT need the if statements to check if the value is greater than a number. The IF/ELSEIF structure will do that for you since the first 'true' IF/ELSEIF statement is the one executed.
You also do not need to unequip the item if you create the item with NO body slots selected.

scn vortexManSCRIPTshort buttonfloat rndmshort myStatebegin OnEquip player	Set rndm to GetRandomPercent	set myState to 1	ShowMessage JackHarknessVMendbegin GameMode	if myState == 1		set Button to GetButtonPressed		if ( Button == 0 ) 			set myState to 0			if rndm <= 2				set VMGlobal to 1				player.UnequipItem VortexManipulatorItem 1 1				imod FireExtinguisherISFX				PlaySound JackHarknessVortex				PlaySound AMBElectricArcLarge				player.moveTo VMmarker1			elseif <= 4



Cheers buddy, well I made the ammendments as advised, and can see what you mean, but its unfortunately still not resolved the issue. Hmm.
User avatar
Klaire
 
Posts: 3405
Joined: Wed Sep 27, 2006 7:56 am

Post » Tue May 17, 2011 2:35 am

Try using MenuMode instead of GameMode. You said you wanted the message to popup while in pipboy menu right?

short MenuLevelBegin OnEquipIF MenuLevel == 0		Set MenuLevel to 1		Set rndm to GetRandomPercent		ShowMessage JackHarknessVMendifENDBegin MenuMode		If MenuLevel == 1		Set Button to GetButtonPressed		If Button == 0...			set MenuLevel to 0

User avatar
Dina Boudreau
 
Posts: 3410
Joined: Thu Jan 04, 2007 10:59 pm

Post » Tue May 17, 2011 4:27 am

Thing is, it works when theres two or three conditions in there, but when there's that many, it seems to trip up. I'll certainly give it a try though :)
User avatar
Isabell Hoffmann
 
Posts: 3463
Joined: Wed Apr 18, 2007 11:34 pm

Post » Tue May 17, 2011 5:39 am

Thing is, it works when theres two or three conditions in there, but when there's that many, it seems to trip up. I'll certainly give it a try though :)
Try:
Spoiler
scn vortexManSCRIPTFloat fTimerInt iDiceInt iButtonInt iMessageBoxBegin OnEquip Player	If MenuMode		Set fTimer to 0.5	EndIf		Set iMessageBox to -1	Set iDice to GetRandomPercent	Player.UnequipItem VortexManipulatorItem 1 1	End;===================================================Begin GameMode		If iMessageBox	Else		Return	EndIf		If (iMessageBox == 1)		Set iButton to GetButtonPressed		If (iButton == -1)			Return		Else			Set iMessageBox to 0			If (iButton == 0) 				If (iDice <= 2)					Set VMGlobal to 1					Player.MoveTo VMmarker1				ElseIf (iDice <= 4)					Set VMGlobal to 2					Player.MoveTo VMmarker2				ElseIf (iDice <= 6)					Set VMGlobal to 4					Player.MoveTo VMmarker4						ElseIf (iDice <= 8)					Set VMGlobal to 5					Player.MoveTo VMmarker5				ElseIf (iDice <= 10)					Set VMGlobal to 6					Player.MoveTo VMmarker6				ElseIf (iDice <= 12)					Set VMGlobal to 7					Player.MoveTo VMmarker7				ElseIf (iDice <= 14)					Set VMGlobal to 8					Player.MoveTo VMmarker8				ElseIf (iDice <= 16)					Set VMGlobal to 9					Player.MoveTo VMmarker9				ElseIf (iDice <= 18)					Set VMGlobal to 10					Player.MoveTo VMmarker10				ElseIf (iDice <= 20)					Set VMGlobal to 11					Player.MoveTo VMmarker11				ElseIf (iDice <= 22)					Set VMGlobal to 12					Player.MoveTo VMmarker12				ElseIf (iDice <= 24)					Set VMGlobal to 13					Player.MoveTo VMmarker13				ElseIf (iDice <= 26)					Set VMGlobal to 14					Player.MoveTo VMmarker14				ElseIf (iDice <= 28)					Set VMGlobal to 15					Player.MoveTo VMmarker15				ElseIf (iDice <= 30)					Set VMGlobal to 16					Player.MoveTo VMmarker16				ElseIf (iDice <= 32)					Set VMGlobal to 17					Player.MoveTo VMmarker17				ElseIf (iDice <= 34)					Set VMGlobal to 18					Player.MoveTo VMmarker18				ElseIf (iDice <= 36)					Set VMGlobal to 19					Player.MoveTo VMmarker19				ElseIf (iDice <= 38)					Set VMGlobal to 20					Player.MoveTo VMmarker20				ElseIf (iDice <= 40)					Set VMGlobal to 21					Player.MoveTo VMmarker21				ElseIf (iDice <= 42)					Set VMGlobal to 22					Player.MoveTo VMmarker22				ElseIf (iDice <= 44)					Set VMGlobal to 23					Player.MoveTo VMmarker23				ElseIf (iDice <= 46)					Set VMGlobal to 24					Player.MoveTo VMmarker24				ElseIf (iDice <= 48)					Set VMGlobal to 25					Player.MoveTo VMmarker25				ElseIf (iDice <= 50)					Set VMGlobal to 26					Player.MoveTo VMmarker26				ElseIf (iDice <= 52)					Set VMGlobal to 27					Player.MoveTo VMmarker27				ElseIf (iDice <= 54)					Set VMGlobal to 28					Player.MoveTo VMmarker28				ElseIf (iDice <= 56)					Set VMGlobal to 29					Player.MoveTo VMmarker29				ElseIf (iDice <= 58)					Set VMGlobal to 30					Player.MoveTo VMmarker30				ElseIf (iDice <= 60)					Set VMGlobal to 31					Player.MoveTo VMmarker31				ElseIf (iDice <= 62)					Set VMGlobal to 32					Player.MoveTo VMmarker32				ElseIf (iDice <= 64)					Set VMGlobal to 33					Player.MoveTo VMmarker33				ElseIf (iDice <= 66)					Set VMGlobal to 34					Player.MoveTo VMmarker34				ElseIf (iDice <= 68)					Set VMGlobal to 35					Player.MoveTo VMmarker35				ElseIf (iDice <= 70)					Set VMGlobal to 36					Player.MoveTo VMmarker36				ElseIf (iDice <= 72)					Set VMGlobal to 37					Player.MoveTo VMmarker37				ElseIf (iDice <= 74)					Set VMGlobal to 38					Player.MoveTo VMmarker38				ElseIf (iDice <= 76)					Set VMGlobal to 39					Player.MoveTo VMmarker39				ElseIf (iDice <= 78)					Set VMGlobal to 40					Player.MoveTo VMmarker40				ElseIf (iDice <= 80)					Set VMGlobal to 41					Player.MoveTo VMmarker41				ElseIf (iDice <= 82)					Set VMGlobal to 42					Player.MoveTo VMmarker42				ElseIf (iDice <= 84					Set VMGlobal to 43					Player.MoveTo VMmarker43				ElseIf (iDice <= 86)					Set VMGlobal to 44					Player.MoveTo VMmarker44				ElseIf (iDice <= 88)					Set VMGlobal to 45					Player.MoveTo VMmarker45				ElseIf (iDice <= 90)					Set VMGlobal to 46					Player.MoveTo VMmarker46				ElseIf (iDice <= 92)					Set VMGlobal to 47					Player.MoveTo VMmarker47				ElseIf (iDice <= 94)					Set VMGlobal to 48					Player.MoveTo VMmarker48				ElseIf (iDice <= 96)					Set VMGlobal to 49					Player.MoveTo VMmarker49				ElseIf (iDice <= 98)					Set VMGlobal to 50					Player.MoveTo VMmarker50				ElseIf (iDice <= 100)					Set VMGlobal to 26					Player.MoveTo VMmarker26				EndIf			ElseIf (iButton == 1) 				If (VMGlobal == 1)					Player.MoveTo VMmarker1				ElseIf (VMGlobal == 2)					Player.MoveTo VMmarker2				ElseIf (VMGlobal == 3)					Player.MoveTo VMmarker3				ElseIf (VMGlobal == 4)					Player.MoveTo VMmarker4				ElseIf (VMGlobal == 5)					Player.MoveTo VMmarker5				ElseIf (VMGlobal == 6)					Player.MoveTo VMmarker6				ElseIf (VMGlobal == 7)					Player.MoveTo VMmarker7				ElseIf (VMGlobal == 8)					Player.MoveTo VMmarker8				ElseIf (VMGlobal == 9)					Player.MoveTo VMmarker9				ElseIf (VMGlobal == 10)					Player.MoveTo VMmarker10				ElseIf (VMGlobal == 11)					Player.MoveTo VMmarker11				ElseIf (VMGlobal == 12)					Player.MoveTo VMmarker12				ElseIf (VMGlobal == 13)					Player.MoveTo VMmarker13				ElseIf (VMGlobal == 14)					Player.MoveTo VMmarker14				ElseIf (VMGlobal == 15)					Player.MoveTo VMmarker15				ElseIf (VMGlobal == 16)					Player.MoveTo VMmarker16				ElseIf (VMGlobal == 17)					Player.MoveTo VMmarker17				ElseIf (VMGlobal == 18)					Player.MoveTo VMmarker18				ElseIf (VMGlobal == 19)					Player.MoveTo VMmarker19				ElseIf (VMGlobal == 20)					Player.MoveTo VMmarker20				ElseIf (VMGlobal == 21)					Player.MoveTo VMmarker21				ElseIf (VMGlobal == 22)					Player.MoveTo VMmarker22				ElseIf (VMGlobal == 23)					Player.MoveTo VMmarker23				ElseIf (VMGlobal == 24)					Player.MoveTo VMmarker24				ElseIf (VMGlobal == 25)					Player.MoveTo VMmarker25				ElseIf (VMGlobal == 26)					Player.MoveTo VMmarker26				ElseIf (VMGlobal == 27)					Player.MoveTo VMmarker27				ElseIf (VMGlobal == 28)					Player.MoveTo VMmarker28				ElseIf (VMGlobal == 29)					Player.MoveTo VMmarker29				ElseIf (VMGlobal == 30)					Player.MoveTo VMmarker30				ElseIf (VMGlobal == 31)					Player.MoveTo VMmarker31				ElseIf (VMGlobal == 32)					Player.MoveTo VMmarker32				ElseIf (VMGlobal == 33)					Player.MoveTo VMmarker33				ElseIf (VMGlobal == 34)					Player.MoveTo VMmarker34				ElseIf (VMGlobal == 35)					Player.MoveTo VMmarker35				ElseIf (VMGlobal == 36)					Player.MoveTo VMmarker36				ElseIf (VMGlobal == 37)					Player.MoveTo VMmarker37				ElseIf (VMGlobal == 38)					Player.MoveTo VMmarker38				ElseIf (VMGlobal == 39)					Player.MoveTo VMmarker39				ElseIf (VMGlobal == 40)					Player.MoveTo VMmarker40				ElseIf (VMGlobal == 41)					Player.MoveTo VMmarker41				ElseIf (VMGlobal == 42)					Player.MoveTo VMmarker42				ElseIf (VMGlobal == 43)					Player.MoveTo VMmarker43				ElseIf (VMGlobal == 44)					Player.MoveTo VMmarker44				ElseIf (VMGlobal == 45)					Player.MoveTo VMmarker45				ElseIf (VMGlobal == 46)					Player.MoveTo VMmarker46				ElseIf (VMGlobal == 47)					Player.MoveTo VMmarker47				ElseIf (VMGlobal == 48)					Player.MoveTo VMmarker48				ElseIf (VMGlobal == 49)					Player.MoveTo VMmarker49				ElseIf (VMGlobal == 50)					Player.MoveTo VMmarker50				EndIf			EndIf			IMOD FireExtinguisherISFX			PlaySound JackHarknessVortex			PlaySound AMBElectricArcLarge		EndIf	Else;If (iMessageBox == -1)		If (fTimer <= 0)			Set fTimer to 0			Set iMessageBox to 1			ShowMessage JackHarknessVM		Else			Set fTimer to (fTimer - GetSecondsPassed)		EndIf	EndIf		End
?
...Should compile and work with a lot less code and uses an early return for 'cost' reduction.
User avatar
Caroline flitcroft
 
Posts: 3412
Joined: Sat Nov 25, 2006 7:05 am


Return to Fallout 3