Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 27 28 [29] 30 31 ... 42

Author Topic: [DFHack] Roses' Script Collection Updated 5/4/15  (Read 125428 times)

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #420 on: November 21, 2014, 04:31:43 pm »

Your generated DISPLAY_NAME syndromes have name_plural set to START due to the fact that you didn't include the plural or adj...

EDIT: And now add-experience doesn't work at all for a reason I cannot comprehend whatsoever. Wonderful.

EDIT 2: add-syndrome has an issue where, apparently, if you level up with a class that has only one level and a skill/attribute boost, it errors the hell out due to trying to access the second boost, which doesn't exist. Oy. Probably my fault for assuming that a class with only one level that will auto upgrade is going to only require one level in the boosts (not sarcasm). I fixed it by making it so that, if auto-upgrading happens, it just returns the experience adding function. I also moved the auto-upgrading to the top.
« Last Edit: November 22, 2014, 01:35:11 am by Putnam »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #421 on: November 22, 2014, 06:37:58 am »

It seems that auto learned spells are never learned due to the fact that the spell learn process thinks that it should have already been learned through the auto learn process.

I feel like updating would break stuff, too.

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #422 on: November 22, 2014, 05:16:21 pm »

So basically you are telling me that it is practically unusable in its current format... Great, I hate when I upload broken stuff. Should really take more time to test it myself.

Alright, so I am going to put everything else on hold and work on this, starting with add-experience. I used the command
Code: [Select]
classes/add-experience -unit 0 -amount 10In arena mode and it correctly added the experience (there are commented out print statements that will show you). What is not working for you?

Yes, I was having issues with the skill/attribute boosts and number of levels. I should probably make it not just completely crash if something like that happens, but for now you need to have 2 boosts, even if its an auto-upgrade class. Your solutions is probably better though.

The display name needs to be fixed, I didn't realize exactly how that worked when I wrote that, and once I learned I never went back and fixed it, that is entirely my fault.

That auto learn thing is stupid, the new version (which is almost done, I swear!) Will allow you to auto learn spells that are tied to levels in a class. So that they will look like
Code: [Select]
[SPELL:spell_name:level]
-- any requirements and things you want
[SPELL_AUTO_LEARN]
This will make it so that you can learn spells normally, but also make them auto-learned at different levels. For interest of cross compatability I will not change the [SPELL:spell_name:AUTO] format, but will instead make the script treat the AUTO as a level 0 with the flag [SPELL_AUTO_LEARN] set to true. So that
Code: [Select]
[SPELL:spell_name:AUTO]
-- -- any requirements and things you want
Is equivalent to
Code: [Select]
[SPELL:spell_name:0]
-- any requirements and things you want
[SPELL_AUTO_LEARN]

Anything else I need to fix with this travesty of a system?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #423 on: November 22, 2014, 05:20:36 pm »

Nah, it should be fine as long as it's backwards-compatible. Hell, I can even work without that, though I'll have to refactor the classes again, which is a frustrating experience.

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #424 on: November 25, 2014, 04:12:14 pm »

So it is coming along nicely (I am also switching over the new persistent storage which make keeping track of levels and classes much easier and more intuitive), just a few more changes (and fixing up the python script) and it should be good to go.

I'm still not seeing an issue with add-experience, what problems were you seeing Putnam?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #425 on: November 25, 2014, 04:38:00 pm »

It didn't stick... at all. I have no idea what could have been causing it, it was completely confounding. I had it print the persistent config storage before and after, and the experience values changed correctly, but running the script again showed that the persistent values went straight back to zero after the script finished/right as the script started again (couldn't tell which). I couldn't find a single reason for this to happen.

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #426 on: November 25, 2014, 04:44:14 pm »

Hmm, interesting. I will double check that nothing like that is happening now. I think with the new system that definitely won't happen. I know the old persistent storage would have trouble with the save and load features sometimes not happening in the correct order, or overwriting eachother. With table values though it should be correct. I am also moving everything I can do local variables, I know variables are local to function calls anyway, and it probably doesn't matter much, but I prefer local variables to global anyway.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #427 on: November 25, 2014, 04:47:34 pm »

Variables are local to scripts, not function calls. If you declare a variable as not-local in a function in a script, that variable will stick around the next time you run the script.

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #428 on: November 25, 2014, 05:19:18 pm »

That's what I meant, scripts, not functions. Either way, I don't think making them local will change anything, but just better practice.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #429 on: November 25, 2014, 05:45:33 pm »

I tested the new persistent stuff but not 100% thoroughly. It's possible there's something wrong with it.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #430 on: November 25, 2014, 06:40:21 pm »

Well I'll run it through the passes
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #431 on: November 27, 2014, 07:10:31 pm »

One more thing: the display names aren't getting replaced upon class change, looks like

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #432 on: November 27, 2014, 07:44:45 pm »

Was just about to give an update,

There appears to be a small change from the old 0.34 based to DFHack that I tested most of my stuff on to the new one. For the most part everything is fine, but it is having some troubles with the display names and syndromes. This will be fixed in the new version. You will also have the option to specify your plural display name by changing the [NAME] in each class in classes.txt. It will support [NAME:singular:plural], if no plural is given (i.e. [NAME:singular] like my examples) standard plural form will be assumed and an s will be added.

@Putnam, I have also changed how experience, levels, and classes are stored (by moving to the new persistent system), I'm not sure if you wrote any scripts to access that information, but if you did they will need to be changed. I can give you the details about how the new information is stored if you would like.

So now for my update;

I am almost done migrating everything to the new persistent system, tests will need to be done to ensure the information is both being updated accurately and in fact, persisting.

The largest change to the classes scripts that might affect modders is the addition of a level-up script (previously the leveling up was stored in the base/classes.lua and classes/add-experience.lua. Now if they detect the unit should level up an external script is called to handle that. For players this makes no difference, but for modders it allows you to bypass the experience system directly, and simply level up classes through other means (such as reactions). I envision someone might want to create a stonemason class or something that levels up after doing 100 reactions or something (or a special class that only levels up each time you give it a dragons heart or something). Again, this shouldn't effect users, but does give modders some more options.

I have also added some error handling and such so that it doesn't just shit out, but instead tells you what is wrong, and tells you what it assumes you meant (an example of this is when Putnam talked earlier about assuming you didn't need a boost number for an auto-upgrade class. Now, instead of crashing with large red text, it will tell you it expected another number, and is instead just using the previous number again). There are still bound to be errors given if you do something horrendous, but little things should fail gracefully.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #433 on: December 03, 2014, 08:05:24 pm »

Ok, sorry for the lack of updates, but been pretty busy lately, and I wanted to give everything a thorough testing this time so I don't have a million and one bugs. So far everything seems to be going well. Class names are changing correctly, levels are behaving correctly, spells are being learned automatically at different levels (not just the 0th level), it is printing out useful information if it comes across something it doesn't expect (instead of just red text crashing). Overall it is much more solid, and hopefully much less buggy, but I still need to test it out in adventure and fortress mode (just been doing arena tests) so it might take a little longer for an update.

On a semi-related note, I have also begun connecting the civilization and classes systems. This means that you can have NPC entities with different classes! How it will work is you will be able to say [LEVEL_ADD:CLASS:#CLASSTOKEN:#PERCENTAGE] and [LEVEL_REMOVE:CLASS:#CLASSTOKEN], this will add or remove the class available to the entity, and if added, will give a percentage of the population that will be that class. You will also be able to add and remove classes with reactions, so you can have something like "Teach the Humans the Art of Stone", and viola, the humans can be geomancers (for example). Note that this won't apply to your player fort or adventurer, but will apply your parent entity (this is because the script currently treats player controlled things as their own civilization, that may be changed at a later date, but for now it is how it is).

Now the tricky part will be how to assign the correct syndromes and things to the units as they appear on your map. I will probably need help with that from more experienced DFHack people, but the base information will all be easily accessible.

When I finally do release the update that ties these too together, it will also come with the Events System that is mentioned in the first post, all three of these systems will be independent, with the option of linking them together, or just using them separately.

EDIT: So here is a thought...

Right now the classes gain bonuses to their attributes, skills, traits, etc... when they level up, but those bonuses are lost when the class is changed to a different one (e.g. A warrior might get more toughness and a mage more willpower). I am happy with these temporary bonuses, but do you think there should also be permanent bonuses? Basically, should a unit gain a bonus to their toughness every time they level as a warrior that stays with them even if they switch to a mage? (e.g. A unit rises to level 5 as a warrior and then switches to a level 1 mage will have more toughness than the same unit that just started as a level 1 mage).

Sorry if I am not explaining this very well, but you can think how most class based rpgs work, you get a bonus for being a certain class (which is currently working) and then you get a permanent bonus everytime you level, based on the class you leveled up with.

Thoughts?
« Last Edit: December 04, 2014, 04:23:42 pm by Roses »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #434 on: December 05, 2014, 03:44:39 pm »

See Edit above.

Also, I am thinking about making two new scripts when I can find the time.
1. A modification of the spawn-unit script, with options for relationship (enemy, friendly, civ, pet, tame, etc...), skills, attributes, equipment, and class (for use with the class system).
2. An extension of the inside-only building script, sort of like a building-trigger, with the indoor/outdoor only options, as well as number options (i.e. you can only have one of a particular building), and anything else I can think of.

Both of these scripts are mainly to be used with the new Events system that I will be releasing when the other systems are bug-free (or at least much less buggy).

@expwnent, I am now ready to start testing the new persistent storage system (I modified my old system so that I just need to change one or two things to move fully to the new system. Does the newest DFHack have the new system?
Logged
Pages: 1 ... 27 28 [29] 30 31 ... 42