-
May 20th, 2014, 03:19 #61
I have been searching for a week, trying to find where that code goes. No luck.. anyone out there willing to assist me in finding where I need to insert the code to allow me to see that cone?
-
May 20th, 2014, 04:33 #62
OK, to link everything together you need to put the following code into an imagecontrol:
Code:<imagecontrol> <pointertypes> <custom name="45Cone"> <icon>pointer_cone</icon> <label>Draw a 45-Degree Cone</label> </custom> </pointertypes> </imagecontrol>
We also need to tell the imagecontrol where the code for the onBuildCustomPointer() function (and the functions called by onBuildCustomPointer()) lives. The code to do this is (assuming the file containing these functions is called Pointer_Toolkit.lua):
Code:<imagecontrol> <script file="Pointer_Toolkit.lua" /> </imagecontrol>
But remember, the Pointers Toolkit is a Toolkit - not a complete set of files you can "drop in" to an existing Ruleset. If it was, it would be an Extension, not a Toolkit! In other words, treat it like a piece of furniture from Ikea - some assembly required.
Any other questions please ask.
CheersLast edited by dulux-oz; May 20th, 2014 at 08:43.
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 14th, 2014, 05:41 #63
Dulux-Oz's Pointer Toolkit For Dummies
Hi Guys,
Because I've been informed that some people are having trouble using the Pointer Toolkit I put together this post to try to make things clearer - Enjoy!
IMPORTNAT POINT No 1
Pointers can be considered an "advanced" topic in FG Coding. You NEED to FULLY read and understand the Pointer Toolkit Documentation to be able to use the Toolkit consistently and successfully. Just about all of the issues people have had with getting the Toolkit to work have stemmed from the fact that they HAVEN'T FULLY read and/or understood the documentation (and/or they've been trying to use the Toolkit to do things it wasn't designed to do).
The Pointer Toolkit is NOT designed to be used "as is" - it's a Toolkit - you take the individual tool or tools from the kit and use them in your project.
The Pointer Toolkit includes some SAMPLE or EXAMPLE functions to show you how to achieve certain results. If the Sample functions are useful to use "as is", by all means use them - BUT they were designed as Examples, not as finalised code.
FG has two types of Pointers: Standard Pointers and Custom Pointers.
The Standard Pointers are: Circle, Square, 90-Degree Cone and Arrow. Custom Pointers are Pointers we create.
We don't need to do anything to the FG Code to use the Standard Pointers, UNLESS we want to use one or more Custom Pointers in our Ruleset.
Any Ruleset can have a MAXIMUM of 5 Pointers. The 5 Pointers can be a mix of Standard and Custom Pointers.
Any Pointer is made up of Lines, Curves and Quarter-Ellipse Curves.
To draw a Line we use the fpLineCurve() function from the Toolkit and give it the Starting and Ending X- and Y-Coordinates, plus an Offset. I'll explain what the Offset does later. Most people will use an Offset of 0.
To draw a curve we can use either the fpAngleArcCurve() or the fpEndpointArcCurve() function and give them the Starting X- and Y-Coordinates of the Curve, the X- and Y-Coordinates of the Centrepoint of the Circle the Curve is a part of and either the Angle that the Curve needs to cover in Degrees (for the first function) or the Ending X- and Y-Coordinates of the Curve (for the second function). Both of these functions in turn call the fpArcCurve() function.
To draw a Quarter-Ellipse curve we can use the fpEllipseCurve() function and give it the X- and Y-Radius of the Quarter-Ellipse, plus an Offset. The "flatness" of the Quarter-Ellipse depends upon the ratio of the two Radii: if they are the same (ie 1:1) we end up with a Quarter-Circle.
So, if your Pointer has Lines you need to include the fpLineCurve() function, if it has Quarter-Ellipses you need to include the fpEllipseCurve() function, and if it has Curves you need to include the fpArcCurve() function and either (or both) the fpAngleArcCurve() or the fpEndpointArcCurve() function, depending upon how you draw your curves (End-Point or Angle-of-Arc).
These five functions are called Curve Definition Functions.
OK, so How do we do this?
Well, Pointers are part of imagecontrols, so we need to modify the imagecontrol used to display maps, etc. In the CoreRPG this imagecontol is called "image" and is found starting at line 28 of the campaign/campaign_images.xml file. If we look at line 35 of this file we can see that the image imagecontrol calls a script file called image.lua in the campaign/scripts folder. So we know we need to modify these two files: we need to put the relevant functions from the Pointer Toolkit into the image.lua file and make some changes to the image imagecontrol in the campaign_images.xml file. Of course, this is just one way of accomplishing our goal - and we need to be aware that if we modify these two files the next time FG is updated the two files will be reverted back to they way they were before we changed them - some people solve this problem by putting their Custom Pointers in an Extension, but this can lead to conflicts with other Extensions that deal with the image imagecontrol.
To tell FG that we want to use Custom Pointers we need to put a <pointertypes> tag inside the image imagecontrol and a pointer tag for each Custom Pointer AND one for each Standard Pointer. The SAMPLE Code below shows a <pointertypes> tag with 5 pointer tags: one for each of the Standard Pointers and one for a Custom Pointer called "45Cone".
Code:<imagecontrol> <pointertypes> <custom name="45Cone"> <icon>pointer_cone</icon> <label>Draw a 45-Degree Cone</label> </custom> <arrow> <icon>pointer</icon> <label>Draw Arrow</label> </arrow> <square> <icon>pointer_square</icon> <label>Draw Square</label> </square> <circle> <icon>pointer_circle</icon> <label>Draw Circle</label> </circle> <cone> <icon>pointer_cone</icon> <label>Draw Cone</label> </cone> </pointertypes> <!-- Other imagecontrol tags --> </imagecontrol>
The best way to draw a Pointer is have onBuildCustomPointer() call a Pointer-Drawing function, one for each Custom Pointer. These Pointer-Drawing functions also go into the file with the other functions (eg image.lua).
To draw a Pointer FG expects a table of Coordinates. The Curve Definition Functions return the correctly values in the correct format, so if our Pointer-Drawing function calls the correct Curve Definition Functions with the correct values, then we've drawn our Pointer.
The Pointer Toolkit includes 11 SAMPLE Pointer-Drawing functions and a SAMPLE onBuildCustomPointer() function to show you how to do this.
Pointers are drawn centred around the Start Point (for Circles, Squares, etc) or originating at the Start Point (for Cones and Arrows) and extending out to the End Point. Remember the Offset value used in some of the Curve Definition Functions? This causes the Line/Ellipse-Curve to "slide along" the line from the Start Point to the End Point. If you look closely at the Sample Pointer-Drawing functions you can see how this works.
So, to summarise: take the functions and Sample functions from the Toolkit and place them in a file. Link the file (if it isn't already) to the imagecontol. Tell FG to use the Custom Pointers via the <pointertypes> tag.
And have fun!
I hope this has made things clearer for everyone.
Any question, please ask.
CheersLast edited by dulux-oz; December 14th, 2014 at 17:28.
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 14th, 2014, 17:55 #64
I think you are assuming a lot to think we can actually understand the documentation.
Honestly.. I don't really understand half of what you type.Full License Operator - You must have a 'Lite' License to play in my games.
Member and GM in the Fantasy Grounds Pathfinder Society Group.
PFS Fantasy Grounds Forum
FG Community Teamspeak Server: ts.fg-con.com
Interested in Custom Character Portraits and Tokens? Contact me.
-
December 15th, 2014, 01:13 #65
OK, fair comment. I have assumed a basic level of knowledge, which (IMNSHO) is the minimum required if someone is going to be creating Extensions and Rulesets. However, you know what they say about assuming: it makes an @ss out of you and me. Everyone is different and everyone learns/understands things in a different way, so let's see what we can do to get this sorted.
Which part (of the doco) is causing you grief or where are you getting caught up?Last edited by dulux-oz; December 15th, 2014 at 01:17.
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 19th, 2014, 01:21 #66
FYI the square pointertype should be <rectangle>, square doesn't work. M_W confirmed that rectangle should be used.
Use the following for the 4 basic (default) types:
Code:<imagecontrol> <pointertypes> <arrow> <icon>pointer</icon> <label>Draw Arrow</label> </arrow> <rectangle> <icon>pointer_square</icon> <label>Draw Square</label> </rectangle> <circle> <icon>pointer_circle</icon> <label>Draw Circle</label> </circle> <cone> <icon>pointer_cone</icon> <label>Draw Cone</label> </cone> </pointertypes> </imagecontrol>
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 24th, 2014, 09:46 #67
So, just so you know. After all the help I got with the 30* cone pointer. Which is greatly appreciated. I decided to keep working on it myself to figure out why I couldn't get the instructions to work. And then it struck me like a ton of bricks. The problem I had, where the end points would show, but not the outline. It was due to the same problem we solved in other post. I had alternate extensions that were effecting the code. Once I turned them off, I was able to draw what I needed.
So, I wanted to verify that the instructions in Dulux's thread here did work, and I was able to follow them. In fact, the whole time I was looking for help to solve why it didnt work, it actually was working.. it was just conflicting with another extension. Bone head move on my part. But I just wanted to let people know that the instructions here do work.
-
December 24th, 2014, 11:04 #68
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 24th, 2014, 12:10 #69
I have no problem saying I made a mistake, even more so when I do not have a sweet fracking clue on how all of this works other then what I have read here on the forums.
Now that I am finally starting to understand the bare bones of it. Some things are starting to fall into place a little easier. Don't get me wrong, your instructions are great but they are well over my head when it comes to understanding them. It took me a long while of poking around to figure some of the stuff out. But, all the answers are there, I just needed to roll a few critical successes on my Cryptography skills to get there
As for your question, it was just one of my own Frankenstein copy/paste concoctions I had made when I first started to mess with this in the first place.
-
December 24th, 2014, 13:15 #70
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks