Morrowind
0 of 0

File information

Last updated

Original upload

Created by

lelimule

Uploaded by

lelimule

Virus scan

Safe to use

Tags for this mod

44 comments

  1. GregorianGangsta
    GregorianGangsta
    • member
    • 2 kudos
    For some reason this is breaking Dynamic Music.
    1. lelimule
      lelimule
      • supporter
      • 14 kudos
      Thanks for the information. I can't tell because i don't use Dynamic Music. Perhaps you should ask to Dynamic Music authors.
      There isn't music in my mod. Perhaps Dynamic Music didn't expect combat without the PC.
  2. mym
    mym
    • premium
    • 1 kudos
    New bug found in code line 193:
    if distToNPC < (fightV - 80) * 200 then
    Error:[11:52:23.534 E] L0x16d000003[scripts/wildlife_npc/wildlife.lua] callTimer failed: Lua error: [string "scripts/wildlife_npc/wildlife.lua"]:193: attempt to compare nil with number
    [11:52:23.534 E] stack traceback:
    [11:52:23.534 E]  [string "scripts/wildlife_npc/wildlife.lua"]:193: in function <[string "scripts/wildlife_npc/wildlife.lua"]:148>

    I suppose because distToNPC is nil which is possible because aux_util.findMinScore can return nil.

    I'll try the following fix:
    if distToNPC and distToNPC < (fightV - 80) * 200 then
    1. lelimule
      lelimule
      • supporter
      • 14 kudos
      Thank you again for your report mym.
      I think your fix is good.
      If you can confirm me, i will publish the new version.
    2. mym
      mym
      • premium
      • 1 kudos
      I have no errors since that fix, but I did not find any aggressive creatures close to NPCs so I cannot confirm it still works as expected.
    3. lelimule
      lelimule
      • supporter
      • 14 kudos
      Ok. I'm going to upload the new version. And if there are news, I'll adapt.
    4. mym
      mym
      • premium
      • 1 kudos
      Alright.
      I started a new game, I did all the Seyda Neen area and quests, plus a few quests in Balmora, and the only NPC vs creature fight I noticed so far was in Addamasartus, the last bandit losing against a rat, and running for his life 😂
      Maybe because I use BTB game improvements Necro Edit which increases NPC flee setting and boosts creatures, including rats
  3. mym
    mym
    • premium
    • 1 kudos
    I have Lua errors when I create a new game and get out of the census office:
    [18:13:23.601 E] L@0x188[scripts/wildlife_npc/wildlife.lua] callTimer failed: Lua error: [string "scripts/wildlife_npc/wildlife.lua"]:157: attempt to index a nil value
    [18:13:23.601 E] stack traceback:
    [18:13:23.601 E]  [string "scripts/wildlife_npc/wildlife.lua"]:157: in function <[string "scripts/wildlife_npc/wildlife.lua"]:149>

    The code:
    if types.Actor.stats.dynamic.health(self).current < 1
            or ai.getActivePackage().type ~= "Wander" and ai.getActivePackage().type then
    return
    end

    I printed "ai.getActivePackage()" and it sometimes equals to nil.
    1. lelimule
      lelimule
      • supporter
      • 14 kudos
      Thanks for the report. I can't test it because i'm out of home for 3 weeks.
      I thought i can test "ai.getActivePackage().type" even if it is nil. I imagine i have to test "if ai.getActivePackage()" before, for example...

      Edit: i think you can come back to the 1.4 version (not 1.4.1) for the moment...
    2. mym
      mym
      • premium
      • 1 kudos
      Can I change the code to:
      if types.Actor.stats.dynamic.health(self).current < 1
      or ai.getActivePackage() ~= nil and ai.getActivePackage().type and ai.getActivePackage().type ~= "Wander" then
      return
      end
    3. lelimule
      lelimule
      • supporter
      • 14 kudos
      Of course, you can change as you want.
      But won't you get the same error with this new code? And if no, can't you do simpler?: ai.getActivePackage() ~= nil and ai.getActivePackage().type and ai.getActivePackage().type ~= "Wander"

      Can you tell me? (remember, i can't test for the moment) If you confirm me a working solution i will upload a new version in place of this bugged one.

      Edit: and don't you need "( )" to separate the "or" from the "and' in the test? (just to be sure)
    4. mym
      mym
      • premium
      • 1 kudos
      With my code I don't have errors anymore.

      I'm not sure what are the best conditions as I don't really understand your requirements for returning from the function:

      Return if
      - there is an AI package and it's not Wander?
      - there is an AI package and it has a type and it's not Wander?
      - there is no AI package or there is one which is not Wander?
    5. lelimule
      lelimule
      • supporter
      • 14 kudos
      Return if
      - there is an AI package and it's not Wander?

      Yes, this one.
      So i imagine it's: ai.getActivePackage() ~= nil and ai.getActivePackage().type ~= "Wander". It's enough, no?
    6. mym
      mym
      • premium
      • 1 kudos
      Yes it's enough.
      I don't think we could have a package with a nil type? But if it happened, we would not return, is it ok?
    7. lelimule
      lelimule
      • supporter
      • 14 kudos
      Thank you mym.

      In my knowledge, if there is an active package, it _has_ one these 6 types: Combat or Follow or Pursue or Escort or Wander or Travel.
      https://openmw.readthedocs.io/en/latest/reference/lua-scripting/aipackages.html

      In special cases i prefer "return" to be sure to have compatibility. But for me, an active package with type == nil is impossible. So ai.getActivePackage() ~= nil and ai.getActivePackage().type ~= "Wander" is enough for me.
  4. mym
    mym
    • premium
    • 1 kudos
    I quickly looked at your code, and I think you could optimize a bit the multiple "self.recordId == "alit" or"... code by using a Lua table defined in the script root (global scope) like:

    local creatureIds = {
      ["alit"] = true,
      ["other"] = true,
      ...
    }

    And then just test:

    if creatureIds[self.recordId] then...
    1. mym
      mym
      • premium
      • 1 kudos
      Also you could replace:

      elseif self.recordId == "alit_blighted" then
              fightV = fight_alitBlg
              wildlife = "preset"
      ...

      With another Lua table like:

      local fightValues = {
        ["alit_blighted"] = 90,
        ["alit_diseased"] = 90,
        ...
      }

      And then:

      local fightV = fightValues[self.recordId]
      if fightV ~= nil then
        wildLife = "preset"
      end

      Lua tables allow to do only one check instead of multiple "or" checks.
    2. lelimule
      lelimule
      • supporter
      • 14 kudos
      Hey, thanks! I'm going to look at that!...
    3. mym
      mym
      • premium
      • 1 kudos
      Wow, you're reactive ☺️
      Your code is now more efficient and easier to read.

      And just for the info, you can replace:
      if newAPIcreatures_fightV[self.recordId] ~= nil
      With
      if newAPIcreatures_fightV[self.recordId]
      As if it's different than nil it will be true.
    4. lelimule
      lelimule
      • supporter
      • 14 kudos
      Thanks.
  5. mym
    mym
    • premium
    • 1 kudos
    I wonder if with Protective Guards the guards will protect NPCs as well?
    1. lelimule
      lelimule
      • supporter
      • 14 kudos
      I wonder if with Protective Guards the guards will protect NPCs as well?
      Good question.
      With or without Protective Guards, guards naturally attack creatures in combat. So we can say they "protect" NPCs against creatures.
      But Protective Guards doesn't protect NPCs against NPC attacks...
      But it just so happens that I made a Protective Guards addition that does it! and another important thing!... See my march 20/27th post in the Protective Guards POSTS tab...
    2. mym
      mym
      • premium
      • 1 kudos
      Thank you, I like your changes on protective guards.
  6. mym
    mym
    • premium
    • 1 kudos
    I want to try your mod in my next playthrough, but I'm just afraid some important NPCs could be killed before I realize they are attacked.
    1. lelimule
      lelimule
      • supporter
      • 14 kudos
      Try it and you will tell me. £:^)
      But I'm pretty confident.
    2. mym
      mym
      • premium
      • 1 kudos
      Are you confident because of the 2 passive creatures mods you're using and recommending?
      I use Vanilla friendly creatures and undeads expansion which does: "apart from predators and cliff racers, most creatures are passive unless you get too close".
    3. lelimule
      lelimule
      • supporter
      • 14 kudos
      Are you confident because of the 2 passive creatures mods you're using and recommending?

      Passive mods can help, but even without them, i'm confident:
      - "special" wildlife (unique ones, pets, etc...) isn't in my mod.
      - i'm not aware of a "normal" aggressive wildlife near a NPC
      - wildlife isn't very strong in general
      - even if a NPC were to die because of the starting conditions with my mod (that remains to be seen), it's unlikely to be an essential one.
    4. mym
      mym
      • premium
      • 1 kudos
      Alright thanks, I'll try and give you feedback if something wrong happen.
  7. Challenger4676
    Challenger4676
    • member
    • 1 kudos
    Hi! Thank you for the great mod. Is there any workaround for music? It started to change rapidly while you are travelling near possible wildlife encounters.
    1. lelimule
      lelimule
      • supporter
      • 14 kudos
      For music i always recommend to remove all "battle" music (edit the files to silence sound), because music in combat is a little bit dumb, and because combat music unrealistically alerts you when an actor, that you don't notice, start to attack.
      Furthermore, i recommend to add silent files to "explore" music. Personally i modified to have, on average, one "time" of music for 10 "time" of silence. With that, when the music come it's a sort of gift... £:^) See this mod for example: silence.mp3
    2. Challenger4676
      Challenger4676
      • member
      • 1 kudos
      That's a great idea, gonna do the same. Thanks for the reply!
  8. mym
    mym
    • premium
    • 1 kudos
    Hello,
    I love your idea 😍

    You could still use the recent openmw function for those who use a recent build if you condition the code on the Lua API version number, like we do in NCGD:

    local isLuaApiRecentEnough = core.API_REVISION >= 56
    If isLuaApiRecentEnough then ....
    1. lelimule
      lelimule
      • supporter
      • 14 kudos
      Thank you for your suggestion.
      But i just tried this recent openmw function (types.AIStats.fight(self)) (with a recent build) in my lua file, and i get a lua error: it can't index AIStats. I don't understand. So, for the moment, i can't add this.

      And the recent builds work with my tricky mod as it is. £:^)

      EDIT: Ok i understand: the right syntax is types.Actor.stats.ai.fight(self).modified. I will see that...
    2. mym
      mym
      • premium
      • 1 kudos
      Congrats for the new version
  9. JayberXD
    JayberXD
    • premium
    • 28 kudos
    Is there an MWSE equivalent of this?
    1. daedriccat
      daedriccat
      • premium
      • 9 kudos
      Seconding this
    2. lelimule
      lelimule
      • supporter
      • 14 kudos
      I don't know. I'm not aware of this.
    3. deleted189231795
      deleted189231795
      • account closed
      • 1 kudos
      Does this work with Sei's Dynamic Wildlife?
    4. lelimule
      lelimule
      • supporter
      • 14 kudos
      The Sei's Dynamic Wildlife creatures are not taken into account by my mod because they have other IDs (it's like new creatures). So, for my mod, they aren't the Morrowind wildlife creatures.
    5. deleted189231795
      deleted189231795
      • account closed
      • 1 kudos
      I could just easily add those animals to the wildlife.lua then to make them compatible then?
    6. lelimule
      lelimule
      • supporter
      • 14 kudos
      Yes, but as Sei's mod adds nearly 40 wildlife creatures (with attached mwscript), you must add those nearly 40 animals to the wildlife.lua with preset variables; it's a lot of code lines.
    7. deleted189231795
      deleted189231795
      • account closed
      • 1 kudos
      This only applies  if you don't use the newer versions of OpenMW correct with the newer lua script?
    8. lelimule
      lelimule
      • supporter
      • 14 kudos
      Yes and no: if you use the newer versions of OpenMW, you still have to add the new ID for each new creature, but you don't need to add the "preset" part. So there is less code "lines" to add (1 by creature - 'self.recordId == "<ID>" or'...). EDIT: write IDs in lowercase!
  10. Farzaneh
    Farzaneh
    • member
    • 2 kudos
    I use Passive Wildlife of Vvardenfell which doesn't affect monsters so you could have passive animals with monsters attacking everybody and animals.