Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 30 31 [32] 33 34 ... 38

Author Topic: DFusion - a lua based plugin system (integrated into DFHack)  (Read 152120 times)

VerdantSF

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #465 on: December 07, 2011, 01:04:50 pm »

Is there a way to toggle the size of the armor that armorsmiths make?  Or can elves and humans wear the same armor as their dwarven fortmates?
« Last Edit: December 07, 2011, 01:19:58 pm by VerdantSF »
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #466 on: December 07, 2011, 03:41:05 pm »

Is there a way to toggle the size of the armor that armorsmiths make?  Or can elves and humans wear the same armor as their dwarven fortmates?
Easy way- nope. But AFAIK some of them share the same armor size. And armorsmith makes armor that fits himself. So if you have a troll army you will need troll smiths too. I think because there is no easy way to manage this is the main reason why multirace forts are not enabled by Toady One.

Edit: although i tried starting new thread but look like this is a more lively one... hmm
Edit2: should have named it somehow differently :/ anyway @rumrusher: really interested what will you make :) also a neat lua trick is to make tabled functions (saw it somewhere) works if you have name-> function relation
Code: [Select]
f_table={}
--fill in the table with choices
f_table[RaceTable["KEEPER_INFECTED"]]=function () keeptrack();ControlRace() end
f_table[RaceTable["FRAWD"]]=ControlCiv3
f_table[RaceTable["KEEPER"]]=ControlCiv3
f_table[RaceTable["DWARF"]]=ControlRace
f_table[RaceTable["MAGE"]]=Keeptrack
f_table[RaceTable["INTERN"]]=Nightfriend
--f_table[ raceid]= some function, if you need more then one function you can do inplace functions i.e. like KEEPER_INFECTED above.
if f_table[trai] ~= nil then
   f_table[trai]() -- call the function from the table
else
   Voodoo2() -- did not find this race so call default function
end
this is like switch statements in other programming languages.
« Last Edit: December 07, 2011, 05:12:17 pm by Warmist »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #467 on: December 07, 2011, 07:25:39 pm »

well here's the revised version of Voodoo2
Code: [Select]
function Voodoo2() --stick normal spells here
mattbl=mattbl or BuildMaterialTable() -- could be slow so if there is a table don't do it again
myoff=offsets.getEx("Items")
vector=engine.peek(myoff,ptr_vector)
for i=0,vector:size()-1 do --check all creatures
local off=vector:getval(i)
local mat=engine.peek(off,ptr_item.mat)
local submat=engine.peek(off,ptr_item.submat)
local submat2=engine.peek(off,ptr_item.submat2)
local lid=engine.peek(off,ptr_item.legendid)
local RTI=engine.peek(off,ptr_item.RTI)
local itmser=ptr_item.getname(nil,RTI)
q=mattbl["ADAMANTINE"]
q2=mattbl["SPELL_ZOM"]
q3=mattbl["SPELL_TEL"]
q4=mattbl["SPELL_TRAIT"]
q5=mattbl["SPELL_TRAIT2"]
q6=mattbl["SPELL_TRAIT3"]
q7=mattbl["PERMAICE"]
--[[if submat2==q then
--print("Thank's Warmist")
end]]--
if itmser=="item_backpackst" then
if submat2==q2 then
--print("works")
zombiearmy2()
end
end
if itmser=="item_boulderst" then
if submat2==q4 then
--print("it really works")
Nightfriend()
flg=engine.peek(off,ptr_item.flags)
flg:set(17,1)
end
if submat2==q2 then
--ControlZom3()
--Zombieressurect()
flg=engine.peek(off,ptr_item.flags)
flg:set(17,true)
end
end
if itmser=="item_statuest" then
if submat2==mattbl["SLADE"] then
print("this is the target")
end
if submat2==q3 then
--print("teleport here")
itemwarp()
flg=engine.peek(off,ptr_item.flags)
flg:set(17,true)
end
if submat2==q2 then
Zombieressurect()
flg=engine.peek(off,ptr_item.flags)
flg:set(17,true)
end
end
if itmser=="item_eggst" then
if mat==(129) then
makeghost()
print("it really works")
flg=engine.peek(off,ptr_item.flags)
flg:set(17,true)
end
end
end
end
So now I just need to do is go back to my old rumtools functions and swap out the whole use pointer bits with item placement maybe have yes and no be items that if true will disappear(to clear the function and to prevent horrible game crashes from certain functions.).
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

Koronii

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #468 on: December 07, 2011, 08:41:31 pm »

Is there a way to toggle the size of the armor that armorsmiths make?  Or can elves and humans wear the same armor as their dwarven fortmates?

Elves can wear dwarven armor, they're the same size as our dwarves. But humans can't wear it.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #469 on: December 08, 2011, 02:45:01 am »

Is there a way to toggle the size of the armor that armorsmiths make?  Or can elves and humans wear the same armor as their dwarven fortmates?

Elves can wear dwarven armor, they're the same size as our dwarves. But humans can't wear it.
well it's based on Race than size really. the size bit is just their for flavor text and to explain which race can fit that.

