Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 215 216 [217] 218 219 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1408088 times)

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3240 on: March 15, 2013, 04:18:45 pm »

Rumrusher, you must be mistaken, because I clearly cannot do this. Otherwise I would have long done so. ;)

Why... I am so confused right now. How can you casually strutt in here, say "yep, you could just spawn an animal, no problem", while every modder ever, has been running around in circles trying to do just that? Its like the holy grail of modding, creating new creatures. An unachieved holy grail I might add, no one has been able to do this. Its just beyond the scope of modding, outside of our grasp.
I just notice what you said(and accidentally click post before reviewing)... sorry uhh well I thought you want a script to summon a unit, which was posted by warmist in the chat, which was modified to work in both fort and adventure mode.
and not how do I combine this script with reactions in general.  well then

Code: [Select]
function PlaceUnit()
trgunit=df.global.world.units.active[0] --could be any unit on site
local u=CreateUnit(trgunit.race,0)  -- the first part is unit race second is caste
u.relations.group_leader_id=trgunit.id --this makes the summon a companion
local u_nem=dfhack.units.getNemesis(u)
local t_nem=dfhack.units.getNemesis(trgunit)
if u_nem then
u_nem.group_leader_id=t_nem.id
end
if t_nem and u_nem then
t_nem.companions:insert(#t_nem.companions,u_nem.id)
end
u.civ_id=(df.global.world.units.active[0].civ_id)
u.pos:assign(df.global.world.units.active[0].pos) --this appoints them near the unit
u.name.first_name="CRUBUGA"
u.name.has_name=true
end

okay so here's a function in Spawnunit called 'place unit', which is used to create and place down a created unit
what you can do with this is like set the race, affiliation, and name of the unit you want to create then spawn them in. now this is fine on it's own and needs basic knowledge of Dfhack to say hook this up to a workshop then have said workshop track who uses it so you can run this with out needing DFhack(which as of now even I can't do.). though from use of this, the units you do make end up part of the fort but no real chance to order them around. oh well I just have to make up to you by learning how to make separate lua_hook reaction scripts for each summon reaction(which has the added bonus of not going fully going through the reaction which means you could set it up so that if the player picks the wrong they could screw up and get a face full of Syndromes.)
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 0.34.11 r3
« Reply #3241 on: March 15, 2013, 04:22:12 pm »

Peerfect. Saibamen, here I come!

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #3242 on: March 15, 2013, 04:28:32 pm »

I assume it would be done like SPATTER_ADD_. The script checks the material from the reaction and applies it, and knows which reactions to check because of the SPATTER_ADD_ in the reaction id. For creatures it would look more like SPAWN_CREATURE_, and it takes creature id and creature caste from the reaction. That way its only one script, not a new one for each reaction. SPAWN_CREATURE_CIV, SPAWN_CREATURE_PET and SPAWN_CREATURE_HOSTILE would be useful of course.

Just to let you know what I would use it for: I currently have those systems in the mod:
Golem creation and Pet Armory, both use transformations
Turrets and Landmines that are build in a factory, these are spawned. Narhirhil and deon have similar things, with robotic spiders and steam centurions.
My spawn location, which does things from sowing treant seeds (spawns 3-5 magical living trees), setting up scarecrows, or a gargoyle statue that come to life when enemies come nearby.
Deon and me also have colosseums/arenas, to summon hostile creatures to fight.
And special rocks that spawn creatures, for "random encounters" while mining.

Because if creatures could be spawned from reactions (or interactions, which would be the same in the end, I guess?) one could simulate invaders that spawn inside a fortress. I was planning on a lich that summons a skeletal army, or wormfolk that digs into your fort, shades the open portals to their realm and pour out... obviously without real diggin and real portals, all simulated, but it would work in a way.
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 :::

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3243 on: March 15, 2013, 05:57:28 pm »

@both Putnam and Maklak: I know how to affect the worker only, or how to use an interaction. That works without problem. Its just that I want to target one single creature inside the workshop that is not the worker by using autosyndrome. I just wanted to know if that is possible. :) More a... design improvement suggestion for the script.

