0 of 0

File information

Last updated

Original upload

Created by

yobson

Uploaded by

yobson

Virus scan

Safe to use

Tags for this mod

16 comments

  1. LagNangWebsiteNyo
    LagNangWebsiteNyo
    • member
    • 0 kudos
    can this inject or call a .dll during runtime?
    1. yobson
      yobson
      • premium
      • 14 kudos
      no, you could make your dll an asi and have asi loader load that too but that's of course gonna load it as the program starts, not whenever during runtime if that's what you're after
  2. tkhquang
    tkhquang
    • premium
    • 7 kudos
    Since the big update recently, the commands from vscode don't seem to be running anymore

    ```
    Sending script paths to game...
    Finished sending script paths
    [Output]: Files queued for execution
    ```
    1. yobson
      yobson
      • premium
      • 14 kudos
      fixed in v2.1.2 thanks
    2. tkhquang
      tkhquang
      • premium
      • 7 kudos
      Thanks mate! It's working now
  3. Feanture
    Feanture
    • member
    • 2 kudos
    can you be so kind and explain why i can't use loops for spawn? I am noob in .lua and have some relative xp in c# and python

    -- Initialize module table safely
    BirdSpawner = BirdSpawner or {}

    function BirdSpawner.SpawnBirds()
        if not g_localActor then return end
       
        local pos = g_localActor:GetWorldPos()

        local entityParams = {
            class = "Birds",
            position = pos,
            properties = {
                Options = {
                    bActivate = true,
                    bFollowPlayer = true,
                },
                Movement = {
                    HeightMin = pos.z,
                    HeightMax = pos.z + 60
                }
            }
        }
       
        local birdEntity = System.SpawnEntity(entityParams)
        local birdEntity = System.SpawnEntity(entityParams)
        local birdEntity = System.SpawnEntity(entityParams)
        local birdEntity = System.SpawnEntity(entityParams)
        local birdEntity = System.SpawnEntity(entityParams)
    end

    System.AddCCommand("spawn_birds", "BirdSpawner.SpawnBirds()", "Spawns birds that follow player")

    this one is working. but if i try to make same with for loop it is crashing immediately.... can you advice please where to look or to learn. to many crashes and i do not know how to debug why
    1. Feanture
      Feanture
      • member
      • 2 kudos
      -- Initialize module table safely
      BirdSpawner = BirdSpawner or {}

      function BirdSpawner.SpawnBirds()
          if not g_localActor then return end
         
          local pos = g_localActor:GetWorldPos()

          local entityParams = {
              class = "Birds",
              position = pos,
              properties = {
                  Options = {
                      bActivate = true,
                      bFollowPlayer = true,
                  },
                  Movement = {
                      HeightMin = pos.z + 5,
                      HeightMax = pos.z + 60
                  }
              }
          }
         
          for i = 1, 5 do
              System.SpawnEntity(entityParams)
          end
      end

      System.AddCCommand("spawn_birds", "BirdSpawner.SpawnBirds()", "XSpawns birds that follow player")

      CRASH: Entity can't be created. Too many entities. Save your work, expect crash.

      lol... why?
    2. yobson
      yobson
      • premium
      • 14 kudos
      that is really quite odd, im not sure why it would behave that way. does it behave the same if you load that Lua code into a .pak mod and try to run the command that way? i wouldn't imagine it's unique to this way of executing the code but maybe, I have encountered issues with Script.SetTimer not working correctly via this executor but it works properly if loaded from a mod as usual.
      edit:
      yeah strangely it does work if you load that in via a mod and not this. still not sure why but I'll see if I can figure it out and fix it, maybe there's more than 1 Lua state and i'm using the wrong one
    3. yobson
      yobson
      • premium
      • 14 kudos
      fixed in the latest release, thanks
  4. Feanture
    Feanture
    • member
    • 2 kudos
    working. thank you!
  5. hombrebird
    hombrebird
    • member
    • 0 kudos
    It's fantastic!

    I have a question though, where can I see the methods for `soul` or `entity`?
    1. yobson
      yobson
      • premium
      • 14 kudos
      there isn't really much robust documentation right now. you can look at stuff from KCD1, it's a lot of the same. and you can unpack Scripts.pak and look through that stuff.
      some links for KCD1 documentation:
      https://warhorse.nexusmods.com/
      https://wiki.fireundubh.com/kingdomcome
  6. MonoPT
    MonoPT
    • supporter
    • 0 kudos
    Looks promising. How much can we expect to mod the game with this? I have experience with programing, but not with modding and would like to try some things like adding new interactions or animations. Do you expect to release some kind of documentation?
    1. yobson
      yobson
      • premium
      • 14 kudos
      it's just the existing cryengine Lua scripting that the game uses. this is just for making development of mods easier by letting you easily run Lua at runtime instead of having to repack your mod and restart your game every time you want to make a script change.
  7. beethy
    beethy
    • premium
    • 309 kudos
    Wow, it's actually here. Fantastic work. This has incredible potential. 
  8. VAXIStaa
    VAXIStaa
    • premium
    • 37 kudos
    Wonderful job!