[1.3] Miscellaneous w MAI+Robots

Started by Haplo, May 16, 2014, 05:54:01 AM

Previous topic - Next topic

Haplo

Nope, right now you can only help them, when they can be helped via medicine and sleep.
Help via medical recipes doesn't work, as it doesn't change anything at the pawn code.

@Goo Poni:
If the bed doesn't show anything, it is normally, when the visitors are either hostile or not there.
Did you make the visitors hostile? Once hostile the loading of a savegame won't help you, as it isn't written in the savegame but in the world file...
Please check your factions if they are by any chance hostile to you..

Goo Poni

No, I've had two separate colony's visitors be unable to lend aid to. My current relations with all factions. A guy from Thresher's Stream.A guy from Curro of Raven. Two guys from Bliss' Crag. Thresher and Curro guys knocked unconscious with dev tools.Additional guy from Thresher's Stream, knocked to the floor with damage.One of the Bliss guys minus a leg.

Can't rend aid to anyone here. Also knocked out the traders from Thresher's Stream. No aid for those guys either. Left-click colonist, r-click visitor bed, menu should appear. And they're definitely all visitor beds. Everyone not part of the trading party were spawned in and damaged with dev tools just for the sake of demonstration. Some will likely survive without aid (those knocked unconscious or in shock if they wake up in time), those with crippled limbs most certainly will not. Either way, I can lend them no helping hands whether I want to or not.

Haplo

Hmm, I think I've made an error in the code. Could it be, that you saved the colony with visitors in bed and reloaded it?
I have found possible problematic code when you load a game, where there are visitors in bed..
It's updated in the next version. Can you try this Assembly please and tell me if it works for you?
Just extract the Trader.dll into the Assembly-folder of your Miscellaneous folder. It should overwrite the old one..

Cat123

@haplo

Quick question, as you seem to have already coded changes to bed functions and are more than likely far better at coding Rimworld than me :p

In this thread https://ludeon.com/forums/index.php?topic=2541.360 I'm asking about making the following:

A workbench that has a bed as part of it, that requires a sleeping pawn present to produce the effects (mutations).

So - pawn enters bed / workbench sprite
Menu changes on pawn unlocking the ability to operate & add mutations to specific bodyparts
Another pawn uses bed / workbench to do the operation instead of usual medicine + standing next to bed

I know it sounds overly complex, but I think it has a lot of potential not just for the mod I'm making (and the code seems mostly there).

Thoughts? (sorry to hijack your mod thread, I can delete + move to pms if preferable)

Goo Poni

#394
Quote from: Haplo on November 16, 2014, 11:44:53 AM
Hmm, I think I've made an error in the code. Could it be, that you saved the colony with visitors in bed and reloaded it?
I have found possible problematic code when you load a game, where there are visitors in bed..
It's updated in the next version. Can you try this Assembly please and tell me if it works for you?
Just extract the Trader.dll into the Assembly-folder of your Miscellaneous folder. It should overwrite the old one..

May have possibly loaded the game with visitors in a bed at some point or another. After my last post asking how to use the beds properly, I've lended aid to several travelers and visitors, then after a while it just stopped working for me though raiders would thank me for the help once they got out of bed in the prison room because I first built the visitor beds there before replacing the beds in the medical bay with more. I'll replace the code and make an edit with results.

EDIT:
Two visitors, one in shock, one unconscious (if it makes any difference at all, probably not), can't help either. Also enabled all jobs on a colonist just in case it was something with that (like someone won't craft if they're not crafters) but no luck. Did loading the game with someone wounded in bed bork it for me?

Haplo

Did you try it with the new dll?
It is really a possibility. Please try it with the new dll and let me know if it fixes your problem.
If not then I've most likely missed something else..

@Cat123:
What you wanna do is a huge load of work:
-The bed needs to check, if a pawn is in it.
-Then you need a job worker + a job driver to do the operation itself. These should start only when you have a pawn in bed.
-The job can then do whatever you want to the pawn. The jobdriver should be a bit like the doctor jobdriver..
Hmm, the more I think about it, the more work it will be.. The Jobdriver alone will be a huge thing.
Most likely it would be easier, if you adapt it to a normal medical recipe..

Cat123

Quote from: Haplo on November 16, 2014, 04:21:04 PM
@Cat123:
What you wanna do is a huge load of work:
-The bed needs to check, if a pawn is in it.
-Then you need a job worker + a job driver to do the operation itself. These should start only when you have a pawn in bed.
-The job can then do whatever you want to the pawn. The jobdriver should be a bit like the doctor jobdriver..
Hmm, the more I think about it, the more work it will be.. The Jobdriver alone will be a huge thing.
Most likely it would be easier, if you adapt it to a normal medical recipe..

