<< Back to Map Development Forum   Search

Posts 1 - 20 of 21   1  2  Next >>   
How do I modify all the Id's: 2/12/2012 20:45:29


WomboFistMasterBlasterExtraordinare-Lemonshire
Level 3
Report
Hey I'm developing this massive map but my Id's are Territory_1-??-????, how can I edit all of them to get rid of the (-) ?
How do I modify all the Id's: 2/12/2012 20:46:53


Richard Sharpe 
Level 59
Report
The only way I know of to label all of the territories is by sheer brute force... manually. They all have to have different numbers after all.
How do I modify all the Id's: 2/12/2012 21:50:43

RvW 
Level 54
Report
Wait, aren't SVG files not just XML files? Then you could open them up in a text editor (Notepad if you don't have anything else, UltraEdit or Notepad++ or whatever if you have it) and simply do a *very* carefully specified "Replace All".

---

### Important:
If you want to try this, make sure you're working on a *copy*; making a mistake will likely trash your file completely and irreparably!

---

Example, to turn

- Territory_1-01
- Territory_1-02
- (..)
- Territory_1-42

into

- Territory_01
- Territory_02
- (..)
- Territory_42

you could replace-all "Territory_1-" with "Territory_". Do *not* simply replace-all "1-" with ""; it's very possible your SVG will contain a "1-" somewhere which shouldn't be replaced.

Another important thing is *not* to use an editor (such as MS Word or LibreOffice Write) which supports text formatting and layout; if it inserts codes for that, the file will be ruined as well.
How do I modify all the Id's: 2/12/2012 22:03:25


Richard Sharpe 
Level 59
Report
RvW... that would still leave the numbers after the dash (Territory_1-XX-XXXX) and would still require manually inputting the numbers.
How do I modify all the Id's: 2/12/2012 22:46:43

RvW 
Level 54
Report
Wombo, after reading Richard's second reply, I think maybe I misunderstood your question. Could you give an example of four or five territory names, both what they are now and what they should become? I'm fairly certain your problem can be solved (without too much manual work), but I need more details in order to be able to decide *how exactly*.
How do I modify all the Id's: 2/12/2012 23:50:36

Fizzer 
Level 64

Warzone Creator
Report
You could do this using regular expressions. Open the svg file in Notepad++ (free app), do a Find/Replace, select Regular Expressions and enter this:

Find what: "Territory_(\d+)[^"]*"
Replace with: "Territory_\1"
How do I modify all the Id's: 2/12/2012 23:54:59

Fizzer 
Level 64

Warzone Creator
Report
And like RvW said, save a copy before you do it. If something gets messed up you can use the copy to try again.
How do I modify all the Id's: 2/13/2012 00:25:35


WomboFistMasterBlasterExtraordinare-Lemonshire
Level 3
Report
It comes out like this Territory_1-12121-13131-1313-13-1
Territory_1-1213-13131-01313-130
Territory_1-12131-12-32131-1230
How do I modify all the Id's: 2/13/2012 05:11:17

RvW 
Level 54
Report
Out of curiosity (and possibly as a clue towards solving this) where do those IDs come from...? I doesn't look like something you would've typed in by hand, were they generated somehow?

If I understand Fizzer's RegEx correctly, it will turn all your territory names into "Territory_1", which (given the example in your last post) unfortunately won't help you. (But, just to be sure, feel free to try, I could be wrong!)

If Fizzer's suggestion indeed doesn't work, let's see what we can do to solve it. From the [WL Wiki](http://wiki.warlight.net/index.php/Creating_the_SVG):
|> Inkscape will tell you if you try to re-use the same number more than once (it will say "id exists!"), so you don't need to pay super close attention to where you left off in the numbering. Also, you don't need to use every number - it's okay to jump around (for example, skipping from Territory_11 to Territory_19.) This is also good if you decide to delete one; you don't need to go back and fill in the gap.

