Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

beng Offline
#1 Posted : Wednesday, November 17, 2021 3:00:11 AM(UTC)
beng
Captain
Joined: 4/8/2009(UTC)
Posts: 57
Location: In a house

Thanks: 5 times
Was thanked: 5 time(s) in 3 post(s)
When making or editing a map in worldbuilder, it is sometimes possible to end up with duplicate waypoints, that is, waypoints that have the same name.

This can happen if you give a waypoint a name like "Waypoint 245" when the game has not yet created such a waypoint name automatically (as it does when you add new waypoints to a map), and you then then create a waypoint path - the game will autogenerate waypoint names including the one you manually added.

It can also happen when you delete a waypoint path and add a new waypoint path. Sometimes it autogenerates waypoint names that already exist.

You may be alerted to the existence of duplicate waypoint names when you open the map in wolrdbuilder, click on a waypoint, and try to use the drop-down list of waypoints to see a list of existing waypoints. Worldbuilder may then give you a popup warning dialog box saying "Name already in use," without saying which name is already in use.

I had this problem and did not know how to find the duplicate waypoints. After some helpful advice by Adriane from CnC ZH Worldbuilders discord channel, who said I could dump the map to the file to get a list of waypoints in the map, which I could then process to find waypoints that have the same name, I managed to do it. Here's how:

Open worldbuilder, run as Administrator so it can write to the game install directory.

Open the map in worldbuilder.

Under File menu, click "Dump Map To File", it will take a few seconds to dump the map.

Go to your game install directory (where Generals.exe is) in windows explorer and sort the files by date. The dumped file will be at the top, it will have the name of your map and end in .txt

Open the dumped map text file in a text editor and find the block that lists all the waypoints. It will look something like this:

Code:

Waypoints
  Waypoint 21, @ 23.54
  Waypoint 20, @ 15.67
  Waypoint 19, @ 20.46
  Waypoint 18, @ 15.63
  Waypoint 17, @ 18.45
  Waypoint 16, @ 19.56
  Waypoint 15, @ 33.71
  Waypoint 14, @ 35.85
  Waypoint 13, @ 29.74
  Waypoint 12, @ 31.81
  Waypoint 11, @ 24.74
  Waypoint 10, @ 42.79
  Waypoint 9, @ 49.75
  Waypoint 9, @ 43.68
  Waypoint 4, @ 45.58
  Waypoint 6, @ 55.52
  Waypoint 5, @ 49.45
  Waypoint 6, @ 51.66
  Waypoint 3, @ 41.51
  Waypoint 2, @ 31.55
  Waypoint 1, @ 34.68
End of Waypoints


You can then copy that list of waypoiints out and process it to find duplicates. There are text editors that can do a regular expression search to find duplicates but since I don't know how to use regular expressions, I used MS Excel spreadsheet to do it. Here's how:

Paste the list of waypoints into Excel in one column.

Sort the column alphanumerically

In the next column, put a forumla to use FIND to return the position of the comma in the text string.

In the next column, put a formula that uses LEFT to return the text up to the comma, this will get rid of the stuff after the comma.

In the next column, put a forumla that compares the cell in the previous column to the one above it and if it is the same, output some warning text like "DUPLICATE" else put "ok".

This should let you find the duplicate waypoint names. Next you have to find them in worldbuilder so you can rename one set of them (I just add the letter "a" to the name of one of them). You can find them using the coordinates in the waypoint list from the dumped map file. The waypoint coordinates in world builder are 10 times those in the dumped file. For example, if the dumped file says: "Waypoint 1, @ 34.68" then in worldbuilder you will find Waypoint 1 at around coords 340, 680.

I will attach a sample excel file so you can see the formulae.
File Attachment(s):
Duplicate Waypoints Finder.xls (78kb) downloaded 0 time(s).
 1 user thanked beng for this useful post.
SUPER-G on 11/17/2021(UTC)
Sponsor
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.6.1 | YAF © 2003-2021, Yet Another Forum.NET
This page was generated in 0.540 seconds.