stubby3596
Amateur Golfer
Posts: 263
TGCT Name: stubby3596
|
Post by stubby3596 on Nov 29, 2020 10:23:39 GMT -5
If you are like me and are new to the game with only the 2K21 software to run there is a small issue with the current designer tools that will prevent you from loading your created .course file natively in 2K21. If you have TGC 2019 you can create the .course file, open it in TGC 2019 and then open in 2K21 and you are in working.
If you are like me though and only have 2K21 installed this is not an option but there is a workaround.
To make this work you need to install python and run a small script. You can get python here: www.python.org/downloads/ and then create a .py file with the following code.
--- import gzip import json from pathlib import Path course_file="C:\\temp\BV3\BocaVistaEx.course" course_file_2K21=Path("C:\\temp\BV4\BocaVistaEx2K21.course") with gzip.open(str(course_file), 'r') as f: file_content = f.read() course_json = json.loads(file_content.decode('utf-16')) output_string = json.dumps(course_json, separators=(',', ':')) # Write to final gz format output_gz = gzip.compress(output_string.encode('utf-16LE'), 1) with (course_file_2K21).open('wb') as f: f.write(output_gz)---Create your .py file (dothething.py) and copy in the above code and make changes to the course_file and course_file_2K21 variables and save the .py file.
Open a command prompt on your computer and run
python dothething.py
This will create a .course file that you can drop in to your 2K21 courses directory and you should now see it listed in the designer. Long term I will work with Chad to get this small change made to the main tool so you don't have to use this workaround step but for now I wanted to share this information.
|
|
|
Post by mvpmanatee on Nov 29, 2020 11:07:21 GMT -5
I was just talking about this issue this morning. You read my mind! I am definitely going to give this a go.
|
|
|
Post by pobee10 on Nov 29, 2020 11:33:14 GMT -5
Awesome, thank you!
|
|
stubby3596
Amateur Golfer
Posts: 263
TGCT Name: stubby3596
|
Post by stubby3596 on Nov 29, 2020 13:56:14 GMT -5
Let me know if you have issues getting Python working.
|
|
|
Post by daddyb on Dec 5, 2020 4:10:22 GMT -5
Hi stubby! Thank you for doing this. I have a quick question as a Python noob. Do I run this script on a .course file that I have already altered with Chad's tool?
Also, for the variables what paths do I choose? I assumed that the course file variable is just the course file. What is the course_file_2k21 path supposed to lead to? I set the script up but when I run it, nothing happens.
|
|
stubby3596
Amateur Golfer
Posts: 263
TGCT Name: stubby3596
|
Post by stubby3596 on Dec 5, 2020 11:41:42 GMT -5
Hi Daddy,
Yes, you need to run through Chad's tool start to finish and you will get a .course file created. You then run this script against that file and have it produce a second course file. You need to adjust the paths for where your first file is and the script will generate the second file. The second file will be exactly the same size but under the covers it's a little bit different.
It is is doing is unpacking the original file and repacking it in a way the gane can understand. Send me a DM if you still can't figure it out.
|
|
|
Post by virtualgolfer65 on Dec 5, 2020 14:50:09 GMT -5
I used your fantastic tool to fix my lidar .course file yesterday. I had issues, since I thought I had to include the course name in both paths and it kept giving an error. Once I only included the path to my .course file in the first path and ran the tool and that led to SUCCESS! Great script and many thanks! Hi Daddy, Yes, you need to run through Chad's tool start to finish and you will get a .course file created. You then run this script against that file and have it produce a second course file. You need to adjust the paths for where your first file is and the script will generate the second file. The second file will be exactly the same size but under the covers it's a little bit different. It is is doing is unpacking the original file and repacking it in a way the gane can understand. Send me a DM if you still can't figure it out.
|
|
stubby3596
Amateur Golfer
Posts: 263
TGCT Name: stubby3596
|
Post by stubby3596 on Dec 5, 2020 17:10:08 GMT -5
Good to hear. One issue I had with Python was that the first double back slash is required. It's a Python thing which I don't really know very well so I just went with it.
|
|
|
Post by mvpmanatee on Dec 5, 2020 19:12:08 GMT -5
|
|
|
Post by professorrosseforp on Jan 19, 2021 22:22:29 GMT -5
Awesome work! I have run into one problem. I lose the trees when I import. Any insight?
I am going to try to use a different type of course(countryside instead of autumn) but I don't have high hopes.
|
|
stubby3596
Amateur Golfer
Posts: 263
TGCT Name: stubby3596
|
Post by stubby3596 on Jan 19, 2021 23:02:44 GMT -5
What I found is that there is a difference between how trees are stored between the 2019 format that Chad's tool produces and the format that the 2K21 designer expects. There is a VERY rough way to make it work if absolutely needed but again, its pretty rough. I made it work but ended up not being super happy with how all the trees imported anyway so I ended up deleting most of them anyway.
Hit me up 1:1 if you want to give it a try but its pretty finicky.
|
|
|
Post by bruzer79 on Feb 24, 2021 11:41:24 GMT -5
I came to the site and registered to ask questions about this issue... Glad I ran across this post. Time to install python. Thanks for the walkthrough
|
|
DDawg
Amateur Golfer
Posts: 186
|
Post by DDawg on Apr 9, 2021 14:35:01 GMT -5
this is a great find ... very promising ...
|
|
|
Post by st6132 on Apr 27, 2021 2:27:28 GMT -5
How about the reverse? I have both 2019 and 2K21. I’m working on a lidar course which I have imported into 2K21 and done quite a bit of work on. Having gotten quite far down the line, I’d quite like to use Chad’s tool again to shift the plot/reorientate the course. However, you can’t open a 2k21 .course file in Chad’s tool. Any way around this please?
|
|
mal
Amateur Golfer
Posts: 214
|
Post by mal on Apr 27, 2021 6:29:57 GMT -5
How about the reverse? I have both 2019 and 2K21. I’m working on a lidar course which I have imported into 2K21 and done quite a bit of work on. Having gotten quite far down the line, I’d quite like to use Chad’s tool again to shift the plot/reorientate the course. However, you can’t open a 2k21 .course file in Chad’s tool. Any way around this please? Unfortunately there isn't.
|
|