edit: hey when did Prevent scatter stop working in Hamlets?
« Last Edit: December 08, 2011, 06:31:10 am by Rumrusher »
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

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #470 on: December 08, 2011, 11:35:08 am »

Is there a way to toggle the size of the armor that armorsmiths make?  Or can elves and humans wear the same armor as their dwarven fortmates?

Elves can wear dwarven armor, they're the same size as our dwarves. But humans can't wear it.
well it's based on Race than size really. the size bit is just their for flavor text and to explain which race can fit that.

edit: hey when did Prevent scatter stop working in Hamlets?
Did it ever work?

IamanElfCollaborator

  • Bay Watcher
  • Resident Shipper God and Freyjapiller
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #471 on: December 08, 2011, 12:09:45 pm »

And yet I havent found a single community fort using this yet. Why not? At least you dont have to be a dwarf when it starts up.

VerdantSF

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #472 on: December 08, 2011, 12:31:28 pm »

And yet I havent found a single community fort using this yet. Why not?
The game census itself only reads actual dwarves.  A quick glance at "z" is no longer accurate for the total fort population.  Related to this, the current version of Dwarf Therapist only reads actual dwarves, and thus you'll have quite a few fort denizens who have to be toggled manually.  Perhaps there are other big reasons, but those two certainly don't help.  It's too bad.  It's a nifty program!

IamanElfCollaborator

  • Bay Watcher
  • Resident Shipper God and Freyjapiller
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #473 on: December 08, 2011, 01:59:28 pm »

:( Ah, well, at least I still have my minotaur death squad.


EDIT: Wouldn't it be possible to just change the controlling race using Dfusion and do a combined census? That would also work for the DT problem. I know since I use it for my own fortress.
« Last Edit: December 08, 2011, 02:02:00 pm by IamanElfCollaborator »
Logged

VerdantSF

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #474 on: December 08, 2011, 02:08:39 pm »

Oh, I was only talking about multi-species forts.  For that, changing the controlling race still leaves all the other races out in the cold, census-wise.

EDIT: Unless you mean that it's possible to have more than one controlling race.  Is it?

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #475 on: December 08, 2011, 02:33:11 pm »

Oh, I was only talking about multi-species forts.  For that, changing the controlling race still leaves all the other races out in the cold, census-wise.

EDIT: Unless you mean that it's possible to have more than one controlling race.  Is it?
I think IamanElfCollaborator meant that you could cycle through races i.e. do a census/DT on dwarves, on elves, then on trolls. The most annoying thing that i have to tackle is migrants sometimes ignore the list (tested with only dogs as migrants but still dwarves appeared).
I was thinking about starting a community fort with evolution of DFusion itself (i.e. if something can be done, and it would fit the story/occasion). Not only it would be interesting but also benefit other users of DFusion. But as always real life takes away too much time :D

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #476 on: December 08, 2011, 05:49:12 pm »

Is there a way to toggle the size of the armor that armorsmiths make?  Or can elves and humans wear the same armor as their dwarven fortmates?

Elves can wear dwarven armor, they're the same size as our dwarves. But humans can't wear it.
well it's based on Race than size really. the size bit is just their for flavor text and to explain which race can fit that.

edit: hey when did Prevent scatter stop working in Hamlets?
Did it ever work?
well... hmm the last time I remember using it was Tweak where I physically changed the area to that.
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

IamanElfCollaborator

  • Bay Watcher
  • Resident Shipper God and Freyjapiller
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #477 on: December 09, 2011, 10:15:45 am »

I haven't yet had problems with the migrant list, and the census thing works well in my forts. Hm... excuse me while I go figure something out...

Tirion

  • Bay Watcher
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #478 on: December 09, 2011, 06:27:02 pm »

Would someone tell me how to equip companions in Adventurer mode with this utility? In a noob-compatible way if possible, please ;)
Logged
"Fools dig for water, corpses, or gold. The earth's real treasure is far deeper."

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFusion - a lua based plugin system v3.8
« Reply #479 on: December 09, 2011, 09:29:28 pm »

Would someone tell me how to equip companions in Adventurer mode with this utility? In a noob-compatible way if possible, please ;)
First place the X pointer on the companion you want to change to.
then run Adv_tools and the command change Adventurer(either one works also best get the old 3.8 version and not Dfhack's Dfusion for Dfhack's doesn't have an Adv_tools you can add them in but that's intermediate level)
if you succeed you will be swap and dfusion will prompt something about being swapped.
now go back to the game and pick up items, to change back just go back to Dfusion and hit enter.

Adv_tools is based all on using the pointer, where as Tools more "fort mode"or "can't wrap head around use of X pointer for functions." and while it works you screw out of selecting folks if you have over 700 entries you wont be able to look at the first 300, let alone having to wait for it to load up all those creatures.

oh and in personal coding...


Okay so I was testing out necromancy and this happens.
Oh the night creature over to the right is a ghost spawner I place down... and the ghost was former freshly turned zombie companions I accidentally killed.
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
Pages: 1 ... 30 31 [32] 33 34 ... 38