![]() |
|
|||||||
| Register | Wiki | Downloads | FAQ | Members List | Social Groups | Calendar | Search | Today's Posts | Mark Forums Read |
| Gauges Use this forum for all your gauges related discussions |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
[Solved] <CallbackCode> bug
Hello everyone.
I have a really strange bug in my MouseRect. I wrote this code : Code:
<PartInfo>
<Name>sna_prep</Name>
<AnimLength>10</AnimLength>
<Animation>
<Parameter>
<Code>(L:PrepPos, bool) 5 *</Code>
<Lag>50</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Selection du but de preparation</TooltipText>
<MouseFlags>LeftSingle+LeftRelease</MouseFlags>
<CallbackCode>
</CallbackCode>
</MouseRect>
</PartInfo>
Ok, so I keep going and I write the code inside the CallbackCode : Code:
(M:Event) 'LeftSingle' scmp 0 ==
if{ 1 (>L:PrepPos, bool) }
(M:Event) 'LeftRelease' scmp 0 ==
if{ 0 (>L:PrepPos, bool) }
But, it's still doesn't work... ![]() The code is exactly the same than before but it doesn't work anymore. ![]() The funny part is that I have a dozen of such "sna_...", all identical and those I didn't modify still work. So I have this one not working : Code:
<PartInfo>
<Name>sna_dest</Name>
<AnimLength>10</AnimLength>
<Animation>
<Parameter>
<Code>(L:DestPos, bool) 5 *</Code>
<Lag>50</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Selection du but de destination</TooltipText>
<MouseFlags>LeftSingle+LeftRelease</MouseFlags>
<CallbackCode>
</CallbackCode>
</MouseRect>
</PartInfo>
Code:
<PartInfo>
<Name>sna_bad</Name>
<AnimLength>10</AnimLength>
<Animation>
<Parameter>
<Code>(L:BadPos, bool) 5 *</Code>
<Lag>50</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>But ADditionnel</TooltipText>
<MouseFlags>LeftSingle+LeftRelease</MouseFlags>
<CallbackCode>
</CallbackCode>
</MouseRect>
</PartInfo>
I really don't understand how 2 identical codes are leading me to 2 different results... ![]() Do you have an idea ? Thanks ![]() Edit : ": D" are replaced with in the code but I did not put any smileys in my XML code ^^
Last edited by Vylsain; 10 May 2012 at 05:53. |
|
#2
|
|||
|
|||
|
Odd, that! I see nothing at all wrong with your XML script...
By the way, when posting XML or C code, use the # icon of the editor to wrap your snippet of script/code with the [code] tags! Code:
<PartInfo>
<Name>sna_prep</Name>
<AnimLength>10</AnimLength>
<Animation>
<Parameter>
<Code>(L:PrepPos, bool) 5 *</Code>
<Lag>50</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Selection du but de preparation</TooltipText>
<MouseFlags>LeftSingle+LeftRelease</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 ==
if{ 1 (>LestPos, bool) }
(M:Event) 'LeftRelease' scmp 0 ==
if{ 0 (>LestPos, bool) }
</CallbackCode>
</MouseRect>
</PartInfo>
__________________
Bill Leaming 3d Modeler Max/GMax C & XML Gauge Programmer Eaglesoft Development Group http://eaglesoftdg.com Intel® Core™ i7-3770k 4.2GHz - Crucial 16GB DDR3 - Dual Radeon HD770 1GB DDR5 (Crossfire) - Eco II Watercooling - Win7 64bit Intel® Core™ i7-2600k 3.4GHz - Crucial 4GB DDR3 - NVIDIA GeForce GTX550Ti 1GB - Win7 64bit Intel® Core™ i7-860 2.8GHz - Crucial 8GB DDR3 - NVIDIA GeForce GTS240 1GB - Win8 64bit NOTE: Unless explicitly stated otherwise, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...
|
|
#3
|
|||
|
|||
|
I agree with Bill, nothing seems wrong at first sight.
I think that maybe you have an illegal character (hidden?) somewhere in the code that prevents it for being loaded into the MDL. If I were you I would make these test: 1) Check that the complete <Part> with trouble is actually stored inside the MDL , using an Hex editor. 2) If the problem exists in the Variable name, use another one on the same piece of code and see what happens. Tom |
|
#4
|
|||
|
|||
|
Ok thanks, I'll check this on Wednesday.
n4gix : thx for the tip
|
|
#5
|
|||
|
|||
|
I downloaded an Hex Editor and opened my mdl file but how do you know if the <Part> with trouble is stored inside the MDL ?
I found the text of the TooltipText but the rest is unreadable, made of unicode characters. Quote:
Thanks Last edited by Vylsain; 09 May 2012 at 02:10. |
|
#6
|
|||
|
|||
|
Update : The problem may come from GMax since that if I apply this MouseRect to another knob it works.
The 3D knob would be the problem ? I tried to redo the AttachPointTool process, tried to apply an XForm but nothing works... ![]() Edit : I tried with a 3rd button : - it was working, showing the cursor and the text - I wrote the XML code : working ok - I make the link with the AnimationManager : doesn't work anymore Last edited by Vylsain; 09 May 2012 at 03:39. |
|
#7
|
|||
|
|||
|
Select the knob giving the problem, then open the Track View. Check the Animation/Scale entry. You must see X=100.0 Y=100.0 Z=100.0
If any one of the three are not 100.0 then you will need to add an X-Form Modifier, then Reset Scale, then collapse back to E-Poly or E-Mesh as desired. Alternatively, build a new knob and make sure that if you need to scale it to final size that you do so only at one of the sub-levels (vertex, edges, faces, polys, element).
__________________
Bill Leaming 3d Modeler Max/GMax C & XML Gauge Programmer Eaglesoft Development Group http://eaglesoftdg.com Intel® Core™ i7-3770k 4.2GHz - Crucial 16GB DDR3 - Dual Radeon HD770 1GB DDR5 (Crossfire) - Eco II Watercooling - Win7 64bit Intel® Core™ i7-2600k 3.4GHz - Crucial 4GB DDR3 - NVIDIA GeForce GTX550Ti 1GB - Win7 64bit Intel® Core™ i7-860 2.8GHz - Crucial 8GB DDR3 - NVIDIA GeForce GTS240 1GB - Win8 64bit NOTE: Unless explicitly stated otherwise, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...
|
|
#8
|
|||
|
|||
|
It works !! Thank you very much Bill
![]() The XForm however change the scale when applied to a group of objects. Is there a way to scale a group of objects without changing their scale values or must we apply the XForm for each object and it might take a whole day ? ^^ For my 3D gauge, there's only one button that still doesn't work : do you see any error in the code ? Code:
<PartInfo>
<Name>sna_rotbudbad</Name>
<AnimLength>12</AnimLength>
<Animation>
<Parameter>
<Code>(L:RotButBadPos, enum)</Code>
<Lag>50</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Selecteur de parametre</TooltipText>
<MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 == (M:Event) 'WheelUp' scmp 0 == ||
if{ (L:RotButBadPos, enum) 1 + (>L:RotButBadPos, enum) }
(M:Event) 'RightSingle' scmp 0 == (M:Event) 'WheelDown' scmp 0 == ||
if{ (L:RotButBadPos, enum) 1 - (>L:RotButBadPos, enum) }
(L:RotButBadPos, enum) 13 ==
if{ 1 (>L:RotButBadPos, enum) }
(L:RotButBadPos, enum) -1 ==
if{ 11 (>L:RotButBadPos, enum) }
</CallbackCode>
</MouseRect>
</PartInfo>
Last edited by Vylsain; 10 May 2012 at 08:43. |
|
#9
|
|||
|
|||
|
Although "logically" this should work, I've never been successful using this format:
Code:
(M:Event) 'LeftSingle' scmp 0 == (M:Event) 'WheelUp' scmp 0 == ||
if{ do*something }
Code:
(M:Event) 'LeftSingle' scmp 0 ==
if{ do*something }
(M:Event) 'WheelUp' scmp 0 ==
if{ do*something }
__________________
Bill Leaming 3d Modeler Max/GMax C & XML Gauge Programmer Eaglesoft Development Group http://eaglesoftdg.com Intel® Core™ i7-3770k 4.2GHz - Crucial 16GB DDR3 - Dual Radeon HD770 1GB DDR5 (Crossfire) - Eco II Watercooling - Win7 64bit Intel® Core™ i7-2600k 3.4GHz - Crucial 4GB DDR3 - NVIDIA GeForce GTX550Ti 1GB - Win7 64bit Intel® Core™ i7-860 2.8GHz - Crucial 8GB DDR3 - NVIDIA GeForce GTS240 1GB - Win8 64bit NOTE: Unless explicitly stated otherwise, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...
|
|
#10
|
|||
|
|||
|
Ok I'll try this tomorrow.
Thank you !
|
|
#11
|
|||
|
|||
|
No results
![]() It's really hard to find the cause of this without any clue ! ![]() Is there a way to see how the variable is modified during the game ? Some kind of debugging tool ? |
|
#12
|
|||
|
|||
|
I set up a little gauge with a digital readout of the variable, or modify an existing digital gauge to temporarily display this variable instead. But there are special gauges out there to display the values of variables too.
Hope this helps, |
|
#13
|
|||
|
|||
|
Ok I'll search for these gauges.
Thanks
|
|
#14
|
|||
|
|||
|
Code:
<PartInfo>
<Name>sna_rotbudbad</Name>
<AnimLength>12</AnimLength>
<Animation>
<Parameter>
<Code>(L:RotButBadPos, enum)</Code>
<Lag>50</Lag>
</Parameter>
</Animation>
...
![]() So much time spent on this... ![]() Thanks for your help, I managed to make a 2D debug gauge and noticed that my variable was working pefectly. I glanced at my modeldef another time and found this mistake... ![]() Thank you for your help, problem solved ! |
|
#15
|
||||
|
||||
|
The joys of FSX programming where you so easily put the wrong letter or miss a bracket or in C++, a break.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|