RimWorld

RimWorld

Defensive Positions - Forked
29 Comments
团长团子团 30 Aug @ 11:36am 
In the shortcut for selecting all colonists, ghouls cannot be selected. Is it possible to fix this?
GonDragon  [author] 29 Aug @ 6:16pm 
@Alexander Zagirov: I'll look at it tomorrow.
Alexander Zagirov 29 Aug @ 2:37pm 
Pressing zero sends only colonists to their defensive positions. Can you include colony mechanoids too?
月空 27 Aug @ 11:56pm 
Great job! It's functioning very well now.
GonDragon  [author] 24 Aug @ 3:23pm 
@Thetaprime: It patches some functions that exist only on 1.6 (The gravship's take-off and landing procedures). Maybe it works and just throw two red errors on load, maybe it doesn't work at all, can't say. If you want to know, you'll have to test it yourself. My suggestion: If you play on the 1.5, just use the original version with HugsLib. You don't gain too much removing HugsLib, I did it mostly because without the lib, the mod becomes easier to maintain or port to other version in the future.

HugsLib is not as bad for performance as many people say. I had to look at the code to port this mod, and it is quite well done. It's just that it hooks things in weird places, because it came from a time where the Vanilla rimworld code wasn't as friendly or convenient for modders. Currently, most if not all functions could be easily done with vanilla hooks.
Thetaprime 24 Aug @ 12:59pm 
Any reason this fork wouldn't work with 1.5?
月空 24 Aug @ 9:20am 
That's great. I wish the personnel selection using Ctrl+number keys could also be saved.
GonDragon  [author] 23 Aug @ 12:24pm 
@月空: That's because you're landing on a new map, every map saves their own formations. That issue should be fixed in an Update later today, if a pawn have a position set on the ship, the position will move with him.
月空 23 Aug @ 12:19pm 
The mod is great, but the formation resets every time the ship lands
GonDragon  [author] 20 Aug @ 5:23am 
@Captain Shitface: Fixed, thanks! Although I put the fix directly inside the ViewingWorldMap, as it's also used in a another instance and i'll guess it needs the fix there too.

And about the hotkeys, if you mean all the instances about holding alt or control, all of those are now Event.current checks.
Captain Shitface 19 Aug @ 4:27pm 
@GonDragon When in space, Rimworld renders the world in the background while displaying the local map in the foreground. This creates a hybrid rendering state where;

`WorldRendererUtility.WorldSelected = true` (world is being rendered in background)
`Find.CurrentMap != null` (local map exists and is active)

But we're actually interacting with the map, not the world.
My fix was to use 'WorldRendererUtility.DrawingMap' to tell us whether we're actively interacting with a map as opposed to the world view, regardless of the background rendering state.

On line 68 of the PawnSquadHandler.cs, this is what you currently have;
if (ViewingWorldMap) {

My fix was;

if (ViewingWorldMap && !WorldRendererUtility.DrawingMap) {

Also for some performance gains; you could look into changing the Hotkeychecks to be every 3 ticks instead of every tick, possibly look into moving away from event polling and use direct unity input key state checking.
GonDragon  [author] 19 Aug @ 3:57pm 
@My Github Repository: I'm not really aware of any issues with the squad hotkey, so it's most likely not fixed in my version. What is the issue?

Also, I added a link to my github repo in the description, In case you want to see what I'm making. In short, I moved most things to a MapComp to have positions being saved on per map basis, and I'm in the middle of simplifying a few functions to ease any future maintenance task.
Captain Shitface 19 Aug @ 3:30pm 
@GonDragon

Ayy lets go! I was actually in the process of doing this myself too, but got caught up in other things. I did already have a working fix for the gravship in place for the hugslib version that I never uploaded since the OG version updated. Wanted to save it for the non-hugslib version.

If you'd like to compare, feel free! Also, I'm unsure if you fixed the issue with squad hotkeys in space that the original Defensive Positions upload has that I had fixed in my 1.6 version, but I can help you with that if it's not.
truncate 18 Aug @ 4:41pm 
you're a hero man
GonDragon  [author] 18 Aug @ 3:43pm 
Hey! An update is coming this week that will wipe all your current defensive positions :p

That's because I made some changes on how things are saved and... Now, if you have a defensive position inside a Gravship, the defensive position will be saved between ship jumps! (and correctly rotated with the ship).

The update will likely be out this Wednesday or Saturday. I want to test it fully before pushing it to the workshop, but I have a busy week.
Bear 18 Aug @ 8:16am 
Another common GonDragon W
Hqiran 18 Aug @ 3:20am 
I love you non hugslib man
KingsMan_ 17 Aug @ 11:08pm 
i love you
VelxraTV 17 Aug @ 10:40pm 
A true hero resurrecting this great relic.
GonDragon  [author] 17 Aug @ 3:20pm 
@PremierVader: I did not take any benchmarks, but it should have the same performance as the original, if not better due not using HugsLib.
PremierVader 17 Aug @ 9:47am 
Hey hows the performance on this mod?
GonDragon  [author] 17 Aug @ 8:36am 
@FederationPrime: Yes.

@ᅚN1:86-47: For the moment, no. I haven't looked at Odyssey code yet, but if it isn't too difficult, is one of the features I'm planning to implement.
polat.cal 17 Aug @ 7:04am 
Thank god, another mod that free from Hugslib addiction - thank you for all precious efforts!
ᅚKest luh Vye 17 Aug @ 5:55am 
Will this mod remember positions saved on gravships, similar to how zones work now?
Thanks for the update!
FederationPrime 17 Aug @ 4:22am 
Does this allow assigning positions to mechs?
NuanKi 16 Aug @ 7:50pm 
oh, thanks
GonDragon  [author] 16 Aug @ 7:44pm 
@NuanKi: There is no need, the game will load the textures of the latest mod in the load order. If you're using RimSort, just add a user rule to make UI Retexture goes before this one, That way you can choose what graphics to use.
NuanKi 16 Aug @ 7:27pm 
BTW, i just asked for compatibility with this mod in the UI Retexture mod.
NuanKi 16 Aug @ 7:23pm 
Finally!!!, A version without hugslib, thanks a lot for that