<< Back to Map Development Forum   Search

Posts 1 - 20 of 25   1  2  Next >>   
Remove all bonuses & connections with API?: 7/18/2021 16:20:25

guezt1234
Level 56
Report
I am trying to write a tool that automatically update a map. I would like to start from a clean slate in terms of the bonuses and connection. Can the set_map_details (https://www.warzone.com/wiki/Set_map_details_API) API do that? If not, can we have this new feature?

I try adding the same bonus for twice with two `addBonus` commands. But that gives me two new bonuses with the same name.

Edited 7/18/2021 16:23:10
Remove all bonuses & connections with API?: 7/18/2021 16:23:37


JK_3 
Level 63
Report
I know for sure that you cannot remove connections from the API, and I guess that applies to Bonuses as well (even if the wiki doesnt say anything about it).

If you are trying to start clean, you must either manually remove all connections and bonuses, or upload a new version of your map and set all the territory names again.

(Or maybe you could make a game on the current map, use the API to get all the [terr_id, terr_name] combo's and then use the API to automatically restore the territory names.)
Remove all bonuses & connections with API?: 7/18/2021 16:31:30

guezt1234
Level 56
Report
Did anyone ask for this feature?
Remove all bonuses & connections with API?: 7/18/2021 16:35:02


JK_3 
Level 63
Report
You're the first person i've heard of that is considering using the Map making API tbh, so I doubt people have requested it....

I dont know if it would even make sense to have. Its for setting map details, and if you have a bot that sets the details properly, it shouldnt make any mistakes, so giving an option for a bot to remove it makes little sense to me.
Remove all bonuses & connections with API?: 7/18/2021 16:40:29

guezt1234
Level 56
Report
It is for updating a map. If I make a new map instead of updating an old map, I lose all the ratings / reviews.

Edited 7/18/2021 16:42:01
Remove all bonuses & connections with API?: 7/18/2021 16:41:58


JK_3 
Level 63
Report
Cant you make a new version of the original map (by duplicating the Public version) instead of making a new map?
Remove all bonuses & connections with API?: 7/18/2021 16:47:06

guezt1234
Level 56
Report
Erh. If I make a new version, the old bonuses / connections are still there. If I want to change the value of a bonus, I have to manually remove the old bonus and then use the API to add a new one. That makes using the API to automate things pretty pointless. This is a nightmare for INSS maps. Same for removing old connections.

Edited 7/18/2021 16:49:02
Remove all bonuses & connections with API?: 7/18/2021 16:48:15


JK_3 
Level 63
Report
Yes, I just noticed that when testing my theory.

It appears that uploading a different SVG clears everything, but I'm currently trying to figure out how much you need to change.
Remove all bonuses & connections with API?: 7/18/2021 16:50:12


JK_3 
Level 63
Report
Just adding a 1x1 px box was enough to clear the connections.
Remove all bonuses & connections with API?: 7/18/2021 16:51:19

guezt1234
Level 56
Report
In my experience, creating a new version and then uploading a new svg (or re-upload the old svg) doesn't clear the bonuses, connections, and center points inherited from the old version. If you shift the territories in the svg, the center points will still be at their old coordinates.

Edited 7/18/2021 16:52:55
Remove all bonuses & connections with API?: 7/18/2021 16:52:34


JK_3 
Level 63
Report
Well the SVG needs to be different from the SVG currently stored on the server, uploading the same SVG file as the original map won't work.
Remove all bonuses & connections with API?: 7/18/2021 16:57:45

guezt1234
Level 56
Report
That didn't work for me. I did the following steps:

1. Use svg A to create map 1 version 1.
2. Edit the map 1 to add 2 connections.
3. *Save it.*
4. Upload svg B.
5. Notice the old center points, bonuses, and connections are still there.
6. Duplicate map 1 version 1 to make version 2.
7. Repeat the same steps, except upload svg C.
8. Notice the old center points, bonuses, and connections are still there.

I tried the steps with the svg for 3 of my maps.

Edited 7/18/2021 16:59:05
Remove all bonuses & connections with API?: 7/18/2021 16:58:47


JK_3 
Level 63
Report
Thats interesting, that doesnt line up with my testing...


What were the differences between svg A and B?
Remove all bonuses & connections with API?: 7/18/2021 17:00:25

guezt1234
Level 56
Report
svg A: from https://www.warzone.com/Map/41859-Urban-Popcorn
svg B: newest version of urban gridlock: https://www.warzone.com/SinglePlayer?PreviewMap=95612
svg C: https://www.warzone.com/Map/41894-Urban-Power-Grid

The three svg are completely different.

Test result:
https://www.warzone.com/SinglePlayer?PreviewMap=95579#

Click on example armies numbers to see the messed up center points.
The south america bonuses are added with the API.

Edited 7/18/2021 17:05:27
Remove all bonuses & connections with API?: 7/18/2021 17:07:04


JK_3 
Level 63
Report
All I had to do to clear all connections, bonuses, territory names and distributions from ugly shapes (https://www.warzone.com/Map/33759-ugly-shapes) was put a tiny rectangle on the map. In the image below it is colored light blue, but in my uploaded map it was the same black as the background.

Remove all bonuses & connections with API?: 7/18/2021 17:16:18

guezt1234
Level 56
Report
Can I see a link to the version of the map with the extra rectangle?
Remove all bonuses & connections with API?: 7/18/2021 17:20:47


JK_3 
Level 63
Report
Remove all bonuses & connections with API?: 7/18/2021 17:38:27

guezt1234
Level 56
Report
Interesting. The old bonuses are still there (for example, blitzkrieg N in https://www.warzone.com/SinglePlayer?PreviewMap=95618#).

Since clicking on the bonuses don't highlight any territory, probably the IDs of the territories in the .svg file changed.

That means it is possible that the old connections are also still there, but since the ID changed, it connects nothing to nothing. That can make the connections apparently gone. I can't know for sure because I can't see the green lines in the editor.

Edited 7/18/2021 17:46:48
Remove all bonuses & connections with API?: 7/18/2021 17:57:51


JK_3 
Level 63
Report
There are no green lines anymore in the editor, so the connections are all gone.

Funny thing is that the ID is still the same (or at least should be), because I didn't change those and the ID's are based on the names of the objects in Inkscapes.
Remove all bonuses & connections with API?: 7/21/2021 19:40:32


JK_3 
Level 63
Report
Any updates on your situation @guezt?
Posts 1 - 20 of 25   1  2  Next >>