Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 4 5 [6] 7 8 ... 13

Author Topic: [MODDING] REACTIONS QUESTIONS THREAD  (Read 38323 times)

BlackFlyme

  • Bay Watcher
  • BlackFlyme cancels Work: Interrupted by bird.
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #75 on: March 17, 2015, 08:51:34 am »

Anything in your errorlog?

Can't say anything stands out to me as wrong.
Logged

Urist McCoder

  • Bay Watcher
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #76 on: March 17, 2015, 08:58:23 am »

No nothing in the error log, wait would the reactions only show up if I have the stuff to make them?
Logged

BlackFlyme

  • Bay Watcher
  • BlackFlyme cancels Work: Interrupted by bird.
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #77 on: March 17, 2015, 08:59:51 am »

No. If you didn't have the reagents, they would still appear, but they would be red to show you can't use them.

What do the headers look like, and what are the files named?
Logged

Urist McCoder

  • Bay Watcher
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #78 on: March 17, 2015, 09:09:00 am »

I know that the issue is not the file name or the headers because other reactions and buildings in those files work.
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #79 on: March 17, 2015, 11:22:22 am »

If you can build your workshop good, if you can't see your reactions you have either:

1. Named the file wrong should be "reaction_whateveryouwant.txt"
2. wrong header at the very top of the file "reaction_whateveryouwant"
3. Missing the "[OBJECT:REACTION]" tag before your reactions
4. Forgot to permit them in your entity
5. Have a TYPO in the workshop they should show up in (this should errorlog as far as I know)

Also IRON, LEAD and COPPER to GOLD lack a skill tag, and CREATE_AUTOMATION has no product
Logged

Urist McCoder

  • Bay Watcher
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #80 on: March 17, 2015, 11:33:56 am »

I permitted them in the wrong entity ::)

EDIT: I fixed the missing skill tokens, there is no product for create_automaton because I am using that reaction to activate dfhack spawn unit script.
« Last Edit: March 17, 2015, 11:37:46 am by Urist McCoder »
Logged

Snergler

  • Bay Watcher
  • The world is the same as ever.
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #81 on: March 17, 2015, 12:51:06 pm »

Warning - untested idea. This is me being sleepy.

You could split it up into two reactions, one to replace the weapon, one to improve it. Because you want to make the second reaction automatic, during the first reaction, put the sword into a specific container and require the sword in the second reaction to be in that container.

If you don't want to have to make extra containers, you could have an initial reaction that generates a temporary container which is destroyed in the last reaction.

Be sure to require the weapon and the improvement item as reagents even when not being used, to prevent exploits.

yes thanks for the idea, that would work. I thought of something along those lines. I suppose the first reaction could put the items in a bin made of  a material that they would never be made of normally, like cheese, then the second reaction could require only cheese bins, and the merchants will never suspect the weirdness that was required to make there encrusted weapons and armor.
...sorry for the rambling, my coffee has not kicked in yet ;)

EDIT:actually i think that it would take 3 reactions, one to produce the container, one to produce the weapon into container(containers must be a reagent, and so exist beforehand), the third to use up the container, and apply the improvement
but if existing containers are used then it can be just 2 reactions, but i'd have to have a big bin stockpile next to the workshop so the jobs don't get canceld constantly. :'(
 
« Last Edit: March 17, 2015, 06:54:50 pm by Snergler »
Logged

Urist McCoder

  • Bay Watcher
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #82 on: March 17, 2015, 07:39:41 pm »

what if you had the reaction to make the cheese and then an automatic reaction to replace the sword, and then another automatic reaction to improve the sword which would require the sword to be in the cheese bin
Logged

Zarathustra30

  • Bay Watcher
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #83 on: March 18, 2015, 02:19:47 am »

what if you had the reaction to make the cheese and then an automatic reaction to replace the sword, and then another automatic reaction to improve the sword which would require the sword to be in the cheese bin

Yes, that was what my sleep-deprived brain was trying to say.

Anyway, now that I have thought about it some more, you may not even need the cheesebox at all. The principal reaction that replaces the sword could generate a unique catalyst that is consumed by the subsequent automatic improvement reaction. It only requires 2 reactions and there is no need for silly boxes!

Nevermind. That won't work, because the second reaction has the potential to grab any random weapon in the workshop. Carry on with your boxes of cheese!

I really need to stop coming here at 1am...
« Last Edit: March 18, 2015, 02:31:59 am by Zarathustra30 »
Logged
How did we pass from inns with merry songs and happy music to temples of doom and medieval torture with so much easiness and eagerness??

