Need basic advice for my first playfield mod

Discussion in 'Custom Playfields & Systems' started by japp_02, Aug 8, 2022.

  1. japp_02

    japp_02 Commander

    Joined:
    Feb 11, 2021
    Messages:
    524
    Likes Received:
    200
    Hi,
    I want to slightly modify the starter system with the 4 moons by placing in a first step a Zyrax Compound on Akua, and in a second step make messages appear if the player triggers some meeted conditions (precisely, if he destroys the faction core of said compound - or a block surrounding the core).
    I'd like the entire modification to appear when I start a survival game with any random seed and all possible difficulty levels.

    For achieving the 1st step, my idea is to use an existing POI (in red from the prefab folder) that I spawn in a Creative game and make modifications on the fly there and save a blueprint. I would then add this blueprint back in the main Prefab folder and would need to add this new entry in a game file. But which one?
    Or is there a better method for making changes to a faction POI that will apply later in a survival game?

    For all these purposes, my question also is
    Would it be correct to follow the instructions in this thread?
    https://empyriononline.com/threads/how-to-add-custom-playfields-to-your-game.91658/

    If yes, from where exactly would I need to take these files from? From the main game content folder or from a specific save folder if you've made the necessary modifications using a savegame?

    For the 2nd step, I would highly appreciate a link where I can find more info about how to create messages in a faction POI, not sure where to start with this.

    Thank you very much!
     
    #1
  2. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    226
    You need to modify the files in the save folder unless you are starting fresh each time, I've never had the patience to do this so I make changes and start fresh after each change, very tedious. I've never edited more than one line in a playfield, but that thread linked is probably the best we have.

    As for triggers, you will need to jump into the online playfield editor thread and get started with the browser based tool that rexxus maintains. Remember to send a tip, sorry I'm no expert in either of these. I have a real paying day job unlike most everyone who does know these things. Ha Ha.
     
    #2
  3. japp_02

    japp_02 Commander

    Joined:
    Feb 11, 2021
    Messages:
    524
    Likes Received:
    200
    Thank you Zaphodikus, I appreciate. I see now clear about which file I have to modify, in order to spawn an existing POI in a survival game playfield I must look in the Scenarios > Default Random > Sectors, which will reference all necessary playfields. It leads me to the 'MoonTemperateStarter' playfield for Akua in which I must modify the playfield_static.yaml (I delete the corrisponding .bin file).

    I have done some first tests by taking another moon of the same size and tried to add a T1 zyrax drone base from it into my Akua file, in the Random group, but after starting the game, in the console I get the message that...

    the game "has failed to make a random placement for this POI after 2001 iterations"

    and the POI has not been spawned.
    There are 2 values that I've tried to change after that, first I changed the
    LevMod: +4 into LevMod: +2, thinking the base will now spawn if you reach level 2, but nada, I get the same message;
    Then I check the 'Biome:' line, there are 4 values in it that are present on the moon, I'm, certain, I then delete the entire Biome line but no change, still the message appears. Maybe I should have left 1 Biome value to make the random spawn almost a certainty?

    Thanks for anyone to point me what to do in the case you get the message of non-placement here above!
     
    #3
    Last edited: Aug 9, 2022
  4. jmcburn

    jmcburn Rear Admiral

    Joined:
    Jan 15, 2017
    Messages:
    1,113
    Likes Received:
    1,759
    Try to add the new RandomPOI as the first entry in the list of Random POIs in the playfield. The game works its way down from top to bottom in the list trying to place them.

    Putting it higher in the yaml raises the chance of the game finding a suitable spot for it.

    Alternatively you can add

    IsImportant: True

    to the POI.

    /jmc
     
    #4
    zaphodikus and japp_02 like this.
  5. japp_02

    japp_02 Commander

    Joined:
    Feb 11, 2021
    Messages:
    524
    Likes Received:
    200
    Thank you jmcburn, I will try this, the Important: True is already set.
     
    #5
  6. japp_02

    japp_02 Commander

    Joined:
    Feb 11, 2021
    Messages:
    524
    Likes Received:
    200
    With the tip above it works like a charm now, I still get a Not Referenced exception but I think that's not directly related and I can go on, everything is there, the zyrax territory in red, the drone base, also the drones around the base are spawning.

    If now I want to make changes to this POI, would this be correct? I can for example spawn it in Creative, then blueprint it after the changes and add the blueprint with another name into the Content\Prefabs folder, after this I need to reference it correctly in the playfield_statics.yaml.
     
    #6
    jmcburn likes this.
  7. jmcburn

    jmcburn Rear Admiral

    Joined:
    Jan 15, 2017
    Messages:
    1,113
    Likes Received:
    1,759
    I'm not sure where you want to put that modified POI, but I would highly suggest creating your own scenario for your project. NEVER change the original files of the default random scenario (vanilla game).

    If you modify the original playfields, they will be overwritten with every new game update or at least when you verify your files. Although the POI would stay, if you gave it a new name, it's still very risky to do so.

    I'm no expert in scenario creating, with the galaxy config, the sectors.yaml, the PDA and so on. This takes a lot of work, but any other workflow will undoubtedly lead to massive frustration later on, trust me. ;-)

    Suggestion: I would still not ignore that, even everything seems fine now. Nullref Exceptions can be a massive pain, because they can lead to unexpected behaviour or other NullRefs later on. So it's best to fix them as soon as you get one. Try to comment out your new POI again, see if it still happens. If you only changed that, it's most likely something in your POI setup, maybe a referenced Biome that does not exist in the playfield or something like that.

    Hope that helps. :)

    /jmc
     
    #7
    Germanicus likes this.
  8. japp_02

    japp_02 Commander

    Joined:
    Feb 11, 2021
    Messages:
    524
    Likes Received:
    200
    @jmcburn,
    thank you very much for taking the time on my questions, that's all great help for me. I will do a separate scenario with my modded files so not to take risks of ruining my installation. The POI (the zyrax drone base that you find on Omicron) I have taken it from the Omicron playfield and copy/pasted into my Akua file and have adapted the biomes, of course I have taken both entries from the POI > Random... section as well as entries from the 'DroneSpawning' and 'DroneBaseSetup' which I didn't modify.

    What may cause the NullRef exception is most likely a stupid space missing, or a wrong POI name in the DroneSpawning entry (but then, why doesn't it cause problems in the default game on Omicron? I can't believe it):

    ---------------------------------------------------------------------------------------------------------------
    - GroupName: DroneBaseStarter # Secondary POI Anchor (for Zirax cluster)
    Faction: Zirax
    IsCommandCenter: True # CommandCenter for Zirax Base Attacks
    DroneSetupID: DroneBaseZiraxStarter

    Biome: [ Savanna, SavannaEdge, Grassland, Plains] #Syntax error, missing space !!
    IsImportant: True

    CountMinMax: [ 1, 1 ]
    DroneProb: 1
    DronesMinMax: [ 2, 3 ]
    ReserveCount: 5
    NoShieldReload: True
    Properties:
    - Key: Music
    Value: lava
    - Key: RegenAfter
    Value: 720

    DroneBaseSetup:
    DroneBases:
    - DroneSetupID: DroneBaseZiraxStarter
    Stock:
    - Name: DroneSmallFast01Minigun
    Amount: Infinite
    Type: FighterDrone

    - Name: DroneSmallFast01Rocket
    Amount: Infinite
    Type: FighterDrone

    - Name: DroneTroopsTransport
    Amount: Infinite
    Type: TroopTransport

    - Name: ZiraxMinigun
    Amount: Infinite
    Type: GroundTroop

    - Name: ZiraxRocket
    Amount: Infinite
    Type: GroundTroop

    - Name: RipperDog
    Amount: Infinite
    Type: GroundTroop
    ---------------------------------------------------------------------------------------------------------------

    The green entries all exist on Akua, I'm sure, but the missing space...hehe...
    Orange entry in the DroneSpawning seems strange to me, it's a group name, not the POI name which appears above.

    --------------------------------------------------------------------------------------------------------------
    DroneSpawning:
    Random:
    - Name: DroneSmallFast01Minigun
    DronesMinMax: [ 9, 10 ]
    Faction: Zirax
    # CenterX: 5
    POINameAsPositionRef: DroneBaseStarter # DroneBaseZiraxStarter?
    Radius: 6000
    ---------------------------------------------------------------------------------------------------------------

    I will try to adapt these names just to see if it resolves, I bet it's the missing space, I cannot see any other mismatched references.
     
    #8
    Last edited: Aug 9, 2022
  9. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    226
    Basically whenever the devs do a patch, you tend to have to redo all your edits to the scenario with fresh vanilla files. So, to help me, I put every file into a local git repo, and then take a diff of each file to work out what i need to edit again.
     
    #9
  10. japp_02

    japp_02 Commander

    Joined:
    Feb 11, 2021
    Messages:
    524
    Likes Received:
    200
    #10
    zaphodikus likes this.

Share This Page