-
December 12th, 2014, 19:43 #1
Draw a 30* Cone Pointer - Looking for some help.
Guys.. I can really use the help with some XML coding for my Back Crusade ruleset.. I really need to get that 30* cone (pointer) to show up. But I can not get it to appear like it should...
I have followed the excellent instructions from Dulux-Oz in his tutorial; on how to do it. But I can not figure out why I can not get it to appear when I draw it on the map. I can get everything else to work, it shows range, the two points when you draw it and rotate it, but not the actual cone!
Anyone willing to try and help me figure it out???? Please?
Trust me, its not for lack of trying.. but there is something I am missing and I can not get it to work.
JollyLast edited by ShotGun Jolly; December 13th, 2014 at 00:38.
-
December 12th, 2014, 21:40 #2
The problem..
Ok..
Here is the problem that I can not solve..
I have added my custom cone to the radial menu, I can select it and I can draw it. In the below picture, you can see all of the other pointers which I can draw, (Circle, 45* Cone, and Line) Now, look at my mouse, where my mouse is currently resting, you can see one of two small squares.. this is my 30* which I drew. As you can see, there is no outline, just the start and finish points. And that only appears when I mouse over it.
Attachment 8266
Here is the campaign_Images.XML which I needed to edit to allow the pointers to show up.
Code:<imagecontrol name="image"> <script file="My_Cone.lua" /> <pointertypes> <arrow> <icon>pointer</icon> <label>Draw Arrow</label> </arrow> <circle> <icon>pointer_circle</icon> <label>Draw Circle</label> </circle> <cone> <icon>pointer_cone</icon> <label>Draw Cone</label> </cone> <custom name="30ConePointer"> <icon>pointer_cone</icon> <label>Draw a 30-Degree Cone</label> </custom> </pointertypes>
Code:function onBuildCustomPointer(nStartXCoord,nStartYCoord,nEndXCoord,nEndYCoord,sPointerType) local nLength = math.sqrt((nEndXCoord-nStartXCoord)^2+(nEndYCoord-nStartYCoord)^2); if nLength == 0 then return end local aShapeCurves = {}; local aDistLabelPosition = {25,25}; local bDrawArrow = false; local nAngleRadians = math.atan2(nEndXCoord-nStartXCoord,nStartYCoord-nEndYCoord); -- Call the relevant Pointer Definition Function if sPointerType == "30ConePointer" then fpConePointer(aShapeCurves,nLength,30); end -- Rotate and Position the Pointer for nIndex,aCurve in ipairs(aShapeCurves) do for nPointIndex,aPoint in ipairs(aCurve) do local nXCoord = aPoint[1]*math.cos(nAngleRadians)-aPoint[2]*math.sin(nAngleRadians)+nStartXCoord; local nYCoord = aPoint[1]*math.sin(nAngleRadians)+aPoint[2]*math.cos(nAngleRadians)+nStartYCoord; aCurve[nPointIndex] = {nXCoord,nYCoord}; end end return aShapeCurves,aDistLabelPosition,bDrawArrow; end
-
December 13th, 2014, 00:44 #3
I know absolutely nothing about the custom drawing stuff, so this may be a total stab in the dark, but could it be the line "local bDrawArrow=false" ? Should that be set to true somewhere?
-
December 13th, 2014, 01:09 #4
EDIT: Ignore previous info in this post...
I take it you're trying to do something along the lines of this post: https://www.fantasygrounds.com/forum...ustom-Pointers
If so, this is suggesting that you need to subtract a centerx value from aPoint[1] and subtract a centery value from aPoint[2] in the calculations.Last edited by Trenloe; December 13th, 2014 at 01:14.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
December 13th, 2014, 01:32 #5
Tried both suggestions, even before Trenloe changed his first suggestion.. ;-)
Neither made any change at all, no matter what
-
December 13th, 2014, 01:49 #6
when you get this working - could I make a suggestion/request? great! thanks could you package the pointer up as a standalone extension too (if possible) so that people can learn from your learns or at least just reuse your damn pointer.
-
December 13th, 2014, 02:02 #7
-
December 13th, 2014, 02:21 #8
OK, first off you're missing a function - where in your code is the fpConePointer() function?
And, obviously, the functions called by fpConePointer()?
Secondly, I don't think its going to be possible to put this into an Extension, mainly because you have to override other Pointer drawing code and therefore "stuff up" those other Pointers - mind you, if you prove me wrong then I'll take my hat off to you.
CheersLast edited by dulux-oz; December 13th, 2014 at 02:24.
Dulux-Oz
√(-1) 2^3 Σ Π
...And it was Delicious!
Alpha-Geek
ICT Professional
GMing Since 1982
NSW, Australia, UTC +10
LinkedIn Profile: www.linkedin.com/in/mjblack
Watch our games on Twitch: www.twitch.tv/dulux_oz
Support Me on Patreon: www.patreon.com/duluxoz
Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz
-
December 13th, 2014, 02:27 #9
damned => its all in my Pointer Toolkit (on the Wiki and in the Thread on the Forums). Yes, its not the easiest thing in the world to do, but if you read through the doco (RTFM) you shouldn't have that much trouble - and you can always ask me (or others) questions.
I mean, that's why I made the damn thing
CheersDulux-Oz
√(-1) 2^3 Σ Π
...And it was Delicious!
Alpha-Geek
ICT Professional
GMing Since 1982
NSW, Australia, UTC +10
LinkedIn Profile: www.linkedin.com/in/mjblack
Watch our games on Twitch: www.twitch.tv/dulux_oz
Support Me on Patreon: www.patreon.com/duluxoz
Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz
-
December 13th, 2014, 03:00 #10Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks