Coding in New Drugs Help

I’m working on a Fear And Loathing mod, and I’d like to really expand the drugs in this game. Only, there’s a few things confusing me:
1.: What determines the duration of a drug?
2.: What does PKILL1, 2, 3, and 4 correspond to? Is there a PKILL5? I’d like to make some high octane fentanyl heroin, and at the moment, the only difference in quality is morale boost.
3.: What limits the stimulative effect on certain drugs? I’ve made coke in the game where I’ve upped the stim value of the coke to a really high number, but it doesn’t make much of a difference.
4. Can I combine USE ACTION effects in a drug? I’m looking to make Robitussin both a hallucinogen and a flu medication as well.
5. How does the game determine route of administration of drugs? Like, you smoke a cigarette. You inhale an inhaler. You shoot up heroin. How can you add routes of administration?
6. How can I make these drugs spawn in the game itself without debugging them in or making a profession with them?

Answering the ones that I know off the top of my head…

(2) There’s a couple different use_actions available: PKILL_1, PKILL_2, PKILL_3, PKILL_4 and PKILL_L. There’s also corresponding “diseases” (long-term player effects), DI_PKILL1, DI_PKILL2, DI_PKILL3, DI_PKILL_L. There’s no DI_PKILL4 for some reason, there’s no level 5 at all, and all those effects are hardcoded in the game’s source.

(4) Nope, use_action can have at most one entry at present.

(5) Hardcoded :-/. The relevant information isn’t located in a very central place, either…

(6) Other than editing the recipes file, you’ll need to edit mapitemsdef.cpp and recompile the game. I’m gonna add a note on the todo list to move that to data files, though, because it’s low-hanging fruit, and is something that really should be possible.

Overall: it’s currently a little tricky to mod drugs. Drugs are a case where you really should be able to mix and match a bunch of parameters, including tweaking numbers, but at present most of the relevant parameters are hardcoded. That’ll probably change in the future, but I don’t know when exactly.

Well, by Gumb, I’m doing my best.

Yep, sounds like you’re doing the best you can with the tools presently available :).

Do you know what determines overdose? Is it the “heal” value? I notice when you take some unhealthy drug in the game, it doesn’t attack your health points, so is it moving towards some invisible O.D. counter?

I believe that overdoses are triggered by hard-coded painkiller/stimulant levels, actually.

Yeah. I think there’s some level of PKILL disease that kills the player if it gets too high; ditto for Stimulant.


Well, it’s funny you mention that. I’m trying to create something that will kill the player, cyanide, and I can’t figure out a good mechanism to do it.
USE_ACTION poison would be the obvious one, but it doesn’t kill quick enough. I tried messing with nutrition and quench values to do it, but when I got them low enough in a negative value to kill a man, they just looped again. Huh. Anyone got any tips?

I would suggest cracking open the source and start having fun! It would be relatively straight forward to add new drug effects. A little bit of copy paste, and digging around and asking in the IRC, and in no time you could have custom drugs.

Well, the source itself confuses me. I’d really like some help. I feel frustrated. One part of me wants to give up on the mod and let it lay fallow. In that case, it’s fair game for anyone else to incorporate into their work. Open source is open source. Compiling and recompiling confuses me, and I never learned any computing language.