About the Start Pylon: the bottom line is that the game is sneaking a peek back into the linked levels to check for building status. It goes deeper than checking the entries in the game.txt building list. The Start Pylon wants to see three things: a) it's own triggering trunkport online, b) a generator online in another level, and c) a trunkport in that level pointing to this level, also online. (EDIT: c) is wrong... see the post after this one.)
But it is very picky. One of the things I tried was to place an unlinked generator in a test level I already had, and then fake the online status in game.txt, but this didn't work. It was strange. When I entered my yard level (with the start pylon) it would render a few frames then crash out... IFF the generator was present IN THE OTHER LEVEL! But if I removed the generator from the unplayed level, and just faked the game.txt online link, then my yard level played happily except the start pylon was off. Why did a building in another level affect my yard level? Behind the scenes probing by the engine.
Here's the recipe I used to make the Start Pylon work. If anything's unclear, just post and I'll try to clear it up.
Copy both the Yard and Generator levels out of the regular game. You'll need the yard scripts and the language file. My copy of the yard became level id 45 in my test mod, but I made room for the generator as level id 4 like it is in the original. I don't know if any of the level id's are hardcoded anywhere -- obviously the yard id isn't. The generator level id probably isn't either, but I didn't check.
Code: Select all
Locations_StartDefinition
# Id Avail mapFile missionFile
# ==================================================================
4 1 map_generator.txt mission_generator.txt
45 1 map_yardgame.txt mission_yardgame.txt
Locations_EndDefinition
Buildings_StartDefinition
# Id teamId locId type link online
# =======================================
5 2 45 11 4 1 #trunkport triggering the Start Pylon
7 2 45 11 5 1 #trunkport triggering the Track Start
0 2 4 14 -1 1 #generator in generator level
23 2 4 11 45 1 #trunkport in generator level (to yard)
Buildings_EndDefinition
Next enter the above lines into your game.txt. I also nulled out all the other trunkports in both levels using -1 links. I don't know if the exact BUILDING ids are hardcoded into the game. It may be that only the links are checked, but I have reason to believe that some of these building ids are hardcoded. I just haven't spent the time to test all the cases. (I probably won't.)
That's it! You should be able to start up the yard and see the Start Pylon feeding the Yard with power!
One thing I noticed is that both the Yard and the Generator are building id 0 in these levels, and many of the important links are single digit ids. Now let me tell you why I started looking into this in the first place.
I had a test level with a yard and solar panels and some other stuff. While I was tinkering, occasionally the level would crash on entry (level entry, not game entry) and would tell me the UniqueID of a non-existant Incubator was not unique. I noticed that building ID #2 had become a gap and when it was taken by anything the level would crash with this message. But when id 2 was empty the level worked fine. So I thought: somehow the Yard building is hardcoded to look for an Incubator at building ID 2.
And sure enough in the original Yard level there is an incubator with id #2 in the mission file. I have no idea if the yard still cares. It doesn't seem to behave differently if the incubator is online or off. But it complains anyhow. AND when I tried inserting my own incubator as building id 2, the level still crashed if it wasn't dynamic! The yard is that picky. Dynamic incubator 2 and the yard is happy.
So with the Start Pylon I suspect some of the building ids might be hardcoded. But then again they might not be. And the level id for the generator might be flexible, or maybe not. If you really want your Start Pylon you know what to do from here...
Hopefully someone else sees a live Start Pylon too... please let me know. Maybe I've been staring at the screen too long. Probably.
P.S. -- Watch out for how you edit the copied yard level. If you have no user game.txt and you start darwinia and go straight to the editor (and save), then when you try to play the level it will crash after rendering a few frames. You don't have to actually edit anything, just enter the editor, save and exit. But the level will load fine when you re-enter the game after the crash. If you start with no game.txt and go directly to the level all is well. These older hardcoded buildings are quite flaky. AND this bug may account for the crashing I mentioned above with the faked generator. Hard to know what's going on when just editing causes crashes every other try... I'm glad I saved the yard for last in my modding tests.
P.P.S. -- I later removed the yard from the original yard level. The Start Pylon still works without it when set up as above.
-brice