Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 6 7 [8] 9 10 ... 24

Author Topic: Roses' Script, System, and Utilities Collection (07/06/2021)  (Read 91414 times)

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #105 on: April 04, 2016, 09:07:52 pm »

Have the actual limits being scienced yet?  I imagine that intermediate steps of some formulas could overflow if size or a stat was too high.  And that would all change when DF goes 64-bit.

1. Yes.

2. Yeah, 0.40.01 gave a sort of soft cap on strength dependent on unit size and carry weight; for example, having more than ~2,000,000 strength on a human-sized creature will make it so that that creature will immediately become as slow as possible upon picking anything up. Other than that, stuff just tends to work.

3. I don't think it will. DF going 64-bit doesn't mean all the uint_32s that make up attributes are going to magically become 64-bit. AFAIK even if he just uses "int" it still won't do that, "long" is the 64-bit integer type IIRC.
I didn't mean the stats' hard caps would change from 64-bit, but that the intermediate-result-overflow constraints might vanish.  But there's already a lot more science on this topic than I realized, so it might be trivial to test those chokepoints when a 64-bit build comes out.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #106 on: April 04, 2016, 09:20:17 pm »

AFAIK even if he just uses "int" it still won't do that, "long" is the 64-bit integer type IIRC.
It's compiler and OS dependent. The only standard requirement is that short ≤ int ≤ long.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

expwnent

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #107 on: April 04, 2016, 09:22:13 pm »

No, he said somewhere he uses int32_t/etc everywhere.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #108 on: April 04, 2016, 11:51:24 pm »

I personally know of size and attribute values not translating directly from raws -> game (i.e. if you say strength should be 6000 it will just default to 5000). There may be other things as well that are raw capped but not game capped. I think I remember someone saying that materials may also be raw capped, but I'm not sure that can be changed since those values aren't stored in individual items but are just referenced directly from the raws.

