Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: strangemood plugin can't use WORKER_ID  (Read 1278 times)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
strangemood plugin can't use WORKER_ID
« on: July 09, 2016, 08:24:21 pm »

Hey dfhack-savvy people, I want to make a workshop that induces moods on the worker. The plugin already exists, strangemood, and it works very well if I point a cursor at a unit and type everything in by hand.

But since I want it to be a natural part of the game, I need a dwarf to trigger it.

This is what I used:
Code: [Select]
modtools/reaction-trigger -reactionName STRANGEMOOD_WEAPON -command [ strangemood -force -unit \\WORKER_ID -type possessed -skill weaponsmith ]
The syntax is correct, but the dfhack window says that "no unit is selected".

The readme says this:
Quote
-unit:   Make the strange mood strike the selected unit instead of picking one randomly. Unit eligibility is still enforced.

So my options atm are either "make the mood strike someone at random" or ... nothing. I'd need help to find a way to select the worker in the workshop.

PS: It would be nice to be able to influence what type of item is created. -item WEAPON:NONE or -item DOOR.
« Last Edit: July 09, 2016, 09:15:25 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 :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: strangemood plugin can't use WORKER_ID
« Reply #1 on: July 09, 2016, 11:30:50 pm »

Eligibility being enforced means that it's fully possible that the worker you're trying to get to mood simply can't have a mood.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: strangemood plugin can't use WORKER_ID
« Reply #2 on: July 09, 2016, 11:41:41 pm »

I dont think so. I did use -force, and when I had no valid targets when I did use Eligibility, the script had the output "no dwarves to force mood on" or something like that. But when I tried targetting the worker, it said "no unit is selected".
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 :::

Roses

  • Bay Watcher
    • View Profile
Re: strangemood plugin can't use WORKER_ID
« Reply #3 on: July 10, 2016, 02:44:20 am »

Is this a new script or one not in the usual package? I am looking through the hack/scripts folder and not seeing anything about moods. Could you copy and paste the script here?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: strangemood plugin can't use WORKER_ID
« Reply #4 on: July 10, 2016, 02:52:11 am »

As said in the OP, it's a plugin.

Roses

  • Bay Watcher
    • View Profile
Re: strangemood plugin can't use WORKER_ID
« Reply #5 on: July 10, 2016, 03:05:41 am »

Ah I missed that, plugins are outside of my wheelhouse.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: strangemood plugin can't use WORKER_ID
« Reply #6 on: July 10, 2016, 07:53:40 am »

No worries. As I said, it does work with a random worker, which is good enough for me.
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 :::

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: strangemood plugin can't use WORKER_ID
« Reply #7 on: July 12, 2016, 02:02:06 pm »

Try adding two more slashes. Sometimes some of them get striped off (eg. if the command string is parsed by Lua multiple times). ("\\" gets translated to "\", so "\\\\" will become "\\")

This probably won't fix anything, but I remember I had to do this at least once when working with reaction trigger.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS