Start Pylon WORKING & Yard Incubator Strangeness

Talk about your new mod or map here

Moderators: jelco, bert_the_turtle

brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Start Pylon WORKING & Yard Incubator Strangeness

Postby brice » Wed Apr 25, 2007 5:03 am

Hi to lowell, trickfred, xander and anyone who has wanted the Start Pylon to work. I have figured it out... well at this point I can tell you a recipe for making it work using the original Yard and Generator levels. But I haven't figured out all the details about which parts of the solution are flexible and which are not. I'm posting what I've found. Maybe someone else can hack it a little further, since I'm not really interested in the Start Pylon. This all started out when my construction yard level kept on crashing out and telling me "Incubator on yard level UniqueID not unique"... and there was no incubator in my yard level!! More on that below.

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
Last edited by brice on Mon Apr 30, 2007 9:49 am, edited 2 times in total.
brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Thu Apr 26, 2007 9:13 am

... after thinking a bit I decided I could find some uses for the Start Pylon. So I went ahead and tinkered a bit more. I didn't test all the cases, but I did verify that the level IDs are not hardcoded. Below are minimal entries to get two Start Pylons working in two different levels. They are supported by a lone generator in an inaccessable level. The generator MUST have a control tower even if you never enter the level. You'll notice there is no trunkport in the generator's level. I was wrong in my post above -- no trunkport from the generator to the pylon level is needed. You only need the toggling trunkport in the pylon level.

Code: Select all

Locations_StartDefinition
   # Id  Avail                   mapFile                    missionFile
   # ==================================================================
      1    0              map_generator.txt                    mission_generator.txt
     47    1                  map_pylon.txt                        mission_pylon.txt
     48    1                 map_pylon2.txt                       mission_pylon2.txt
Locations_EndDefinition

Buildings_StartDefinition
   # Id  teamId  locId   type   link  online
   # =======================================
     0     2     47     11      1      1    #trunkport triggering the Start Pylon
     0     2     48     11      1      1    #trunkport triggering the Start Pylon
     0     2      1     14     -1      1    #generator in generator level
Buildings_EndDefinition


Code: Select all

Buildings_StartDefinition
   # Type              id      x       z       tm      rx      rz      isGlobal
==========================================================================
   Generator           0       2518.87 2255.20 0       0.36    0.93    1       -1     
   ControlTower        76      2530.88 2003.62 1       -0.03   -1.00   1       0
Buildings_EndDefinition


Code: Select all

Buildings_StartDefinition
   # Type              id      x       z       tm      rx      rz      isGlobal
==========================================================================
   TrunkPort           0       1744.76 1738.64 1       1.00    0.00    1   1       
   PylonStart          1       1736.21 1821.78 1       1.00    0.00    0   2   0       
   Pylon               2       1409.93 1718.83 1       1.00    0.00    0   3       
   Pylon               3       979.17  1565.12 1       1.00    0.00    0   -1     
Buildings_EndDefinition
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Thu Apr 26, 2007 3:58 pm

Hrm... I have tried to get this to work with the Mac version, and I'm getting no joy. Here is what I have done:
  1. Created two levels -- I will refer to them as "A" and "B."
  2. A contains one Generator (id 0) and a linked ControlTower (id 1). Both of them are set to online status in game.txt, and both of them are on team 2.
  3. B contains a Trunkport (id 0), a StartPylon (id 1), and several Plyons. The StartPylon is linked to the first Pylon, and is triggered by the TrunkPort.
  4. In game.txt, the Generator and ControlTower from A are set to online, as is the Trunkport in B.

That seems to be what you are saying needs to be done. No dice. Am I missing something?

xander
brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Thu Apr 26, 2007 4:45 pm

Nope, I doubt you're missing anything xander. And yup that seems like everything important. Maybe this is a linux vs. the world thing? I'm on 1.4.0b9. If so, that would settle my conscience a little. I mean, how come I'm the only one to figure this out out of so many dedicated & talented modders and so many years? Maybe linux Start Pylons have never been broken? I don't have Darwinia installed on my XP partition, and I haven't booted that for over a year. But I have an extra IV windows license so maybe I'll try someday in the near future. (I'll have to get it running eventually so I can test my mod under windows before I release any betas.)

I just extracted my pylon levels from my test mod and whittled them down for posting. Here's everything except the mission files which are all empty. The two pylon levels are identical. I tried playing both with and without user profiles, and setting the Control tower global and not. I get the pylon action every time. My pylon mod now contains no extra scripts or shapes or files -- just levels and game.txt. No language file from the original game (which might have had a cue embedded), and none of the yard scripts either.

Code: Select all

Locations_StartDefinition
   # Id  Avail                   mapFile                    missionFile
   # ==================================================================
      1    0              map_generator.txt                    mission_generator.txt
     47    1                  map_pylon.txt                        mission_pylon.txt
     48    1                 map_pylon2.txt                       mission_pylon2.txt
Locations_EndDefinition

Buildings_StartDefinition
   # Id  teamId  locId   type   link  online
   # =======================================
     0     2     47     11      1      1    #trunkport triggering the Start Pylon
     0     2     48     11      1      1    #trunkport triggering the Start Pylon
     0     2      1     14     -1      1    #generator in generator level
Buildings_EndDefinition

Research_StartDefinition
   Research Darwinian 0 3
   Research Officer 0 3
   Research Squad 0 4
   Research Laser 0 4
   Research Grenade 0 4
   Research Rocket 0 4
   Research Controller 0 0
   Research AirStrike 0 4
   Research Armour 0 4
   Research TaskManager 0 3
   Research Engineer 0 2
   CurrentResearch Squad
   CurrentPoints 197
Research_EndDefinition

Events_StartDefinition
Events_EndDefinition


Code: Select all

Landscape_StartDefinition
   worldSizeX 5372
   worldSizeZ 5372
   cellSize 15.61
   outsideHeight -26.13
   landColourFile landscape_mine.bmp
   wavesColourFile waves_generator.bmp
   waterColourFile water_default.bmp
Landscape_EndDefinition

LandscapeTiles_StartDefinition
   #                            frac  height desired gen         lowland
   # x       y       z    size   dim  scale  height  method seed smooth  guideGrid
   # =============================================================================
     1659 -14.74   1548   1424  1.55   0.00    257      2      1   0.00     2   AAAAAAAAAAAAAAAAAA
LandscapeTiles_EndDefinition

LandFlattenAreas_StartDefinition
   # x      y       z      size
   # ==========================
LandFlattenAreas_EndDefinition

Lights_StartDefinition
   # x      y      z        r      g      b
   # =========================================
     0.76   0.13   0.64     0.71   0.71   0.71
    -0.99   0.00   0.11     5.00   2.35   0.77
Lights_EndDefinition

Buildings_StartDefinition
   # Type              id      x       z       tm      rx      rz      isGlobal
   # ==========================================================================
   Generator           0       2518.87 2255.20 0       0.36    0.93    1       -1     
   ControlTower        1       2530.88 2003.62 1       -0.03   -1.00   1     0
Buildings_EndDefinition


Code: Select all

Landscape_StartDefinition
   worldSizeX 2000
   worldSizeZ 2000
   cellSize 12.00
   outsideHeight -10.00
   landColourFile landscape_default.bmp
   wavesColourFile waves_default.bmp
   waterColourFile water_default.bmp
Landscape_EndDefinition

LandscapeTiles_StartDefinition
   #                            frac  height desired gen         lowland
   # x       y       z    size   dim  scale  height  method seed smooth  guideGrid
   # =============================================================================
       -6   0.00     -3   2000  1.20   1.00    200      2 7225987   1.00     0
LandscapeTiles_EndDefinition

LandFlattenAreas_StartDefinition
   # x      y       z      size
   # ==========================
LandFlattenAreas_EndDefinition

Lights_StartDefinition
   # x      y      z        r      g      b
   # =========================================
     0.00   2.07   1.00     1.30   1.30   1.30
    -0.75   0.00  -0.67     1.30   1.30   1.30
Lights_EndDefinition

Buildings_StartDefinition
   # Type              id      x       z       tm      rx      rz      isGlobal
   # ==========================================================================
   TrunkPort           0       1744.76 1738.64 1       1.00    0.00    1       1       
   PylonStart          1       1736.21 1821.78 1       1.00    0.00    0   2   0       
   Pylon               2       1409.93 1718.83 1       1.00    0.00    0       3       
   Pylon               3       979.17  1565.12 1       1.00    0.00    0       -1     
Buildings_EndDefinition
Last edited by brice on Mon Apr 30, 2007 9:49 am, edited 1 time in total.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Thu Apr 26, 2007 5:03 pm

Yup. No dice.

xander
brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Thu Apr 26, 2007 5:07 pm

AHA!!!!! Now I really found it! Not a Linux vs. the world thing at all (which made no sense, really). And very sneaky, sorta.

The generator level MUST be called... "generator". That's the key. I can break the mod files I posted above by renaming the generator level to "xenerator". Change it back and the pylons work again.

Try renaming your generator level. I hope it's not already called "generator" ???
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Thu Apr 26, 2007 5:26 pm

Bingo!

Also, I was able to remove the generator and the control tower from Generator, and it still worked. Thus, getting a StartPylon to work requires the following, all in the same level:
  1. A TrunkPort linked to a level called "generator"
  2. A StartPylon toggled by that TrunkPort
  3. In game.txt, there must be a building of type 14 listed as being online in the "generator" level

That's it!

Furthermore, if you don't want the TrunkPort to be say that it is linked to a level called Generator, you can rename that level by putting the following line into strings_default.txt:

Code: Select all

location_generator     <desired text>


For example:
Image

brice, you done did good. You have earned a few respect points.

ImageImageImage

xander
Last edited by xander on Thu Apr 26, 2007 5:57 pm, edited 1 time in total.
brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Thu Apr 26, 2007 5:51 pm

Thanks! :)