Ok, ty for the reply.

-pretty sure beds already have some checks for if pawns are in them (just need to find it)
-I've no idea how to code jobworker / jobdriver (in fact, it's next on my list - due to wanting to change <workerClass>Recipe_InstallNaturalBodyPart</workerClass> into <workerClass>Recipe_MutateNaturalBodyPart</workerClass>; this means not only will it inherit the <naturallyHealed>True</naturallyHealed> but you can set the item usage to be recursive. i.e. it doesn't produce an item, but eats it in the crafting process (which is what you want - the organ to be transmuted, not dumped on the ground as an <item>)
-I'm trying to avoid the normal process, as that requires <items>, which a) are then global and b) short-circuit the permanent nature of what I'm trying to achieve. i.e. I don't want to do <make item> -> <InstallArtificialBodyPart> as this means mutations won't be locked to a unique pawn. There's potential to do <mutagen item> -> recipe to mutate <operation on single body part> but that means a flat cost for all operations, which is bad design - it also then throws the <operation> into having to code a response that I **know** isn't in the engine atm.
-Also, cannot find Rimworld's XML RNG table format - I see <tags> for random select, but no weighting tables.
-Ideally, I'd be changing <workerClass>Recipe_InstallNaturalBodyPart</workerClass> only slightly, but making the recipe produce an item that's instantly used (thus pawn = required).


Thanks for the reply, I'll have to start digging and hacking away to short-circuit things. Atm I know how I'd do this in another engine, but Rimworld is a bit foreign to me :)

Goo Poni

I did replace the .dll file with the one you provided. Would you like the world and colony save? You'll need TTM with all the tassels to load it. You'll probably have better luck diagnosing the issue yourself instead of waiting for my posts. You might not even find a problem, in which case I'll put it down to my crappy laptop.

Haplo

Thanks for the savegame and world. Thanks to you I could catch this little bug: I've forgotten that animals are also pawns.
You had an incapped cobra on your map that always threw a NullRefException when it was called.
So thank you for the save game. ;D
And here is the new Trader.dll.
Please extract it and overwrite the old Trader.dll and it should work this time :D

PS: I would release a new version, but it has to wait a bit, as I'm in the middle of some work right now..

Wex

I was thinking of a feature.
Right now, traders randomly put their tent around your base (sometimes inside your base, or in front of your stonecutting table).
What if we give them a 2X2 space where they could put their tent?
No more tent in needed places for your colony, or atop a couple wild plants you were saving.
Also by having 2 or more of this spots, you could prevent enemy traders from shooting each other - if you put them distant from each other -.
"You are not entitled to your opinion. You are entitled to your informed opinion. No one is entitled to be ignorant."
    Harlan Ellison

Rikiki

For the disturbed workplace, you can still destroy the tent without relationship penalty (I did without reprisals).
It should maybe be fix or spawn some nice stock of loot ;)

Haplo

I'll think about it for something to do maybe later on. But you only want to look the poor traders. ;P

Wex

That never crossed my mind!
Honest!
But I can see the exploit...
My suggestion was mainly for conflict avoidance between hating traders. They always blame me!
But it's very annoying when they sit in front of something.
A solution would be to place the trading stall only in the open!
"You are not entitled to your opinion. You are entitled to your informed opinion. No one is entitled to be ignorant."
    Harlan Ellison

Goo Poni

#403
I've no idea what is capable in modding and what's not but if custom zones are a thing, maybe be able to designate certain areas for the tradesmen so that they set up shop at those places. Or a "building" or some such construction that can be tagged to say "if you're a trader from colony X, go to the X waypoint". So you can set up usual spots for traders to arrive, rather than one trader from a colony parking on your doorstep and another trader from the same colony parking on the outside of the cul-de-sac you built your base into, forcing colonists to walk all the way around the rocky outcroppings.

Perhaps you could make it so that you can attack traders that set up shop then raid their little trading post for the assorted items they were trading. That could be totally imba, though because I'm sure traders regularly come with like 20k silver in items on TTM. Progression would go out the window and you'd shoot your colony's wealth through the roof, making upcoming raids more difficult. On the flip side, that trader's faction is now hostile and they'll be making the raids instead of the trades, so it's a one time thing and you'll likely only get 3 chances, one for each faction, with every save game.

Wex

I had a game with only one neutral faction. No 3 chanches per game.
I also had a game with only one hostile faction.
I don't know how it works.
"You are not entitled to your opinion. You are entitled to your informed opinion. No one is entitled to be ignorant."
    Harlan Ellison