Putnam brings up a good point though, there may be other soft caps which cause unintended behavior (I think the strength one might be from the tissue token [THICKENS_ON_STRENGTH] but maybe it's something else). Right now most of my scripts just check for the integer type and set the maximum according to that.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #109 on: April 04, 2016, 11:59:11 pm »

Wait, I made the unbreakable katana in fortbent the maximum possible value for everything (trial and error). Yes, indeedy, the cap for strength values is 100,000,000. Adamantine's 5,000,000, so that's pretty good. Didn't check the cap on strain_at_yield, mostly because strain_at_yield is a really weird measurement to use. It's in percentage*1000, so TENSILE_STRAIN_AT_YIELD:100000 means that the material, once it reaches its TENSILE_YIELD point under tension, will have deformed elastically such that it's twice as long as it was before deformation began. This means, notably, that it's very difficult to define the stretchiness of an object as a function of the force applied to it; rather, it's a function of its strength divided by the force applied to it. Multiplying an item's strength by ten will divide its elasticity by ten unless STRAIN_AT_YIELD is changed to accompany it.

The cap of max_edge is 2147483647, or 231-1.

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #110 on: April 06, 2016, 10:04:51 am »

That's good to know, and also fairly weird.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #111 on: April 17, 2016, 05:27:14 am »

class.lua:191: attempt to index field 'Physical' (a nil value)

EDIT: I have no idea why this is happening.
« Last Edit: April 17, 2016, 05:28:56 am by Putnam »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #112 on: April 17, 2016, 04:33:49 pm »

class.lua:191: attempt to index field 'Physical' (a nil value)

EDIT: I have no idea why this is happening.

I do, poor coding on my part, class.LevelBonus is always defined by default, but class.LevelBonus.Physical (or .Mental, .Skill, .Trait) is only defined if the class actually has those bonuses. To fix it for the version you have now replace (starting at line 191)

Code: [Select]
--Add/Subtract permanent level bonuses
 for _,attr in pairs(class.LevelBonus.Physical._children) do
  local amount = class.LevelBonus.Physical[attr]
  dfhack.script_environment('functions/unit').changeAttribute(unit,attr,amount,0,'track')
 end
 for _,attr in pairs(class.LevelBonus.Mental._children) do
  local amount = class.LevelBonus.Mental[attr]
  dfhack.script_environment('functions/unit').changeAttribute(unit,attr,amount,0,'track')
 end
 for _,skill in pairs(class.LevelBonus.Skill._children) do
  local amount = class.LevelBonus.Skill[skill]
  dfhack.script_environment('functions/unit').changeSkill(unit,skill,amount,0,'track')
 end
 for _,trait in pairs(class.LevelBonus.Trait._children) do
  local amount = class.LevelBonus.Trait[trait]
  dfhack.script_environment('functions/unit').changeTrait(unit,trait,amount,0,'track')
 end

with

Code: [Select]
--Add/Subtract permanent level bonuses
 if class.LevelBonus.Physical then
  for _,attr in pairs(class.LevelBonus.Physical._children) do
   local amount = class.LevelBonus.Physical[attr]
   dfhack.script_environment('functions/unit').changeAttribute(unit,attr,amount,0,'track')
  end
 end
 if class.LevelBonus.Mental then
  for _,attr in pairs(class.LevelBonus.Mental._children) do
   local amount = class.LevelBonus.Mental[attr]
   dfhack.script_environment('functions/unit').changeAttribute(unit,attr,amount,0,'track')
  end
 end
 if class.LevelBonus.Skill then
  for _,skill in pairs(class.LevelBonus.Skill._children) do
   local amount = class.LevelBonus.Skill[skill]
   dfhack.script_environment('functions/unit').changeSkill(unit,skill,amount,0,'track')
  end
 end
 if class.LevelBonus.Trait then
  for _,trait in pairs(class.LevelBonus.Trait._children) do
   local amount = class.LevelBonus.Trait[trait]
   dfhack.script_environment('functions/unit').changeTrait(unit,trait,amount,0,'track')
  end
 end

In the future release this will be fixed more elegantly.
« Last Edit: April 17, 2016, 04:59:31 pm by Roses »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #113 on: April 17, 2016, 04:47:51 pm »

class.LevelBonus,Physical

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #114 on: April 17, 2016, 04:59:44 pm »

thanks, edited original
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #115 on: May 05, 2016, 02:49:12 pm »

So I really didn't feel this deserved another post anywhere, and I didn't want to clutter up anyone elses threads. Does anyone know of a utility that allows for easily taking sprites from multiple different sheets and creating a new sheet out of them? I have found tools that let combine entire sheets together, but I was hoping to be able to pick and choose individual sprites from a given sheet.
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #116 on: May 06, 2016, 07:39:08 am »

So I really didn't feel this deserved another post anywhere, and I didn't want to clutter up anyone elses threads. Does anyone know of a utility that allows for easily taking sprites from multiple different sheets and creating a new sheet out of them? I have found tools that let combine entire sheets together, but I was hoping to be able to pick and choose individual sprites from a given sheet.
Not sure if Quiet-Sun's Tool does what you are looking for, but it's the only thing I know of that's close (other than straight-up image tools).
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #117 on: May 06, 2016, 08:07:15 am »

Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #118 on: May 09, 2016, 10:34:39 pm »

Well I got really annoyed with writing so I took a short break to brainstorm a road map for where I am planning on going with DF and DFHack. I have updated the first post with this information (removing my outdated todo list) so that you can see what my current plans are. Hopefully the first couple of releases will be quick and will happen in the beginning of June.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.2 (2/16/2016)
« Reply #119 on: May 16, 2016, 05:29:09 pm »

I rewrote it to use json instead of persist-table. It's loads faster now. Main problem I can find is that I can't get it to save on quicksaves.
Pages: 1 ... 6 7 [8] 9 10 ... 24