Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Roses

Pages: 1 ... 41 42 [43] 44 45 ... 131
631
thanks, edited original

632
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.

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

634
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.

635
Alright, I had a new idea for a script/system. Tentatively called TrueCreature it fixes some major problems I have with modding, namely the caps that are present on raw values that aren't shared in game.

For those of you who don't know, 5000 is not the in-game cap for any of the attributes, and yet you can only use up to 5000 in the raws themselves, this typically results in dragons (or other very large creatures) just getting 5000 strength. But is a dragon only 5 times stronger than an average human? Seems unlikely. Similarly, the size of a creature is capped in the raws, but can go much larger in-game.

So what does/will TrueCreature do? Simply put it will scan all creatures every so often, and will adjust values based on an external file that you configure (if I can figure it out it will also work in world generation, but that will be another project all together). This will also tie into the Class and Civilization system (which is where the idea originates from) so that enemy entities and creatures can have classes randomly chosen for them based on the inputs you provide.

Now this is all in the brainstorming phase so far (don't have much time for anything besides thesis writing right now), so let me know if any of you have any suggestions or comments.

637
DF Modding / Re: [MODDING] 0.42.x QUESTIONS THREAD
« on: April 04, 2016, 09:46:11 am »
Does anyone have a list of, or know which, vanilla buildings have functionality that can't be replicated with custom buildings? (I'm thinking things like the kennel etc...)

638
I'm almost positive it's not possible, but I would love to be able to select where a civilization starts. Not sure if this could be interjected into world generation somehow.
Probably possible and might be even easy (except the part where we catch df before/in the middle of civ placing, maybe you can place them after even?) but the problem is that nobody looked at generation very closely (or at all?) AFAIK.

Hmm, maybe I will have to look at generation then, although it's not something I could do for a couple months so if anyone else has an itching desire to be my guest.

639
I'm almost positive it's not possible, but I would love to be able to select where a civilization starts. Not sure if this could be interjected into world generation somehow.

640
What you get when you open up the unit viewer with the currently provided classes_example.txt and spells_example.txt

Spoiler (click to show/hide)

Now I just need to figure out how to alphabetize it.
OMG. I love that you are still working on this, and this looks fantastic for players. :)

Indeed, I am trying at least. In the process of writing my Thesis right now so my free time has been stretched very thin. But I enjoy writing utilities for DF that I one day hope to include in a mod. At this point I am up to about 40 scripts and over 10k lines of code. But I am trying to prune a little, there are just so many features I want that require writing large pieces of new code.

641
Spoiler (click to show/hide)
Now I just need to figure out how to alphabetize it.
You mean sorting?

Yes, the issue is the name displayed is a reference in a table of a table. Still not that hard to do, would just need to make a separate array and copy the corresponding values, then sort.

642
Utilities and 3rd Party Applications / Re: DFHack 0.40.24-r5
« on: March 16, 2016, 03:26:13 pm »
Does anyone know if you can put pretty pictures in the in-game gui, or is it limited to just text and simple shapes?
Are you just talking about the simple shapes you can build with text or special characters? I'm not aware of anything else you can do, really.

There is a way to draw more complicated stuff on the screen, like the Stonesense overlay does, but it's really complicated and varies depending on the print mode (I don't think anyone's managed to do it in OpenGL print modes yet, which a lot of people use).

Yeah, the simple shapes you can make with text and special characters is the fanciest I know of. Was just wondering you could maybe import graphics. Thought maybe that since you can give units graphics you might be able to input something. But not worth it for my project if its Stonesense level complicated.

643
What you get when you open up the unit viewer with the currently provided classes_example.txt and spells_example.txt

Spoiler (click to show/hide)

Now I just need to figure out how to alphabetize it.

644
Utilities and 3rd Party Applications / Re: DFHack 0.40.24-r5
« on: March 16, 2016, 02:33:03 pm »
Does anyone know if you can put pretty pictures in the in-game gui, or is it limited to just text and simple shapes?

645
Utilities and 3rd Party Applications / Re: Research
« on: March 16, 2016, 02:11:00 pm »
If you instead just open up the lua command line by typing 'lua' in the DFHack command line, you can access all the different region_map_entry values with df.global.world.world_data.region_map[n].

Pages: 1 ... 41 42 [43] 44 45 ... 131