[DLL] Updating mods

Started by projecttemp, February 05, 2017, 08:21:24 AM

Previous topic - Next topic

projecttemp

Hi guys, i am currently trying to update some of my personal mods and i ran into some problems with function names since i skipped a few version. It would be great if you guys can point me in the right direction.

1. All the function that requires map as parameter i can just used this.map or this.wearer.map right?

2. Faction.ofColony is Faction.ofPlayer now right?

3. What happened to HediffSet.RestorePart? How do i heal missing part now?

4. What happened to listerPawn.PawnsHostileToColony? I know is this.map.mapPawns now, but it lack any function to detect hostile.

5. How do i get the SoundInfo for the function PlayOneShot? Do i just make a new empty SoundInfo?

Thanks for the help in advance.

Fluffy (l2032)

1. Yep. Most things that exist on a map will have a map field you can use. In rare cases you just need the map currently on screen, which is Find.VisibleMap
2. Yep.
3. Can't help you there.
4. Not sure if there's a better way, but AllPawns.Where( pawn => pawn.Faction.HostileTo( Faction.OfPlayer ) ) would do the trick (note I'm writing this from memory, so exact names and such may differ).
5. IIRC soundinfo is just a sounddef + Map, there should be a constructor or factory method that will let you create a soundInfo from a def + map.

projecttemp

Oh cool, thank you. For hostile i figure just to grab all pawns and check myself. Still haven't figure out how to restore body part yet.

nethrez1m

I think it is done by Pawn.health.RestorePart now.

projecttemp

oh thank, i found that after a few more tries too.