Bay 12 Games Forum

Please login or register.

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

Author Topic: ≡Modding Questions≡ Reaction Triggers, Errors, Wyrms, oh my! v0.42.06  (Read 2941 times)

Teirdalin

  • Bay Watcher
  • It'd be nice if I'd stop getting distracted.
    • View Profile
    • My Youtube Profile

In memory of my betta fish, Fishy; ?/?/2015 - 3/26/2016. Whom loved to eat it's little pellets.  :(
Spoiler (click to show/hide)



Details about the mod, races, and npc races.
Spoiler (click to show/hide)


Bulletpoint format of questions:

•How can you go about summoning a tame creature from a building reaction? √Dirst is awesome.
•How can you use creatures as a reagent in a building reaction?
•How do you design new lair and city structures?
•How do you disable immigrants and caravans for certain civilization races?
•How do you resurrect a unit from a building reaction?
•How do you construct a unit from the corpse of a unit and additional parts? i.e. Reconstructing a dead skeleton, or mechanism, with new body body parts or bone materials?
•How do you temporarily blink units out of existence for complex building reactions, or temporarily send them off the map?
•How do you make a building reaction which essentially "buries" a dead unit?
•How do you essentially make a machine, or workshop which can generate a type of liquid as a result of a reaction?
•How do you "tame" units from a nearby civilization from a building reaction?  i.e. sending Ourist McRaider to capture nearby civs for slaves?
•How can a race not generate ghosts upon death?
•How can a liquid cause a reaction when it comes into contact with an organic creature which converts their blood into more of the liquid?
•How do you make an armored plating around a creatures skin via a building reaction? i.e. Urist McSkeleton getting his bones plated with iron by Urist McArmorsmith (Or Urist McPool of Iron perhaps)
•How do you make a creature not spam it's special attacks when it has them?  i.e. Urist McDraconian not constantly breathing fire and burning it's home down every time it sees a gobbo?    √[CDI:WAIT_PERIOD:####]
•Do old scripts from 2014 like https://gist.github.com/IndigoFenix/8543661 function effectively on DF0.42.06 (The thought now occurs to me, if I examine that I may learn how to do the above)
•How do you make custom traps?  Let's say enemy walks over landmine and gets blasted to bits?
•How do you make a civilization only live in the magma layer, hell, volcanoes, or the ocean?
•How do you make custom labors?  i.e. Magic exclusive labor instead of all alchemy? √Figured it out on my own.
•If a new labor is added, does dwarf therapist and autolabor automagically manage them properly?
•Can you make a civilization specific domestic creature?  i.e. high elves embark and cities allowing mana wisps, but other race embarks not. √Found a script which does just this by Urist Da Vinci

•When using an ability, does the projectile always have to be spinning?  Powers, abilities, syndromes, are confusing the heck out of me actually. @_@
More Info on my confusion:
Spoiler (click to show/hide)
And-  I don't know if it works or not as I have no idea how I'd even go about testing this.  The closest I could get to testing it was making a can_do_interaction:material_emission on my high elves with
Spoiler (click to show/hide)


BAD PUN:
Spoiler (click to show/hide)
•Is it possible to have a material evaporate after being cast?  I've found that arcane missiles I shot just left a blue blob on the ground, seemingly forever as it cannot be interacted with, where it hit if it didn't get a direct hit on the target.   Also is it possible for the spell effect to be judged by say-  willpower instead of throwing and archery?  I mean I guess throwing/archery makes sense, but not all ranged spells should boost these stats.


•What would you say are must-have utilities?  Currently I'm using QS_Graphic_set_tools, LangCreate, raw_tile_selector, and Workshop Draw.  And coding in Notepad++.
•Does anyone have a Dwarf Fortress language library for Notepad++ that's not from 2013??


Redistribution permission questions which do not need responses, as I will look this all up later if none is given- but I'm sure someone out there must know these things:
Spoiler (click to show/hide)

Speaking of which, if anyone with knowledge of modding DF would like to assist with the project I would appreciate it.

  Anyone know off the top of their head, if graphics can be over 16x16 without any crazy tricks? As that seems to be the standard and I've been only making 32x32 sprites Fortunately 32x32 works just fine.  Anyone know why most graphic packs are only 16x16?

I seem to be having an issue as of late,  trying to make a plague slime creature, but all of it's attacks are glancing off,  any idea what makes attacks-  not glance?  Each attack is connecting, just had to give it can learn and some natural relevant skill;  but the glancing is terrible.  All I can find for "attacks are all glancing off modded creature" is a bunch of people talking about colossi.
« Last Edit: March 31, 2016, 08:56:21 pm by Teirdalin »
Logged
Insert Witty Signature Here.

Bogus

  • Bay Watcher
    • View Profile

some of the things cant be done to my knowledge(new skills, civs in magma layer/hell, design new lair structures, ..) with existing tools.

otherwise, there exist a couple of dfhack scripts involved with ressurection, ghosts, buildings triggers, enslaving, summoning, liquid creation, cavaren and migrant manipulation, and custom traps. so you would basically want to sift through existing script and addons and see what information you can fnd.
Logged

Teirdalin

  • Bay Watcher
  • It'd be nice if I'd stop getting distracted.
    • View Profile
    • My Youtube Profile

some of the things cant be done to my knowledge(new skills, civs in magma layer/hell, design new lair structures, ..) with existing tools.

otherwise, there exist a couple of dfhack scripts involved with ressurection, ghosts, buildings triggers, enslaving, summoning, liquid creation, cavaren and migrant manipulation, and custom traps. so you would basically want to sift through existing script and addons and see what information you can fnd.

I figure that the other things require scripting; but my issue is that I don't quite understand the process of how the LUA hooking even works.

I do have some theories on how to add skills via editing the exe; I've actually managed to replace the bogeyman creature using a suggestion from someone else like this; but each of my attempts at adding my magic skills have lead to a non functioning exe so far.  But I'm not giving up that easily.  Simply renamed Alchemy in the .exe, that functions well enough for the purpose of having a dedicated magic labor.  It's very finicky though on the naming, but I'll figure it out.

Spoiler (click to show/hide)
[/s]



Found a work-around to the letter limit, allowing me to have any length labor.

Aha!  Got my own magical labor. :D  Although RIP useless alchemy labor.  Maybe I can keep the code name for it as alchemy so that other programs that manage alchemy will detect it still; maybe, if that would work, hmmhmm  It still gets detected as the alchemy labor in dwarf therapist and whatnot, even though the name and tag is changed to mysticism.
« Last Edit: March 29, 2016, 10:41:54 pm by Teirdalin »
Logged
Insert Witty Signature Here.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: ≡Modding Questions≡ Magic, explosions, robotics, oh my! v0.42.06
« Reply #3 on: March 27, 2016, 05:58:57 pm »

You will want to use reaction-trigger for a lot of these, which can set off an arbitrary script when a reaction finishes.  The latest build of DFHack now includes create-unit, so there is a pseudo-standard method of spawning critters now (works great for tame/domesticated creatures, okay for wild animals, badly for citizens, doesn't even attempt announcement-worthy megabeasts).
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

Teirdalin

  • Bay Watcher
  • It'd be nice if I'd stop getting distracted.
    • View Profile
    • My Youtube Profile
Re: ≡Modding Questions≡ Magic, explosions, robotics, oh my! v0.42.06
« Reply #4 on: March 27, 2016, 06:22:26 pm »

You will want to use reaction-trigger for a lot of these, which can set off an arbitrary script when a reaction finishes.  The latest build of DFHack now includes create-unit, so there is a pseudo-standard method of spawning critters now (works great for tame/domesticated creatures, okay for wild animals, badly for citizens, doesn't even attempt announcement-worthy megabeasts).

Could you perhaps point me in the direction of an article or perhaps a tutorial which goes into depth about how I would go about this?
Logged
Insert Witty Signature Here.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: ≡Modding Questions≡ Magic, explosions, robotics, oh my! v0.42.06
« Reply #5 on: March 27, 2016, 10:48:13 pm »

You will want to use reaction-trigger for a lot of these, which can set off an arbitrary script when a reaction finishes.  The latest build of DFHack now includes create-unit, so there is a pseudo-standard method of spawning critters now (works great for tame/domesticated creatures, okay for wild animals, badly for citizens, doesn't even attempt announcement-worthy megabeasts).

Could you perhaps point me in the direction of an article or perhaps a tutorial which goes into depth about how I would go about this?
I don't know about a tutorial, but you can look inside mods, or the DFHack thread, for examples.  I use reaction-trigger in that mod in my signature, but to add syndromes rather than execute a script.  Running a script would look like this inside your onLoad.init:

modtools/reaction-trigger -reactionName TEIRDALIN_CUSTOM_REACTION -command "my-lua-command -haplessTarget \\WORKER_ID -wickednessParameter 25"

I also use create-unit, but it is called from inside another script and the surrounding logic is really convoluted.  Better to just experiment with it at the console prompt.
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

Teirdalin

  • Bay Watcher
  • It'd be nice if I'd stop getting distracted.
    • View Profile
    • My Youtube Profile
Re: ≡Modding Questions≡ Magic, explosions, robotics, oh my! v0.42.06
« Reply #6 on: March 28, 2016, 12:12:36 am »

You will want to use reaction-trigger for a lot of these, which can set off an arbitrary script when a reaction finishes.  The latest build of DFHack now includes create-unit, so there is a pseudo-standard method of spawning critters now (works great for tame/domesticated creatures, okay for wild animals, badly for citizens, doesn't even attempt announcement-worthy megabeasts).

Could you perhaps point me in the direction of an article or perhaps a tutorial which goes into depth about how I would go about this?
I don't know about a tutorial, but you can look inside mods, or the DFHack thread, for examples.  I use reaction-trigger in that mod in my signature, but to add syndromes rather than execute a script.  Running a script would look like this inside your onLoad.init:

modtools/reaction-trigger -reactionName TEIRDALIN_CUSTOM_REACTION -command "my-lua-command -haplessTarget \\WORKER_ID -wickednessParameter 25"

I also use create-unit, but it is called from inside another script and the surrounding logic is really convoluted.  Better to just experiment with it at the console prompt.

I'll be sure to check it out. Thanks for the help Dirst;  also one more thing,  should I have a pre-existing onLoad.init?  Figured out the onLoad.init, now for more testing of things; going to try to get the wisp reaction functioning today.

Edit:  I am still totally clueless about how I got to get this running. x_x  I did check the way you did yours though, not entirely sure where I went wrong here.  Just tried
Spoiler (click to show/hide)
and it did nothing,  speaking of which; is there a specific tag to add in with the spawning to make it tamed?
« Last Edit: March 28, 2016, 08:03:04 pm by Teirdalin »
Logged
Insert Witty Signature Here.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: ≡Modding Questions≡ Magic, explosions, robotics, oh my! v0.42.06
« Reply #7 on: March 28, 2016, 11:34:22 pm »

You should be using create-unit, which has a -domesticate option (my little contribution to that script).  I would also set the age to zero for completeness.

modtools/reaction-trigger -reactionName SUMMON_MANAWYRM -command "modtools/create-unit -race MANAWYRM -caste MALE -location \\LOCATION -age 0 -domesticate"

You may need to experiment with the location bit to make sure everything parses correctly.
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

Teirdalin

  • Bay Watcher
  • It'd be nice if I'd stop getting distracted.
    • View Profile
    • My Youtube Profile
Re: ≡Modding Questions≡ Magic, explosions, robotics, oh my! v0.42.06
« Reply #8 on: March 29, 2016, 05:09:11 am »

You should be using create-unit, which has a -domesticate option (my little contribution to that script).  I would also set the age to zero for completeness.

modtools/reaction-trigger -reactionName SUMMON_MANAWYRM -command "modtools/create-unit -race MANAWYRM -caste MALE -location \\LOCATION -age 0 -domesticate"

You may need to experiment with the location bit to make sure everything parses correctly.

Thank you Dirst!! :D  You're so helpful.

Hmmm, I wish I wasn't so clueless about this thing. x_x  Looking in the dfhack console it looks as if
Spoiler (click to show/hide)
The actual reaction-trigger script is tossing errors.  Looking at that line, the ooonnnnllllyyy issue I can think of is-   \\LOCATION is tossing a string instead of a table?
#62
Spoiler (click to show/hide)
#114
Spoiler (click to show/hide)
#155
Spoiler (click to show/hide)
Or perhaps it wanted a string but got a table?  I can't imagine \\LOCATION to give a string, I tried replacing \\LOCATION with 0 0 0 and I believe it gave the same error; I'm not sure it's even getting to that point.


Also when looking inside the scripts I noticed
Spoiler (click to show/hide)
  That seems pretty awesome; although you said it works badly for citizens;  any particular reason why?

Anyways I'm getting how the reaction-triggers work now, and the way it grabs other scripts- just can't actually-  get it to work.

I got a feeling I'm doing something wrong that's,  really freaking obvious and making myself look like an idiot.
« Last Edit: March 29, 2016, 06:15:46 am by Teirdalin »
Logged
Insert Witty Signature Here.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile

Away from my machine right now, but try

modtools/reaction-trigger -reactionName SUMMON_MANAWYRM -command "modtools/create-unit -race MANAWYRM -caste MALE -location [ \\LOCATION ] -age 0 -domesticate"

Note the spaces around the brackets.  That is how a list/array is specified on the command line.  It looks like \\LOCATION is giving you "10 20 30" instead of the "[ 10 20 30 ]" you need.
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

Teirdalin

  • Bay Watcher
  • It'd be nice if I'd stop getting distracted.
    • View Profile
    • My Youtube Profile

Away from my machine right now, but try

modtools/reaction-trigger -reactionName SUMMON_MANAWYRM -command "modtools/create-unit -race MANAWYRM -caste MALE -location [ \\LOCATION ] -age 0 -domesticate"

Note the spaces around the brackets.  That is how a list/array is specified on the command line.  It looks like \\LOCATION is giving you "10 20 30" instead of the "[ 10 20 30 ]" you need.

Hmm, giving the same bad argument #1 to 'ipairs' Table expected, got string error.    Infact I tested with just
Spoiler (click to show/hide)
to see if it's part of the actual command which is tossing the error; and it looks as if it's not even reaching the command before erroring.


Figured it out! :D  Thanks again Dirst!  Turned out the problem was that it needed brackets not quotation marks.  Which means I can now summon pets and creatures properly. ^_^  This will be incredibly useful for some of the races.

modtools/reaction-trigger -reactionName SUMMON_MANAWYRM -command [ modtools/create-unit -race MANAWYRM -caste MALE -location [ \\LOCATION ] -age 0 -domesticate ]
Logged
Insert Witty Signature Here.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile

Glad that you got it working.

As for your earlier question, you can create domesticated or wild animals, but trying to make a citizen will result in a creature of the correct race but no personality.  This sounds like it might fit with some mod ideas, but my intuition is that it would eventually break the game (for example, when someone with no preferences gets a strange mood).
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

Bogus

  • Bay Watcher
    • View Profile

there is a script that lets you tinker with souls tho, i reckon it can also make them. http://www.bay12forums.com/smf/index.php?topic=147763.0
Logged

Teirdalin

  • Bay Watcher
  • It'd be nice if I'd stop getting distracted.
    • View Profile
    • My Youtube Profile

there is a script that lets you tinker with souls tho, i reckon it can also make them. http://www.bay12forums.com/smf/index.php?topic=147763.0

That's definitely going to be something at least two of the races will be using.  Thanks, and I'll look into it. :D

Glad that you got it working.

As for your earlier question, you can create domesticated or wild animals, but trying to make a citizen will result in a creature of the correct race but no personality.  This sounds like it might fit with some mod ideas, but my intuition is that it would eventually break the game (for example, when someone with no preferences gets a strange mood).

Oh yeah that's true.  I believe I actually saw something somewhere for disabling strange moods.  Zombie worker minions would be perfect for no personalities if it doessssnnn't break the game.
« Last Edit: March 29, 2016, 05:14:01 pm by Teirdalin »
Logged
Insert Witty Signature Here.

Urlance Woolsbane

  • Bay Watcher
    • View Profile

Oh yeah that's true.  I believe I actually saw something somewhere for disabling strange moods. 
As of version 0.42.00, only creatures with [STRANGE_MOODS] can get (surprise surprise) strange moods.
Logged
"Hey papa, your dandruff is melting my skin. Is that normal?"
"SKREEEONK!!!"
"Yes, daddy."
Pages: [1] 2