November 21, 201015 yr REALLY struggling with some XML code in the Modeldef file here ......... I have created a new part with both animation and mousclick area, however.. even though it uses the same code as the previous part (and a new checked Guid) the mouserect wont show in the attachtool drop down list :( I've tried changing the name the tooltip everything to no avail .. anyone have a clue ????WORKING CODE ------- shows in drop down list and both animation and click spot works just fine <PartInfo> <Name>Emergency_Chute_Handle</Name> <AnimLength>100</AnimLength> <Animation> <Parameter> <Sim> <Variable>SPOILERS HANDLE POSITION</Variable> <Units>percent</Units> </Sim> <Lag>100</Lag> </Parameter> </Animation> <MouseRect> <Cursor>Hand</Cursor> <TooltipText>EMERGENCY PARACHUTE</TooltipText> <MouseFlags>LeftSingle</MouseFlags> <CallbackCode> (L:RBF_pin, bool) 1 == if{ (>K:SPOILERS_ON) } </CallbackCode> </MouseRect></PartInfo> NON WORKING CODE ------- CLICK SPOT does NOT show in down list BUT animation works just fine <Partinfo> <Name>Pin_remove_before_flight</Name> <AnimLength>100</AnimLength> <Animation> <Parameter> <Sim> <Variable>SPOILERS HANDLE POSITION</Variable> <Units>percent</Units> </Sim> <Lag>100</Lag> </Parameter> </Animation> <MouseRect> <Cursor>Hand</Cursor> <TooltipText>REMOVE BEFORE FLIGHT</TooltipText> <MouseFlags>LeftSingle</MouseFlags> <CallbackCode> (L:RBF_pin, bool) 0 == if{ (>L:RBF_pin) } </CallbackCode> </MouseRect></Partinfo> Anyone ???????
November 21, 201015 yr Moderator Possibly a syntax error? You aren't supplying a value to send to the L:Var, and you didn't specify the units for the L:Var,Units (required!): <CallbackCode> (L:RBF_pin, bool) 0 == if{ 1 (>L:RBF_pin,bool) } </CallbackCode> Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
November 22, 201015 yr And a logic error? What your code does is set RBF_pin to 0... when it's 0What you probably want is: (L:RBF_pin, bool) 0 == if{ 1 (>L:RBF_pin, bool) } or (L:RBF_pin, bool) ! (>L:RBF_pin, bool} Having said that I've no idea what you're trying to achieve
November 22, 201015 yr As said by Bill, failing to specify the "unit" when writing a value into an L:Var, is most likely your problem.This has probably been THE most common (and hard-to-find) error I make/made myself when writing XML gauges :( Rob
Create an account or sign in to comment