Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 20 21 [22] 23 24 ... 42

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

Roses

  • Bay Watcher
    • View Profile
Re: DFHack Spells R5 update (now with class system)
« Reply #315 on: August 20, 2014, 11:06:59 am »

The only reason I would elect to do it outside of DF is because I don't know how to do the gui stuff in DF, but if it is not too hard to learn, it would be better to be in DF I think.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack Spells R5 update (now with class system)
« Reply #316 on: August 21, 2014, 10:56:40 pm »

@Deon expwnent says that if the scripts that work for r5e1 (which is the last version I tested on) should work for the 40.X versions of DF. Haven't tested it yet myself, but you can definitely give it a try.

@Warmist If I can get something that works like gui/gm-editor I think that would be best. Have different links to different things (like entities, classes, lore, quests?, maybe some other things). I will look through the various gui codes and see if I can replicate it. I don't think I will make it modular, I will just make it for my mod and then write a small help piece for other modders to modify it for their own mods.
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack Spells R5 update (now with class system)
« Reply #317 on: August 22, 2014, 08:06:27 am »

@Deon expwnent says that if the scripts that work for r5e1 (which is the last version I tested on) should work for the 40.X versions of DF. Haven't tested it yet myself, but you can definitely give it a try.

@Warmist If I can get something that works like gui/gm-editor I think that would be best. Have different links to different things (like entities, classes, lore, quests?, maybe some other things). I will look through the various gui codes and see if I can replicate it. I don't think I will make it modular, I will just make it for my mod and then write a small help piece for other modders to modify it for their own mods.
Actually gui is very easy to do and it's strange that nobody does it. I was thinking of making a tool that would replace the description window with something with "hyperlinks". Like each hist-figure mentioned in engraving would be clickable and would open legends-like window. Though it would take quite a lot of time to implement that...

Roses

  • Bay Watcher
    • View Profile
Re: DFHack Spells R5 update (now with class system)
« Reply #318 on: August 22, 2014, 09:15:44 pm »

Looking through that gui stuff it does seem pretty easy to do (at least a lot easier than I was thinking it would be). This will be a fun experience I think and it might drive me to write more for the gui in the future, but for now I really want to finish up the Class and Civilization scripts (since I said I would do that) and when I am done with that I will work on a Journal system. For now I am envisioning a simple system that allows users to write a list of entries and sub-entries (and sub-sub entries etc...) and then specify when they are in the journal, with options like always, only after certain reactions are preformed, only after certain time passes, only after certain wealth is reached, etc...

But for now, for now, my job is to add the polished experience system into the Class scripts, and release the Civilization scripts. I return from traveling next week so hopefully I will have the time to finish those up before too long.

EDIT: Just thought of a cool way to incorporate quests, the modder can set up a set of requirements, like the first quest could be raise your forts wealth to 20,000, then the second could be grow your fort to 50 Dwarves, etc... You could have different quest chains, and once the quests are complete the game could create a reward of some sort (e.g. Your Village Hall building upgrades to a Town Hall upgrades to a City Hall etc...) which opens up more options. You could even do quests like, kill 100 invaders, kill 1000 invaders, kill a megabeast, etc... The format will look something like;
Code: [Select]
[QUEST:ADVANCEMENT]
 [NAME:Build your fort into a proper settlement]
 [PARTS:4]
 [PART:1]
  [P_NAME:Start your new fort]
  [REQUIREMENT:WEALTH:CREATED:10000]
  [REWARD:BUILDING:VILLAGE_HALL]
  [REWARD:COUNTER:FORT:1]
 [PART:2]
  [P_NAME:Expand your fort]
  [REQUIREMENT:WEALTH:CREATED:25000]
  [REQUIREMENT:POPULATION:30]
  [REWARD:UPGRADE:BUILDING:VILLAGE_HALL:TOWN_HALL]
  [REWARD:COUNTER:FORT:1]
 [PART:3]
  [P_NAME:Establish trading fort]
  [REQUIREMENT:WEALTH:EXPORTED:25000]
  [REWARD:BUILDING:TRADING_STALL]
  [REWARD:ITEM:COINS:GOLD:1000]
  [REWARD:COUNTER:FORT:1]
  [REWARD:COUNTER:TRADE:1]
 [PART:4]
  [P_NAME:Expand your fort]
  [REQUIREMENT:WEALTH:CREATED:100000]
  [REQUIREMENT:POPULATION:75]
  [REWARD:UPGRADE:BUILDING:TOWN_HALL:CITY_HALL]
  [REWARD:COUNTER:FORT:1]
« Last Edit: August 23, 2014, 08:11:12 pm by Roses »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack Spells R5 update (now with class system)
« Reply #319 on: August 25, 2014, 04:51:26 am »

@Deon expwnent says that if the scripts that work for r5e1 (which is the last version I tested on) should work for the 40.X versions of DF. Haven't tested it yet myself, but you can definitely give it a try.

@Warmist If I can get something that works like gui/gm-editor I think that would be best. Have different links to different things (like entities, classes, lore, quests?, maybe some other things). I will look through the various gui codes and see if I can replicate it. I don't think I will make it modular, I will just make it for my mod and then write a small help piece for other modders to modify it for their own mods.
Actually gui is very easy to do and it's strange that nobody does it. I was thinking of making a tool that would replace the description window with something with "hyperlinks". Like each hist-figure mentioned in engraving would be clickable and would open legends-like window. Though it would take quite a lot of time to implement that...
gui crosses into the world of web design and well I sure as hell have no HTML or know how to draw with Coding. like I have no idea what can you do with gui and how much can you get away with it?
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack Spells R5 update (now with class system)
« Reply #320 on: August 25, 2014, 09:38:35 am »

Check out mod-manager just for a small example. It really is pretty simple.

Roses

  • Bay Watcher
    • View Profile
Re: DFHack Spells R5 update (now with class system)
« Reply #321 on: September 01, 2014, 02:39:35 pm »

Class system update:

1. Experience can now be earned by all friendly units around the unit who makes the kill. The radius defaults to -1, which is the current behavior of killer only. To change go to hack/scripts/base/classes.lua and change the radius = -1 line to whatever you would like. Experience is added straight up to all units, not divided amongst them. Plan accordingly.
2. Spells can now have an associated "cost" to learn. This cost is represented by experience and is tracked separately from class and total experience. The price of learning a spell will be subtracted from this amount, and if you don't have enough, the spell will not be learned. To add a cost to the spells add [SPELL_COST:#] To the spell entry in the classes.txt file.
3. A new script, add-experience.lua, has been made so that you can gain experience with interactions (or anything that can trigger scripts, like reactions). Eventually I will be implementing an automatic way to generate experience from interactions, but for now you will need to use the syntax
Code: [Select]
modtools/interaction-trigger -onAttackStr "whatever your CDI:VERB is" -command [ classes/add-experience -unit \\ATTACKER_ID -amount # ]   By default you will gain no experience from interactions. Can also be used for reactions with the following syntax
Code: [Select]
modtools/reaction-trigger -reactionName TRAIN_CLASS -command [ classes/add-experience -unit \\WORKER_ID -amount # ]
All scripts *should* work with the updated DFHack for 40.xx, but remember that the syntax has been dramatically changed, so that the scripts no longer function off of reading SYN_CLASSes and instead rely entirely on the system shown above. Please let me know if there is any difficulty.

Looking to the future, I am almost done with a working "Civilization" system which has the basics in it (adding animals, items, materials, etc...). I am going to keep working on it for awhile until I get most of the features I had originally planed implemented, then I am also going to handle the "Living World" aspect that I mentioned earlier, with the hopes of tying the two together into a cohesive system that allows for the "story" to progress while you play the game.

After I am frustrated enough, or somehow magically get it all to work, I am then going to tackle a gui based journal that is currently planned to keep track of most generic information (e.g. 17 Migrants arrived, 12 Goblins and 2 Trolls sieged us, Ultimate Super Name the thong was created, etc...), as well as more specific things that a modder might want you to have access to while playing (e.g. Metal working flow charts, expanded descriptions, etc...). Finally I will also be adding a quest system into the journal that will reward players based on modder created quests.

That is what I am planning for now. (And my poor mod gets further delayed by my DFHack ideas, oh well)
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack Spells (updated 9/1/14)
« Reply #322 on: September 04, 2014, 05:00:46 pm »

Question for those that may be interested in using my civilization script. Currently in the game a single entity in the raws can have multiple instances in game, do you think each of those instances should level up individually (e.g. Human civilization A and B each have a chance to level up independent of each other) or should all instances of the same entity level up at the same time?

Follow up question, what kind of leveling methods would people like to see, I currently have
YEARLY
SEASON
MONTHLY
WEEKLY
DAILY
KILLS
INVASIONS
TRADES
COUNTERS

The time based ones all include a percentage chance (from 1-100) so you can say that a civilization has a 25% chance every year to level. The others are all counts based, so you say that they level up at X number of kills, or what have you. The COUNTERS method is tied to things like reactions and interactions which can call my counters script. The level up method can also change, depending on the level, so you could have a civilization go YEARLY:100 -> YEARLY:75 -> YEARLY:50 -> YEARLY:25 etc... (or even YEARLY:50 -> KILLS:10 -> YEARLY:100 -> INVASIONS:2, basically whatever you want).
Logged

Godlysockpuppet

  • Bay Watcher
  • [Insert wit here]
    • View Profile
Re: DFHack Spells (updated 9/1/14)
« Reply #323 on: September 08, 2014, 10:20:37 am »

Maybe add in the ability for a god to 'enlighten' a civilization? If at all possible? Not quite sure what you're capable of, but perhaps they could grant access to something like new reactions?
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack Spells (updated 9/1/14)
« Reply #324 on: September 08, 2014, 10:54:41 am »

Maybe add in the ability for a god to 'enlighten' a civilization? If at all possible? Not quite sure what you're capable of, but perhaps they could grant access to something like new reactions?

What would you want for an "enlightenment"? Since this is primarily for computer civilizations in fort mode, there isn't much use to adding new reactions, simply adding items and materials to their available list covers all the things that reactions would do anyway. In terms of adding reactions to your own civ, that is possible already using my upgrade-building script, but will be made more streamlined as I continue to work on the "Living World". My plan is for certain buildings to only be upgradeable after certain events have happened, and so lock out reactions until your civ reaches a certain "tech" level.
Logged

Abadrausar

  • Bay Watcher
  • empowering ideas
    • View Profile
    • ♫♪♀HDFPS♂♪♫
Re: DFHack Spells (updated 9/1/14)
« Reply #325 on: September 15, 2014, 06:41:01 am »

..., do you think each of those instances should level up individually (e.g. Human civilization A and B each have a chance to level up independent of each other) or should all instances of the same entity level up at the same time?
My feel about this is that independent level up of different instances of a civ would add to the storytelling value of world generation.
This seems to be confirmed by the fact that the most disrruptive moments in real history are concentrated in the technological breakouts where only some very few people takes exclusive profit of a new tech set that gives them critical advantages before everyone else during a limited timestamp.

Some historical examples: iron age, gunpower, deep sailing, industrialization, microchips, nanotechs ...

Concerning the levelling methods and their optional associated cost. I belive that trying to change the steer of a civ will generate some unrest (in the form of bad thoughs in dwarf fortress) of a part of his individuals (at least those that are resistant to change and also those that lose something). It would be a dream it we could find a way to model this ::)
« Last Edit: September 15, 2014, 05:35:12 pm by Abadrausar »
Logged
::: Humble Dwarf Fortress Publishing System ♫♪♀HDFPS♂♪♫ Mods Push Published in DFFD are auto updated in local Players Catalog :::

Roses

  • Bay Watcher
    • View Profile
Re: DFHack Spells (updated 9/1/14)
« Reply #326 on: September 15, 2014, 01:35:59 pm »

I decided to go with individual leveling, although I don't know how much of an effect it will really have since I don't believe you often encounter different groups of the same entity (is it even possible to be at war with Human A and be at get traders from Human B?).

Concerning the levelling methods and their optional associated cost. I belive that trying to change the steer of a civ will generate some unrest (in the form of bad thoughs in dwarf fortress) of a part of his individuals (at least those that are resistant to change and also those that lose something). It would be a dream it we could find a way to model this ::)

Since currently this is only for external civilizations (meaning not your fort) I'm not sure adding unhappy thoughts would do anything (does the game keep track of happiness levels for non-player controlled units?). I agree that when I expand this to work for your fort that it would be nice for some people to be happy/unhappy about any changes, although that might be a little difficult. I suppose I could tie it into their personality traits somehow.

Small update. I am almost done with the first pass of scripts, they currently let you add and remove creatures, items, inorganic materials, organic materials, refuse (bone, shells, etc...), and miscellaneous things (quivers, backpacks, barrels, booze, meat, etc...) to a civilization based on their level. The level can change with time (YEARLY, SEASONALY, MONTHLY, WEEKLY, and DAILY) or based on some counter (current counter values are KILLS or CUSTOM). You can also add and remove noble positions, change ethic tags (although I am not sure that this has any actual effect in game), and change the leveling method.

The syntax will be like this (note that it is not completely finalized yet, they final scripts will have a full explanation of the correct syntax)
Code: [Select]
[CIV:PLAINS]
[NAME:humans from the north]
[LEVELS:1]
[LEVEL_METHOD:DAILY:100]
[LEVEL:0]
 [LEVEL_NAME:started in the stone age]
 [LEVEL_REMOVE:CREATURE:PET:ALL:ALL]
 [LEVEL_REMOVE:INORGANIC:ALL]
 [LEVEL_REMOVE:ITEM:ALL]
 [LEVEL_ADD:CREATURE:WOLF:MALE]
 [LEVEL_ADD:CREATURE:WOLF:FEMALE]
 [LEVEL_ADD:INORGANIC:STONE:OBSIDIAN]
 [LEVEL_ADD:INORGANIC:STONE:GRANITE]
 [LEVEL_ADD:ITEM:WEAPON:CLUB]
 [LEVEL_ADD:ITEM:SHIELD:BUCKLER]
 [LEVEL_ADD:ITEM:WEAPON:SLING]
 [LEVEL_ADD:ITEM:AMMO:SLING_AMMO]
 [LEVEL_ADD:ITEM:ARMOR:TUNIC]
 [LEVEL_ADD:ITEM:HELM:CAP]
 [LEVEL_ADD:ITEM:GLOVES:GLOVES]
 [LEVEL_ADD:ITEM:SHOES:BOOTS]
 [LEVEL_ADD:ITEM:PANTS:PANTS]
[LEVEL:1]
 [LEVEL_NAME:entered the bronze age]
 [LEVEL_ADD:CREATURE:HORSE:MALE]
 [LEVEL_ADD:CREATURE:HORSE:FEMALE]
 [LEVEL_ADD:CREATURE:SHEEP:MALE]
 [LEVEL_ADD:CREATURE:SHEEP:FEMALE]
 [LEVEL_ADD:INORGANIC:METAL:BRONZE]
 [LEVEL_ADD:INORGANIC:METAL:TIN]
 [LEVEL_ADD:INORGANIC:METAL:COPPER]
 [LEVEL_ADD:INORAGNIC:METAL:LEAD]
 [LEVEL_ADD:ITEM:WEAPON:SWORD]
 [LEVEL_ADD:ITEM:WEAPON:SPEAR]
 [LEVEL_ADD:ITEM:WEAPON:AXE]
 [LEVEL_ADD:ITEM:WEAPON:CLUB]
 [LEVEL_ADD:ITEM:WEAPON:BOW]
 [LEVEL_ADD:ITEM:AMMO:ARROW]
 [LEVEL_ADD:ITEM:SHIELD:SHIELD]

It also appears that you can change what inorganics are available to make certain items out of. For instance, a civilization might know how to produce steel, but it may not know how to make weapons or armor out of it. This could be manipulated to fort mode by making your fort need to research steel production, then research steel weapon making and steel armor making, although I haven't done any tests in regards to this, so I am not sure if it would actually work that way.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack Spells (updated 9/1/14)
« Reply #327 on: September 17, 2014, 10:44:50 am »

Another small update, it looks like the beginnings of "events" will be included in the next update (a lot of the code for them is the same as the code for the civilization scripts). It will work based on the fake raw setup that both the classes and civilization scripts use. The currently supported syntax is
Code: [Select]
[EVENT:TEST_1]
 [NAME:this is a testing event]
 [CHECK:WEEKLY]
 [REQUIREMENT:COUNTERS:FIRE:1]
 [REQUIREMENT:WEALTH:50000]
 [REQUIREMENT:POPULATION:20]
 [CHANCE:2]
 [EFFECT:SPAWN_DRAGON_FIRE]
  [ANNOUNCEMENT:A wild fire dragon has come looking for riches!]
  [LOCATION:RANDOM:SURFACE]
  [UNIT:DRAGON:MALE]
  [SCRIPT:spawn-unit -unit \\UNIT -location \\LOCATION -hostile]
 [EFFECT:BUFF_DWARF]
  [DELAY:100]
  [ANNOUNCEMENT:A dwarf hero emerges from your fort. ready to defend his treasures!]
  [UNIT:RANDOM:FORTRESS]
  [SCRIPT:unit/attribute-change -unit \\UNIT -set {5000,5000,5000,5000,5000} -physical {STRENGTH,AGILITY,TOUGHNESS,ENDURANCE,RECUPERATION} -dur 1200]

This event will have a 2% chance every week to happen once you meet the requirements. As you can see it is fairly basic right now, but it still allows for an extra level of FUN! that can be added to the game (Fort mode only for now, as most of my stuff is). Let me know what you think!
Logged

TheDorf

  • Bay Watcher
    • View Profile
Re: DFHack Spells (updated 9/1/14)
« Reply #328 on: September 19, 2014, 06:12:13 am »

Would it be possible to make a specific weapon type trigger the projectiles script? How would I go about this? :o
Logged
I love this community. Somebody asks "hay guise how do i tame shark", and then everybody is like "why don't we fling sharks at things with complex mechanical devices?".

Roses

  • Bay Watcher
    • View Profile
Re: DFHack Spells (updated 9/1/14)
« Reply #329 on: September 19, 2014, 11:49:43 am »

What do you mean? If you mean holding a specific weapon allows a unit to use the projectile script then yes. What you would need to do is use item-trigger to give an interaction which uses interaction-trigger to set off the script. Something like

modtools/reaction-trigger -itemType BLAH_ITEM_BLAH -command [ addSyndrome blah blah blah ] -equip
modtools/interaction-trigger -onAttackStr "whatever CDI:VERB is" -command [ special/projectile -unitSource \\ATTACKER_ID -unitTarget \\DEFENDER_ID -the rest of the stuff for the projectile command goes here ]
Logged
Pages: 1 ... 20 21 [22] 23 24 ... 42