Author Topic: Cataclysm-DDA-LUA (Updated on 2017-10-02)  (Read 1020 times)

Offline Zhilkin

  • NPC
  • **
  • Posts: 205
    • View Profile
Cataclysm-DDA-LUA (Updated on 2017-10-02)
« on: August 11, 2017, 02:04:23 PM »
Description:

Cataclysm-DDA-LUA is collection of LUA mods for Dark Days Ahead.

Lats updated on:

2017-10-02

Contents:
  • dda-lua - shared library mod for easier creation of LUA mods;
  • dda-lua-achievements - adds achievements:
    • not implemented yet.
       
  • dda-lua-fun - adds fun:
    • `nationality` - select nationality on game start and receive some bonus items.
       
  • dda-lua-items - adds items:
    • `atomic_entity_scanner`- highlights items and creatures around player character;
    • `atomic_earthquake_generator` - makes rubbles around player character;
    • `atomic_flamethrower` - bursts fire in selected direction.
       
  • dda-lua-mapgen - adds mapgen:
    • not implemented yet.
       
  • dda-lua-skills - adds skills:
    • `athletics` - gives speed bonus based on `squares_walked`.
       
  • dda-lua-traits - adds traits:
    • `TOURETTE` - shouts bad words when not under medication (`xanax`);
    • `NIGHTMARES` - you see bad dreams when not under medication (`ambien`);
    • `NUDIST` - +2 to all attributes when naked.
Screenshots:
(click to show/hide)

Links:
« Last Edit: October 02, 2017, 07:59:09 PM by Zhilkin »

Offline DeWolf

  • Survivor
  • ***
  • Posts: 964
  • STAY AWAY FROM MY PRETZELS
    • View Profile
Re: [LUA] Cataclysm-DDA-LUA
« Reply #1 on: August 11, 2017, 03:36:34 PM »
Ok I was going to say something else but I see why this needs to be a lua mod since the jsons only allow for skill descriptions and not the addition of new skills at least not in that way. Now on that note I really like the idea of athletic the other traits look good too.

Offline RipRoarinBoogerPenis

  • NPC
  • **
  • Posts: 235
    • View Profile
Re: [LUA] Cataclysm-DDA-LUA
« Reply #2 on: August 11, 2017, 03:42:07 PM »
With the achievements, would a highscore list be doable?

Offline Zhilkin

  • NPC
  • **
  • Posts: 205
    • View Profile
Re: [LUA] Cataclysm-DDA-LUA
« Reply #3 on: August 12, 2017, 07:51:51 PM »
With the achievements, would a highscore list be doable?
We'll see.

Offline DeWolf

  • Survivor
  • ***
  • Posts: 964
  • STAY AWAY FROM MY PRETZELS
    • View Profile
Re: [Lua] Cataclysm-DDA-LUA
« Reply #4 on: August 13, 2017, 01:44:21 AM »
How long should I expect the athletics skill to go up?

Offline Alec White

  • NPC
  • **
  • Posts: 213
  • I'm shy
    • View Profile
Re: [Lua] Cataclysm-DDA-LUA
« Reply #5 on: August 13, 2017, 02:34:50 AM »
Damn Zhilkin this stuff is fun. Specially the athletics and tourette.

Offline Zhilkin

  • NPC
  • **
  • Posts: 205
    • View Profile
Re: [Lua] Cataclysm-DDA-LUA
« Reply #6 on: August 13, 2017, 07:40:09 AM »
How long should I expect the athletics skill to go up?
athletics should be practiced by 1 point per 10 tiles traversed, but for at least 1 point.

Code: [Select]
  local squares_per_train = 10 --TODO: make this variable configurable or implement some smarter formula for `trained_amount`
  local trained_amount = squares_walked_delta / squares_per_train

  if (trained_amount > 0 and trained_amount < 1) then

    trained_amount = 1

  end
  MOD.PracticeSkill("athletics", trained_amount)
« Last Edit: August 13, 2017, 07:47:19 AM by Zhilkin »

Offline Rock

  • Zombie Food
  • *
  • Posts: 10
  • I love rice, but do you love rice?
    • View Profile
    • STEAM PROFILE
Re: [Lua] Cataclysm-DDA-LUA
« Reply #7 on: August 13, 2017, 11:29:08 AM »
Love the nightmare mod, I like the idea of showing a visualization of my characters night terrors. I hope you add more additions to the nightmares so I can see cool new horrors to be explored while dreaming!

