Thread: Changing Token Rotation
-
November 16th, 2011, 01:32 #1
Changing Token Rotation
Hey all... I know there was a post asking about this about 2 years ago...
But is there any way to change the behaviour of the rotation of tokens?
I'm attempting to create a "Car Wars" for FG2, and I need to change the rotational increments to 15 degrees (I think the current is 45)
Any possible way to have this lua scripted yet??? Pleeeeze?
This would make adapting the rules for more rulesets that require counter/tokens to be facing during combat (like ships and firing arcs)
In Car wars (a Steve Jackson game from the 80's) the cars move and face in 15 degree angles during movements
-
November 19th, 2011, 01:20 #2
- Join Date
- May 2010
- Location
- B.C., Canada
- Posts
- 387
Would the token frames be of any use:
https://www.fantasygrounds.com/forum...ad.php?t=15216
I could see having a token with a frame for each angle of rotation.
Oh and Car Wars! Let me know when you get it running, I loved playing that game.
Just don't fail your next Handling roll!
-
November 19th, 2011, 08:27 #3
To change the default token orientation count you may want to take a look at the following method for an imagecontrol: setTokenOrientationCount( count )
setTokenOrientationCount sets the number of different token orientations available in the imagecontrol, evenly spread out along a full revolution.
So for 15 degree angles, try calling the method with a count value of 24 (360/15) in the imagecontrol's onInit() function:
Code:setTokenOrientationCount(24)
FG Project Development
Next Project(s)*: Starfinder v1.2 Starship Combat
Current Project: Starfinder v1.1 - Character Starships
Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
* All fluid by nature and therefore subject to change.
-
November 21st, 2011, 05:05 #4
Awesome, thanks for all of your help. the Frames script as well as the rotation both are very useful.
-
November 22nd, 2011, 04:24 #5
The rulesets (4E and SWEX at least) support hex maps, so along with the image rotation code is a bunch of other "non-square gird" mathematics (distance measuring etc...) and tricks all in the same file. Worth a look.
Car Wars, eh ? Would love to see a copy of that in action ! It's another one of those "used to play all the time, 20 years ago, when I had more time and nearby gamer friends" games that NEEDS a good internet engine behind it. Esp. as it had a lot of fiddlyness of rules that could be nicely streamlined inside FGII.
Would love to see what comes of this, even help out a little if your interested ?Former SW ruleset / Deadlands extension author. Now I just wanna play a few games. And maybe hack. A little.
-
December 7th, 2011, 13:43 #6
Sorry for the dumb question, I dont have a clue on ruleset but I am trying to modify/include that token rotation finer control into the foundation ruleset, what file should I look for? I am guessing this is already defined somewhere...
-
December 10th, 2011, 00:30 #7
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
The function that controls the number of points on the token rotation is called setTokenOrientationCount. You can search through the existing ruleset files to find the places where it is set. (8 = standard square grid, 12 = standard hex grid)
Cheers,
JPG
-
December 10th, 2011, 08:39 #8
Thx! I found it now using the exact string :-)... the search tool I was using didnt work well.
-
December 10th, 2011, 19:10 #9
Lesser Deity
- Join Date
- Mar 2006
- Location
- Arkansas
- Posts
- 7,398
The DOS console "find" command it very good for this type of thing, where you are looking for a string but have no idea what file it is. You can search the whole directory easily. Usually I'll search the whole directory with the /c command and then when I find the files with more than 0 count I'll search each file again with the /n option to get the line numbers in the file where they are. Here's a link to the syntex: https://www.computerhope.com/findhlp.htm
Note despite the name these commands are work in all versions of Windows after Win3X. You just have to open a console window and it's easiest to do that in the directory you want to search.
-
December 12th, 2011, 00:01 #10
Another great way to find what you're looking for across multiple files is the "Find in files" functionality in a number of text editors. A few people on these forums use Notepad++ (a GPL multiple-document text editor with text highlighting for LUA and XML files and xml plugins) which has this search in files facility. The search result window even allows you to double-click on the specific result and it will open up the relevant document - at the line which you clicked on. Very, very handy for tracking down where FG functionality is coded and referenced.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks