Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: IndigoFenix's Scripts: Updated with soul splitting, fusion, and soul combat  (Read 7494 times)

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game

Link to Github

Well, I generally tended to put my scripts in the main collection, but for some reason that keeps on sliding down the page and disappears.  So I guess I'll put 'em here.

Scripts included:

Spoiler: ghostly (click to show/hide)
Spoiler: timestream (click to show/hide)
Spoiler: add-exp (click to show/hide)
Spoiler: hfspit (click to show/hide)
Spoiler: exile (click to show/hide)
Spoiler: slam (click to show/hide)

Latest addition, created during a strange mood (well, half of it is new, anyway): ConstructCreature-ShuffleSoul

This script enables you to write reactions to manipulate souls and construct bodies.  I have combined the scripts into one since they use each other's functions a lot.
It lets you utilize the system in many different ways using the reaction ids as commands.  You can make robots and golems out of any material, move souls around, eat souls, split souls in half, transfer souls into robots, create astral projections from souls, store souls in constructs, assimilate creatures into your civ, and pretty much any combination of these.  The script, instructions, and some raw examples are on this page.

Roses

  • Bay Watcher
    • View Profile
Re: IndigoFenix's Script Collection
« Reply #1 on: January 21, 2015, 02:38:27 pm »

Question I've always meant to ask, I know it isn't updated for DF2014, but how does construct-creature work? How do you specify the material of the creature? Isn't that stored in the raws?

Also, other questions.

1. ghostly: does this have any effect on unit behavior and thoughts? if for instance I make a "banishment" type spell that turns a unit into a ghost so it can't attack or be attacked, and then turn them back some time later, how will that effect the combat?
2. timestream: how does this work? does it speed up all the actions? is it just for making the game pass by faster? I couldn't for instance, use a "time warp" type spell and only effect certain units?
3. exile: does this still work for units deciding to leave during caravans?
4. hfspit: "Will usually not trigger the apocalypse." Haha, awesome. How big is the pit. If I have a unit next to the unit targeted will it fall in too? Is the pit closed up after the fall?
« Last Edit: January 21, 2015, 02:44:13 pm by Roses »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: IndigoFenix's Script Collection
« Reply #2 on: January 21, 2015, 05:20:55 pm »

you may want to end these in .lua so that gist properly recognizes their syntax (for highlighting)...

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: IndigoFenix's Script Collection
« Reply #3 on: January 23, 2015, 08:39:18 am »

So I have an early version of soulshuffle here.  Some parts don't work yet (fusing, splitting, and storing souls in items), but you can do stuff like body swapping and storing multiple souls in a single unit, which is cool.

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: IndigoFenix has created ConstructCreature-SoulShuffle, a Lua script!
« Reply #4 on: January 26, 2015, 12:49:03 pm »

SoulShuffle is complete!  Or at least complete aside from the various bugs that may or may not show up later.  And any future updates.
I have combined it with the old ConstructCreature script, which has been updated for DF2014.  Not only can you manipulate souls, you can construct creatures to store the souls in or even transform souls into creatures themselves.
The method uses reaction ids as commands.  What it lacks in elegance, it makes up for with flexibility.  You can target pretty much anything using this system, and all you need to modify to create new functions is the reaction raws themselves.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: IndigoFenix has created ConstructCreature-SoulShuffle, a Lua script!
« Reply #5 on: January 26, 2015, 12:54:07 pm »

So... I can finally sacrifice dwarves and put their souls into giant metal golems, instead of just pretending to do so?  8)

And lots of other cool stuff for evil sorcerers. :)

I should buy a proper laptop.

Edit: Stupid question: Can I transfer the soul from a corpse? As in: Warlock dies, corpse used in reaction, soul transfered into the worker? I'm thinking either a new form of resurrection that way, or one powerful Lich/Overlord who devours the souls of his servants, becoming both stronger and maybe a little bit insane while doing so, mixing to many personalities in one body
« Last Edit: January 26, 2015, 12:55:56 pm by Meph »
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 :::

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: IndigoFenix has created ConstructCreature-SoulShuffle, a Lua script!
« Reply #6 on: January 26, 2015, 01:36:28 pm »

So... I can finally sacrifice dwarves and put their souls into giant metal golems, instead of just pretending to do so?  8)

And lots of other cool stuff for evil sorcerers. :)

I should buy a proper laptop.

Edit: Stupid question: Can I transfer the soul from a corpse? As in: Warlock dies, corpse used in reaction, soul transfered into the worker? I'm thinking either a new form of resurrection that way, or one powerful Lich/Overlord who devours the souls of his servants, becoming both stronger and maybe a little bit insane while doing so, mixing to many personalities in one body

There is not, at this point, support for transferring souls from corpses.  However, you can target dead units.
When a creature dies, it doesn't become a corpse.  It 'drops' a corpse, and then stays where it is.  That's why ghosts spawn on the spot that they died, not the place where the body is.  This script allows you to find 'unrisen ghosts' and capture their souls, either by remembering where they died or simply creating a reaction that has a range over the whole map but only targets dead civ members.

I wasn't sure exactly what your ideas for resurrection were as far as the warlocks are concerned: I know you didn't want to be able to make new ones, but if you want to be able to revive the dead, it is possible to resurrect units in all kinds of ways using this script.  For example, construct a new soulless body, capture the dead warlock's wandering spirit, and transfer it into the husk.  Very warlocky.

Maybe scratch the ghouls and skeletons, and instead make it possible to construct new regular warlock bodies, but they would begin with no souls... you could use tame animal souls to make the husks work as servants, but they wouldn't be able to gain skills unless they were given a sapient soul.  And since warlocks have no friends, there'd be no way to get non-hostile sapient souls except from each other.

And eating souls is possible too, both by storing them separately in one body (you can switch between them, each will have its own personality and skills) or by consuming/combining them (which will create a new soul that is an amalgam of the originals).

Bogus

  • Bay Watcher
    • View Profile
Re: IndigoFenix has created ConstructCreature-SoulShuffle, a Lua script!
« Reply #7 on: August 28, 2015, 11:59:09 am »

wow.

some questions:
- which tokens/properties of creatures are part of their soul and which arent? stuff like [CAN_LEARN] etc seems to be soul material, what about [OPPOSED_TO_LIFE] or even [PRONE_TO_RAGE]? what about crazy dwarves? could custom tags be created and stored in souls to be used in a script later on?
- can this be done in world space? im thinking for example of a babysnatching civ that is eating the souls of their captives, or taking over their bodies. (i assume its not currently possible, but could it be done in principle?)


Logged

Baffler

  • Bay Watcher
  • Caveat Lector.
    • View Profile
Re: IndigoFenix has created ConstructCreature-SoulShuffle, a Lua script!
« Reply #8 on: August 28, 2015, 12:23:13 pm »

This is really impressive, but what do you mean by splitting and fusing souls? A concept is forming for a civ that's really useless in its base form and is either unable to reproduce or does so very slowly, but gets around that by doing things like splitting a soldier into 5 parts and putting those into highly specialized golems for combat, and then putting the guy back together when the battle is over. The same could be done for manual laborers, but in both cases stopping the original body from decaying might require some trickery.

Hell, maybe they could be completely incorporeal, and if you need more people you'd have build a new body, then use a ritual to split an existing one's soul. You'd then recombine it with another and use a second ritual to reform the original, or use the second ritual twice to get an identical pair. Making a sentient AI race would just be a matter of changing the flavor text.
Logged
Quote from: Helgoland
Even if you found a suitable opening, I doubt it would prove all too satisfying. And it might leave some nasty wounds, depending on the moral high ground's geology.
Location subject to periodic change.
Baffler likes silver, walnut trees, the color green, tanzanite, and dogs for their loyalty. When possible he prefers to consume beef, iced tea, and cornbread. He absolutely detests ticks.

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: IndigoFenix has created ConstructCreature-SoulShuffle, a Lua script!
« Reply #9 on: September 21, 2015, 02:18:29 am »

wow.

some questions:
- which tokens/properties of creatures are part of their soul and which arent? stuff like [CAN_LEARN] etc seems to be soul material, what about [OPPOSED_TO_LIFE] or even [PRONE_TO_RAGE]? what about crazy dwarves? could custom tags be created and stored in souls to be used in a script later on?
- can this be done in world space? im thinking for example of a babysnatching civ that is eating the souls of their captives, or taking over their bodies. (i assume its not currently possible, but could it be done in principle?)

Most tags defined in creature raws are not part of the soul.  Souls contain the following information:

Original species and caste
Original name
Learned skills and experience
Likes and dislikes
Personality traits
Sexual identity (always the sex of the original creature)
Sexual orientation
Soul attributes
Thoughts
Stress level
Dreams
Civ id (interestingly, this is normally separate from the unit's civ id.  However, the script changes the unit's civ id to the civ id of their current soul, because it makes more sense)
Cultural identity (not sure what this does)

Other notes:
CAN_LEARN seems to be the only tag that has an effect when the soul is transferred.  An animal soul in a sapient creature's body will not be able to learn skills.
Strange moods and insanity are not transferred with the soul; you can in theory save an insane dwarf by transferring the soul into a new body.  However, stress is retained, as well as personality, so chances are they'll just go insane again.

This is really impressive, but what do you mean by splitting and fusing souls? A concept is forming for a civ that's really useless in its base form and is either unable to reproduce or does so very slowly, but gets around that by doing things like splitting a soldier into 5 parts and putting those into highly specialized golems for combat, and then putting the guy back together when the battle is over. The same could be done for manual laborers, but in both cases stopping the original body from decaying might require some trickery.

Hell, maybe they could be completely incorporeal, and if you need more people you'd have build a new body, then use a ritual to split an existing one's soul. You'd then recombine it with another and use a second ritual to reform the original, or use the second ritual twice to get an identical pair. Making a sentient AI race would just be a matter of changing the flavor text.

This is possible in theory, but the splitting and combining system is not quite as flexible as it could be.

When a soul is split, the skill levels of each half are divided in two, and the personality traits and thoughts are split up and assigned to each half randomly (so each half can potentially have slightly different personalities).
When souls are combined, the one who acquires the soul only absorbs about 10% of their skills and personality (the idea for this was a race that eats the souls of their enemies and gains their skills).
Making this system more flexible is simply a matter of adding in the proper syntax and rules, but I didn't do this.  If there's demand for it I could.

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: IndigoFenix has created ConstructCreature-SoulShuffle, a Lua script!
« Reply #10 on: September 21, 2015, 12:54:55 pm »

Heh, I grabbed a slab and pulled it up out of a vault without opening the bars by chucking the vaultslab* into them then grabbing it and tossing it through them.

The getting stuck in mid-air thing is annoying though, gotta de-ghost to fix it, so I've taken to using walls as stairs and just moving through them instead of trusting a staircase to not let me accidentally chuck myself into mid-air.

You can also slam into people if you "run" fast enough or launch yourself into them.

*I'm not quite to the point where I can chuck vaults around... yet.
Logged

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: IndigoFenix's Scripts: SoulShuffle updated with soul splitting and fusion
« Reply #11 on: September 22, 2015, 09:52:13 am »

SoulShuffle-ConstructCreature has been updated.  You can now split, merge, copy, and fuse souls with all kinds of percentages and stuff.  There are also rules that allow you to forbid splitting below a certain amount, or fusing souls too much.

Also, you can add in a modifier that turns the reaction into an attack, which means that non-civ members will try to resist it.  Soul combat is based on average soul attributes and adds stress to both souls as they are "damaged", the success/failure rate can be modified.  So you can make a reaction that lets you try and capture a demon's soul, but with a chance at failure or driving the user insane.

Isngrim

  • Bay Watcher
    • View Profile
Re: IndigoFenix's Scripts: Updated with soul splitting, fusion, and soul combat
« Reply #12 on: September 22, 2015, 12:58:35 pm »

ptw

would it be possible to add options that require a construct to have a certain number of souls before it "works" and would it be possible to add interactions to a creature based on number of souls or strength of the soul?


edit* i was also wondering if it would be possible to add an option to make a creature with more than one soul change souls randomly,almost like multiple personality syndrome.
« Last Edit: September 22, 2015, 01:02:40 pm by Isngrim »
Logged
08:43 PM The wild animals and insects sang a merry tune and the trees performed a dance. I know you're trying to cheer me up, Vishnu, but that was actually a bit creepy.-Rhons

Roses

  • Bay Watcher
    • View Profile
Re: IndigoFenix's Scripts: Updated with soul splitting, fusion, and soul combat
« Reply #13 on: September 22, 2015, 02:37:05 pm »

So after playing around with your construct creature which is supposed to let you construct a creature out of any material I have found that you are actually changing an entire creatures definitions, not a specific units. Specifically, from line 1450

Code: (soulshuffle-constructcreature.lua) [Select]
for i=0,#u.body.body_plan.materials.mat_type-1,1 do
local matbase = dfhack.matinfo.decode(u.body.body_plan.materials.mat_type[i],u.body.body_plan.materials.mat_index[i])
local code = ''
if matbase.mode == 'creature' or matbase.mode == 'plant' then
code = matbase.material.id
elseif matbase.mode == 'inorganic' then
code = matbase.inorganic.id
end
local r_item = getReagentItemByCode(reaction,jobmats,code)
r_mat = nil
if jobmats[code] then r_mat = jobmats[code] end
if r_mat ~= nil then
local r_mat_index=r_mat.index
local r_mat_type=r_mat.type
u.body.body_plan.materials.mat_index[i] = r_mat_index
u.body.body_plan.materials.mat_type[i] = r_mat_type
end
end

body_plan is not different for different units. It is a raw based reference. If you make a ruby golem and then you make a silver golem, the ruby golem will also change into a silver golem. This method only works if you will only have one unit and may or may not persist through save/reload.
Logged

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: IndigoFenix's Scripts: Updated with soul splitting, fusion, and soul combat
« Reply #14 on: September 23, 2015, 12:18:52 pm »

So after playing around with your construct creature which is supposed to let you construct a creature out of any material I have found that you are actually changing an entire creatures definitions, not a specific units. Specifically, from line 1450

Code: (soulshuffle-constructcreature.lua) [Select]
for i=0,#u.body.body_plan.materials.mat_type-1,1 do
local matbase = dfhack.matinfo.decode(u.body.body_plan.materials.mat_type[i],u.body.body_plan.materials.mat_index[i])
local code = ''
if matbase.mode == 'creature' or matbase.mode == 'plant' then
code = matbase.material.id
elseif matbase.mode == 'inorganic' then
code = matbase.inorganic.id
end
local r_item = getReagentItemByCode(reaction,jobmats,code)
r_mat = nil
if jobmats[code] then r_mat = jobmats[code] end
if r_mat ~= nil then
local r_mat_index=r_mat.index
local r_mat_type=r_mat.type
u.body.body_plan.materials.mat_index[i] = r_mat_index
u.body.body_plan.materials.mat_type[i] = r_mat_type
end
end

body_plan is not different for different units. It is a raw based reference. If you make a ruby golem and then you make a silver golem, the ruby golem will also change into a silver golem. This method only works if you will only have one unit and may or may not persist through save/reload.

What.

It turns out you're right.

I guess I just never considered that a variable stored inside a unit could be an external reference.

That...basically destroys the entire point of the ConstructCreature script.

Now I'm upset.

...
Pages: [1] 2