Offline DeWolf

  • Survivor
  • ***
  • Posts: 964
  • STAY AWAY FROM MY PRETZELS
    • View Profile
Re: [Lua] Cataclysm-DDA-LUA
« Reply #8 on: August 13, 2017, 05:10:08 PM »
How long should I expect the athletics skill to go up?
athletics should be practiced by 1 point per 10 tiles traversed, but for at least 1 point.

Code: [Select]
  local squares_per_train = 10 --TODO: make this variable configurable or implement some smarter formula for `trained_amount`
  local trained_amount = squares_walked_delta / squares_per_train

  if (trained_amount > 0 and trained_amount < 1) then

    trained_amount = 1

  end
  MOD.PracticeSkill("athletics", trained_amount)
Actually if say I think the lua failed to load or something like that what would I do to try and re activate the lua. I ask cause since I first used it on a save without it causing an aparantly critical load failure it gave an error but it did not show up any more later. Anyways I ask because I have literally walked miles and athletics did not tick once. Maybe I need to turn them off and back on again.

Offline Zhilkin

  • NPC
  • **
  • Posts: 205
    • View Profile
Re: [Lua] Cataclysm-DDA-LUA
« Reply #9 on: August 13, 2017, 06:05:20 PM »
How long should I expect the athletics skill to go up?
athletics should be practiced by 1 point per 10 tiles traversed, but for at least 1 point.

Code: [Select]
  local squares_per_train = 10 --TODO: make this variable configurable or implement some smarter formula for `trained_amount`
  local trained_amount = squares_walked_delta / squares_per_train

  if (trained_amount > 0 and trained_amount < 1) then

    trained_amount = 1

  end
  MOD.PracticeSkill("athletics", trained_amount)
Actually if say I think the lua failed to load or something like that what would I do to try and re activate the lua. I ask cause since I first used it on a save without it causing an aparantly critical load failure it gave an error but it did not show up any more later. Anyways I ask because I have literally walked miles and athletics did not tick once. Maybe I need to turn them off and back on again.
There is some initialization which is done on new player creation - some zero values are being saved withing the player.

  PARAM.save("squares_walked_total", 0)
  PARAM.save("stats_squares_walked", 0)
  PARAM.save("speed_bonus", 0)

If you add mod to existing save you can try to run these statements in debug lua console.

You can also can provide error text/screenshot or provide savegame, so I could check what's wrong.

Offline DeWolf

  • Survivor
  • ***
  • Posts: 964
  • STAY AWAY FROM MY PRETZELS
    • View Profile
Re: [Lua] Cataclysm-DDA-LUA
« Reply #10 on: August 14, 2017, 02:47:42 AM »
data/mods//dda-lua-skills/main.lua:147: attempt to perform arithmetic on a nil value (local 'squares_walked_prev')

That is the error I got when I tried those commands you gave.


EDIT:never mind skill is increasing and my current speed is now 102 so huzzah.
« Last Edit: August 14, 2017, 02:49:45 AM by DeWolf »

Offline Zhilkin

  • NPC
  • **
  • Posts: 205
    • View Profile
Re: [Lua] Cataclysm-DDA-LUA
« Reply #11 on: August 14, 2017, 06:55:14 AM »
Great

Offline Zhilkin

  • NPC
  • **
  • Posts: 205
    • View Profile
Re: Cataclysm-DDA-LUA (Updated on 2017-10-02)
« Reply #12 on: October 02, 2017, 08:00:24 PM »
Just added atomic flamethrower which bursts fire in selected direction. Works best with realtime progression turned on.

https://imgur.com/a/K5beX
« Last Edit: October 02, 2017, 08:35:52 PM by Zhilkin »

Offline DeWolf

  • Survivor
  • ***
  • Posts: 964
  • STAY AWAY FROM MY PRETZELS
    • View Profile
Re: Cataclysm-DDA-LUA (Updated on 2017-10-02)
« Reply #13 on: October 02, 2017, 08:02:00 PM »
Just added atomic flamethrower which bursts fire in selected direction. Works best with realtime progression turned on.
Realtime progression?

Offline Zhilkin

  • NPC
  • **
  • Posts: 205
    • View Profile
Re: Cataclysm-DDA-LUA (Updated on 2017-10-02)
« Reply #14 on: October 02, 2017, 08:39:09 PM »
Just added atomic flamethrower which bursts fire in selected direction. Works best with realtime progression turned on.
Realtime progression?

17th row in General tab in Options menu