xander wrote:Also, I was able to remove the generator and the control tower from Generator, and it still worked. Thus, getting a StartPylon to work requires the following, all in the same level:
  1. A TrunkPort linked to a level called "Generator"
  2. A StartPylon toggled by that TrunkPort
That's it!


I was able to delete the generator and control tower *buildings* from the generator map file, but I still had to make an entry in game.txt for the non-existent generator. Without the "generator online" entry the pylons refused to work. But doesn't faking the building like that open up a can of link worms in the "generator" level?

ALSO... there is no limit to the number of Start Pylons that can be driven this way. I had three (EDIT: ten!) in one level, all working fine. I stacked the trunkports to avoid clutter. EDIT (again!): There is no need for more than one trunkport per level. Multiple StartPylons can be toggled by the same trunkport. Suddenly, free power everywhere!

And thanks for the level renaming trick!

-brice
Last edited by brice on Thu Apr 26, 2007 11:46 pm, edited 2 times in total.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Thu Apr 26, 2007 6:00 pm

Obviously, you didn't read my post very carefully. You completely missed step 3! Also, the edit that occurred after you posted was just to fix grammar! Yes, that's the ticket! Grammar!

Indeed, you are correct. There needs to be a building of type 14 listed in game.txt. That building doesn't have to exist, but it has to be listed. It must be online, but can be on any team. The control tower line does not have to be there.

xander
brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Thu Apr 26, 2007 6:12 pm

Can't top MrBunsy for grammar responses...

MrBunsy wrote:
KingAl wrote:If this isn't what you're talking about, then I've got no idea.

her tidy herd waves above a far shock so why does the pan chancellor reform a war fear and the curly arrow revenges a tongue opposite the taking faucet

What's the question that's actually being asked?


Oink!

(EDIT: it was better before I read it too closely... talking faucets and revenging tongues! (edited the post above too.))
User avatar
Shwart!!
level5
level5
Posts: 1237
Joined: Sun Nov 12, 2006 1:36 am

Postby Shwart!! » Fri Apr 27, 2007 4:42 am

Impressive. I was unaware that they were ever broken- but now I know how to get them to work... woohoo... This circumvents what could have been massive frustration in my own modding work. :)
Nice job, Brice.
EDIT: You've probably gained just as much respect right there as I've accumulated in six months of being here... :( *sniff*

Shwart!!
Last edited by Shwart!! on Fri Apr 27, 2007 3:24 pm, edited 1 time in total.
martin
level5
level5
Posts: 3210
Joined: Fri Nov 19, 2004 8:37 pm

Postby martin » Fri Apr 27, 2007 8:35 am

yay, now all those levels that have solar panels in Depletion can be rebuilt to use a trunk port... hang on, is being forced to rebuild a *good* thing? ;)

No seriously, thats really cool brice, well done :D
GENERATION 22:The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Fri Apr 27, 2007 3:51 pm

martin wrote:yay, now all those levels that have solar panels in Depletion can be rebuilt to use a trunk port... hang on, is being forced to rebuild a *good* thing? ;)

In your case, martin, yes.

xander
martin
level5
level5
Posts: 3210
Joined: Fri Nov 19, 2004 8:37 pm

Postby martin » Fri Apr 27, 2007 5:12 pm

xander wrote:
martin wrote:yay, now all those levels that have solar panels in Depletion can be rebuilt to use a trunk port... hang on, is being forced to rebuild a *good* thing? ;)

In your case, martin, yes.

xander


¬¬

Well thanks for that xander :P
GENERATION 22:The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.
User avatar
Lowell
level3
level3
Posts: 428
Joined: Mon Jan 02, 2006 8:03 pm
Location: Atlanta, Georgia
Contact:

Postby Lowell » Fri Apr 27, 2007 5:22 pm

OMG!

I really need to check back here more than once a month...

The Start Pylon is a major player in several levels of my mod.
Now I can fix my old levels and move forward with part two of The_Partricles_Within....(plug) :D

This is Great news....Thanks

All I need do is make a generator level hidden from the player...I guess I could link all levels that would have a start pylon to the same hidden level. That's an easy fix.

Return to “Mod Projects”

Who is online

Users browsing this forum: No registered users and 4 guests