Now, on the one hand that's good news; territory numbers don't have to be consecutive. On the other hand (and I obviously don't know for sure, maybe Fizzer can clarify), I wouldn't be surprised at all if WL doesn't just look for something which "is a number", but also uses the actual values of those numbers internally. If that is indeed the case, *huge* numbers could become a problem. If not, you can simply strip out all the dashes and it should work.

Disclaimer: I'm not a RegEx wizard and I'm not familiar with Notepad++'s RegEx dialect, but I expect the following will remove the first dash from a number:

Find what: "Territory_(\d+)-"
Replace with: "Territory_\1"

(I think Fizzer's expression was supposed to be entered *including* the quotation marks, but mine is supposed to be entered *excluding* the quotation marks; they're just there to show the beginning and end of what you should enter.)

Just run that multiple times, until it complains it can't find anything to replace. Then, try to open it in Inkscape and hope for the best. It is *possible* (but, until I know where those weird numbers came from, I cannot tell how *likely*) territory names which used to be distinct will become the same. For instance, both of the following:

Territory_1-1213-13131-01313-130
Territory_1-12131-31-310131-3130

will become

Territory_112131313101313130

which will still result in a broken SVG file... And, like I said above, even if Inkscape can open it (if the SVG file is technically valid), the ridiculously huge numbers can still break as soon as you upload the file to WL. (So, *don't* delete your original file just yet; I'd recommend keeping it at least until the map goes public, just to be perfectly sure you don't delete it too early.)
How do I modify all the Id's: 2/13/2012 15:50:15

Grzechooo 
Level 32
Report
\1 is a regex backreference (e.g. this thingie in brackets).
How do I modify all the Id's: 2/14/2012 00:28:19

RvW 
Level 54
Report
@Grzechooo:
Yes, it is. But ehm, who are you talking to / what question are you answering...!?
How do I modify all the Id's: 2/20/2012 23:47:06

RvW 
Level 54
Report
@Wombo:
Did it work, or do you need more help?
How do I modify all the Id's: 2/24/2012 22:01:48


WomboFistMasterBlasterExtraordinare-Lemonshire
Level 3
Report
Oh hey I went through the long task of editing every single cell. but my map still isn't finished yet (I have to name every single one). Sad face. Oh but I sort of have a different problem now. How big can I get my map and is this too big? http://warlight.net/SinglePlayer.aspx?PreviewMap=10854
How do I modify all the Id's: 2/25/2012 11:01:34


Moros 
Level 50
Report
Okay, that's a pretty weird map...
But I think some territories haven't got any space for army numbers, have you checked with the "Show Example Armies" button?
And, there no connection lines that indicate what territories connect when they don't actually touch.
And the maximum amount of territories on a map is 3200, so it isn't too large.
How do I modify all the Id's: 2/25/2012 11:10:21

RvW 
Level 54
Report
|> I went through the long task of editing every single cell

Uhm yeah, that works as well I guess. Doesn't sound like a very fun job though... :s

---

|> Oh but I sort of have a different problem now. How big can I get my map and is this too big?

Well, since WL let you upload it and displays it in the map previewer, I'm going to assume it doesn't have any issues with the SVG file (if it was going to complain, it would've done so a lot earlier).

---

Did you intentionally leave all the small boxes unaligned, just putting them "generally in the right area"? It looks very chaotic and like you were in a hurry; I think the map would look much nicer if all the territories (the rectangular ones at least) would nicely line up.

You *really* need to include connection lines. Especially those stars connect to pretty random territories. The connections from one word to another are also far from obvious. Currently this map would be a nightmare to play on.

Speaking about those stars, it is uncommon to have single (or even double) territory bonuses. When a map just calls for such a bonus (such as the Washington DC bonus in US Big), then they are only worth one army. You have single territory bonuses worth **7** armies...!? To make matters worse, they only connect to a single other territory, making them easily defensible.
Simply put, currently I'd call this map "unplayable". With manual distribution players will at least have an equal chance of claiming those "money printing" bonuses, but with automatic distribution, one player will get a near-unbeatable advantage right at the start. It's not just getting 7 extra income every turn (even though after a couple dozen turns that means hundreds of extra armies), under default settings *more than doubling* his income, it also means that player will capture other bonuses earlier, making the advantage bigger and bigger.
Sure, you could attempt to fix it by leaving them out of distribution modes (and hoping nobody will use the "Full distribution" which is automatically added to every map), but even then, the player spawning closest to one of those stars has basically the same advantage.

---

You'll probably hate me for saying this (and if I had known about your plans, I would've told you this before you spent lots and lots of time on creating this map), but... who do you expect will play this map? To be perfectly frank, for people who don't know your "Team S" (I expect only very few people will know it), why play on this map? Strategically it doesn't seem to offer any benefits over USA Big. It feels like you wanted to make the biggest map on WL and, even though the map you had in mind didn't need that many territories, you did it anyway...
How do I modify all the Id's: 2/26/2012 04:11:52


WomboFistMasterBlasterExtraordinare-Lemonshire
Level 3
Report
Actually I sort of arranged my Team S map according to the Hierarchy of Team S being that the 7 sin (those stars) are the bridges between various factions and eventually linked up to the S. I had them connected to multiple territories so that they would be hard to defend (given if you placed the army bonus at 15). I arranged the um...the words so that they were each isolated into this island sort of thing and the main continent was the T-E-A-M-S. The map isn't finished yet though. I get what your saying, however, I do like the chaotic nature of this map. My friends and I had an extremely difficult time with the ai so we were forced to band together. I do plan on making the map bigger as well. I sort of created this map to make the ai more challenging (because in all the other maps, the ai were always running away) and it always ended up in this sort of one on one with my friends. I'll distribute more bonuses to even out the playing field against those stars. Will that work?
How do I modify all the Id's: 2/26/2012 04:12:36


WomboFistMasterBlasterExtraordinare-Lemonshire
Level 3
Report
And I'll try to make it prettier as well.
How do I modify all the Id's: 3/4/2012 07:55:09


WomboFistMasterBlasterExtraordinare-Lemonshire
Level 3
Report
Oh hey how do I make connection lines?
How do I modify all the Id's: 3/4/2012 09:04:52


Moros 
Level 50
Report
The same as how you make territories, but then you don't give them any ID.
How do I modify all the Id's: 3/4/2012 09:38:40


WomboFistMasterBlasterExtraordinare-Lemonshire
Level 3
Report
Is it the calligraphy thing?
Posts 1 - 20 of 21   1  2  Next >>