Snergler

  • Bay Watcher
  • The world is the same as ever.
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #84 on: March 18, 2015, 12:27:56 pm »

what if you had the reaction to make the cheese and then an automatic reaction to replace the sword, and then another automatic reaction to improve the sword which would require the sword to be in the cheese bin
thats pretty much what i was trying to say too :)
this is what i came up with so far, i replaced the cheese bins for plaster, because i thought it would be more stable near lava
Spoiler (click to show/hide)
Logged

Urist McCoder

  • Bay Watcher
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #85 on: March 18, 2015, 01:48:22 pm »

Alright I see your problem you need to select the plaster bin with the sword in it a s one reaction, instead of selecting the sword and then selecting the bin.
Logged

Snergler

  • Bay Watcher
  • The world is the same as ever.
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #86 on: March 18, 2015, 02:15:45 pm »

Alright I see your problem you need to select the plaster bin with the sword in it a s one reaction, instead of selecting the sword and then selecting the bin.

is this what you mean?
Spoiler (click to show/hide)
Logged

BlackFlyme

  • Bay Watcher
  • BlackFlyme cancels Work: Interrupted by bird.
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #87 on: March 18, 2015, 02:23:05 pm »

I think he meant putting the bin reagent before the weapon reagent, since the contains tag looks for a reagent with the same ID as the argument. In this case the ID/argument is 'weapon'.

That being said, vanilla reactions do not do that with containers, so either it's unnecessary or incorrect to put the container first, or it's an unnoticed bug.
Logged

Snergler

  • Bay Watcher
  • The world is the same as ever.
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #88 on: March 18, 2015, 02:45:51 pm »

I think he meant putting the bin reagent before the weapon reagent, since the contains tag looks for a reagent with the same ID as the argument. In this case the ID/argument is 'weapon'.

That being said, vanilla reactions do not do that with containers, so either it's unnecessary or incorrect to put the container first, or it's an unnoticed bug.

yea, i put the weapon before the container because thats how its done in vanilla reactions, so i adopted it for all my custom reactions as well,
that being said both before or after fail to produce anything in this reaction :-[
i dont know, the syntax seems good, maybe it's just not meant to be...
EDIT:sorry i'm not trying to mock you, i just adopted your speech pattern unintentionally... ha ha ... thats what happens when you  read and write code for tooooo long....
also just had a thought, the problem is positively in the third reaction, ... welllll maybe improvement reactions just can't handle a container .?.?.?
EDIT:ugh thats dumb... vanilla improvements accept bins full of items... but maybe there is something about a container as a reagent that is doesn't like... i don't know...  the hardcoded reactions must have some magic that we're not meant to wield :-\
EDIT:so i add [PRESERVE_REAGENT] to the [REAGENT:plasterweaponbin:...] and there is still a cancelation "needs metal weapon" at the third reaction, but then jeweler gets a small gem and completes the job... the improvement is applied to the weapon correctly but the weapon is still in the bin... weird :o
EDIT:i fixed up another improvement reaction, just a simple one to test this
Code: [Select]
[REACTION:ENCRUST_METAL_WEAPON]
[NAME:encrust a metal weapon]
[BUILDING:JEWELERS2:NONE]
[REAGENT:weapon:1:WEAPON:NONE:METAL:NONE][NOT_IMPROVED][PRESERVE_REAGENT]
[REAGENT:weaponbin:1:BIN:NONE:NONE:NONE][CONTAINS:weapon][PRESERVE_REAGENT]
[REAGENT:smallgem:1:SMALLGEM:NONE:NONE:NONE]
[IMPROVEMENT:100:weapon:COVERED:GET_MATERIAL_FROM_REAGENT:smallgem:NONE]
[SKILL:ENCRUSTGEM]
the reaction is preformed without cancelation or error, the improved weapon remains in the bin, guess it never leaves the bin ???
so its possible to require a container as reagent, but if you don't preserve it, what it contains does not get preserved either,
even though the code specified it beforehand 8) AFAIK   
« Last Edit: March 18, 2015, 03:44:23 pm by Snergler »
Logged

BlackFlyme

  • Bay Watcher
  • BlackFlyme cancels Work: Interrupted by bird.
    • View Profile
Re: [MODDING] REACTIONS QUESTIONS THREAD
« Reply #89 on: March 18, 2015, 03:47:05 pm »

A thought hit me. Try using a different type of container.

Sometimes bins are screwy.

Though the part about not preserving the bin resulting in its contents disappear does make some sense as well.
Logged
Pages: 1 ... 4 5 [6] 7 8 ... 13