Did you try it without allow multiple targets with a syndrome that only affects the pet? That should work. If you don't allow multiple targets, it stops once it found an acceptable target, starting with the worker.

Actually I just noticed a bug. If you don't allow multiple targets, it could potentially infect two units if one of them is the worker and both can be infected and you don't have worker_only. I'll fix that for the next version.

edit: also make sure you don't use PRESERVE_ROCK. If so, it might create mists which do troublesome things and affect things you don't want affected. If you insist on mists for visual effect, create another boiling rock which has no syndromes.
« Last Edit: March 15, 2013, 06:12:48 pm by expwnent »
Logged

tahujdt

  • Bay Watcher
  • The token conservative
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3244 on: March 15, 2013, 08:05:01 pm »

I remember seeing a "raise dead" dfhack script somewhere. Does anyone know where it is? I couldn't find it on the github or in VJek's library.
Logged
DFBT the Dwarf: The only community podcast for Dwarf Fortress!
Tahu-R-TOA-1, Troubleshooter
Quote
I suggest that we add a clause permitting the keelhauling of anyone who suggests a plan involving "zombify the crew".
Quote from: MNII
Friend Computer, can you repair the known universe, please?

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3245 on: March 15, 2013, 08:11:29 pm »

I repeat: does the previously mentioned summon plugin mean we can load off-site units on the current map?
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3246 on: March 15, 2013, 08:14:13 pm »

I repeat: does the previously mentioned summon plugin mean we can load off-site units on the current map?

No, it makes new ones entirely.

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3247 on: March 15, 2013, 08:24:01 pm »

Aw :(

Oh well, that has fun uses too!
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3248 on: March 15, 2013, 10:46:39 pm »

sorry guys I about the details about spawn units, I rarely use it due to how warmist coded it making more than 1 unit will end up causing the game to crash from trying to remember 10 new units to mark down in nemesis. it's pretty rough and currently needs more work, though that one unit you spawn will make wonders as a meatshield.
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 0.34.11 r3
« Reply #3249 on: March 16, 2013, 12:24:16 am »

So Meph asked me about reactions doing DFHack console commands. Couldn't autosyndrome or somesuch have a kind of... [SYN_CLASS:DFHACK_CONSOLE_weather rain] something? I feel like that could work. Heck, I could maybe add it to itemsyndrome as well, but I'm not sure what utility that would have off the top of my head.

EDIT: Also:

soundsense-season.lua:23: attempt to concatenate field '?' (a nil value)
stack traceback:
...hack\scripts/soundsense-season.lua:23:in function (...hack\scripts/soundsense-season.lua:21)
« Last Edit: March 16, 2013, 12:28:23 am by Putnam »
Logged

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3250 on: March 16, 2013, 12:45:54 am »

soundsense-season.lua:23: attempt to concatenate field '?' (a nil value)
stack traceback:
...hack\scripts/soundsense-season.lua:23:in function (...hack\scripts/soundsense-season.lua:21)


How did you manage to produce that? It means that your 'current season' global contains some totally stupid value instead of normal 0/1/2/3.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3251 on: March 16, 2013, 12:57:57 am »

I just launch the game normally and start genning a world, and that's what happens during worldgen.

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3252 on: March 16, 2013, 01:00:33 am »

Huh. Probably is set to automatically run when a world is loaded, and mistakes worldgen for a loaded map
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3253 on: March 16, 2013, 01:01:31 am »

Yeah, I personally don't think it's much of a problem. Bothers me mostly because I think it's my code erroring it up until I look at it twice :P

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #3254 on: March 16, 2013, 01:49:45 am »

@expwnent: Thank you, deleting PRESERVE_ROCK did it. :) Exactly what I was asking for. :)

@ag: I also have the red error-lines about soundsense. I figured its because I dont have soundsense on, and ignored it.
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 :::
Pages: 1 ... 215 216 [217] 218 219 ... 373