Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Roolo

#526
Small update:

Giddy-up! Core -> v18.6.1
- When releasing animals, they won't throw off their rider anymore. Only after the pawn dismounts, the animal will start its releasing behaviour.
- Fixed compatibility problem with mods that call Pawn_Healthtracker.MakeDowned during world generation for some reason, which caused the world generation not to work in those (rare) cases.
- Updated Japanese and Russian translations.

Giddy-up! Caravan -> v18.2.1
- Updated Japanese and Russian translations.

#527
Quote from: Nightinggale on March 01, 2018, 12:24:24 PM
Quote from: Roolo on March 01, 2018, 11:36:05 AM
Can anyone help me with this? I want to write a transpiler to update some code in the Pawn_PlayerSettings.GetGizmos() method, but I'm running into the same issue as the one Nightinggale reported a few pages back, namely that this isn't so easy for code inside iterators.
I'm a bit confused about this. You mention transpiler, but then you quote something related to a Postfix  :o

The postfix issue was fixed in post #174 on page 12. It turns out that you can solve the issue on a higher level than what was proposed. What I did works well for appending data. I never really tried modifying existing data. That step might cause other issues.

If you are indeed talking about actual transpiler, my experience is that all I had to do was to find somewhere inside the loop code where the stack is empty and then add my own code. I managed to get an easy to write and well working solution by just adding variables to the stack and then call a void method. That way I managed to get a C# method with the variables I need and since it's a void method, it will not pollute the stack and it shouldn't affect the vanilla code whatsoever. It should be possible to expand on this approach and write more complex IL code to affect private data, but I have not had the need for that yet.

Quote from: pardeike on March 01, 2018, 01:41:03 PM
I'm busy right now and on mobile. Pretty sure he thinks about getting the MethodInfo of that somehow hidden and private method. Can someone explain how to use Harmony's AccessTools to get what he needs?

Yes I'm sorry. It was indeed a bit confusing. I only referred to Nightinggale's case since that also involved code inside an iterator being patched. In my case the goal is not to write a postfix or a prefix, but a transpiler that targets code inside an iterator method (in my case the method Pawn_PlayerSettings.GetGizmos() ). I'm well aware how to write transpilers, but this case is a bit different, since I cannot patch Pawn_PlayerSettings.GetGizmos(), since that only returns an iterator object. Instead I want to modify code inside the MoveNext() method inside with my transpiler. The problem is that I don't really know how to patch this method since its a method of a private subclass.

Normally I'd write something like:

[HarmonyPatch(typeof(Pawn_PlayerSettings), "GetGizmos")]
//patch class including transpiler here

But since it's an iterator method this wont work, and I want to find a way to patch the method MoveNext of the inner iterator class of GetGizmos, and I don't really know how to do this.

Of course I can just use a Prefix patch returning false to replace the entire implementation of Pawn_PlayerSettings.MoveNext, but I figured it wouldn't harm to learn a neater, and more compatibility-friendly solution. Postfixing is not a solution in my case by the way, since I want to prevent a method call, if a certain condition holds.

I hope this is a bit more clear.
#528
Can anyone help me with this? I want to write a transpiler to update some code in the Pawn_PlayerSettings.GetGizmos() method, but I'm running into the same issue as the one Nightinggale reported a few pages back, namely that this isn't so easy for code inside iterators.

Pardieke's explanation and suggestions below:

Quote from: pardeike on October 21, 2017, 05:05:00 PM

This is because that method internally only returns an iterator object (the class name of that in this case is called '<>c__Iterator22A') that does the job. It's that one you need to patch. The class '<>c__Iterator22A' is an inner class of the class Verse.Corpse and has, as every iterator, two main methods: MoveNext() and Reset(). It's MoveNext() you need to patch.

Alternatively, you could patch the getter and just return your own instance of your own iterator implementation with like a prefix returning false. In that iterator implementation you use reflections to iterate through the original corpses iterator and yield return all the original values. Then you just yield more after the loop and you got yourself new elements added.


I want to try the first suggestion but don't really know how to. In my case I want to patch <GetGizmos>c__Iterator0.MoveNext(). How do I do this, considering it's a private subclass with a deviating naming convention?







#529
Quote from: wwWraith on March 01, 2018, 02:48:15 AM
Quote from: Roolo on January 15, 2018, 02:30:03 AM
Giddy up! Caravan to v18.1.3

- Caravan speed bonus now also influences the "fixed" time needed to traverse world tiles*

*Explanation: In vanilla Rimworld, even if a caravan has the speed of light, it still needs a fixed time to traverse each world tile, which depends on the season, and on the terrain, but not on caravan speed. In winters and in mountainous areas, this fixed time contributes to the largest portion of the travelling time, which made Giddy-up! Caravan ineffective in these situations. However, this has now been solved, as the fixed time now is also influenced by the caravan speed bonuses introduced by Giddy-up!

Does it interfere with Caravan Options and Logistics?

No idea. It certainly wouldn't explode or anything, the worst thing I can see happening is that some changes of caravan speed applied by one mod could be overwritten by the other, but that all depends on how it's implemented in the two mods you refer to. I'd say try it out. You might want to fiddle a bit with load order when doing so.


Quote from: Ser Kitteh on March 01, 2018, 03:09:08 AM
Any other plans for giddyup? You got combat, caravaning, NPC compatability, yeah that's really all I can think of!

Yes definitely. The next mod (Giddy-up! Ride and Roll) will address automatic mounting in non-combat situations. When a pawn wants to go somewhere far, and it would go faster using a mount, it would automatically mount the animal, go to the destination and dismount (or stay mounted when that's suitable for the job, for instance with hunting). I got something rough working already, and it already adds a nice atmosphere to the game, but there are many different jobs that all should be handled slightly differently, so it's still a lot of work to make it not result in really weird situations.

After I finished that mod I'll focus on one mod that's not part of the series, but will play nicely with it. I'd rather not discuss the details to prevent any high expectations (being mysterious here :) ).

And after that I may investigate other future possibilities:
- Non-caravan pack animals (could be separate from Giddy-up!, but at least I'd make it play nicely with it)
- Mechanoid riding
- Skills (for instance charge, stomp etc. )
- Mini add-ons like riding animals for joy or training, maybe a music add-on, and more.
#530
Thanks everyone! I'm glad you like the update.

Quote from: FrodoOf9Fingers on February 28, 2018, 04:42:30 PM
Love your work so far!

Is there a chance to modify the functionality of the "Release Animals" button, such that it doesn't dismount characters (including the one who used the dismount command)?

Also, a quick mount button would be awesome, allowing pawns to mount the closet mountable creature -or- having each pawn mount an animal that they are master over.

Great job!

1. Yes I actually wanted to do that in the last update, but somehow forgot about it. I'll probably release a patch with language updates and if needed bug fixes pretty soon, and I'll make sure this'll be included in that patch.
2. hmm, very good idea. It'll make the mod much more user friendly so I'll likely implement that.  I think I'll limit it to animals pawns are master over, since this has two advantages:
- It prevents any conflicts. It is very likely that when you select a group of pawns, and use "quick mount" for all of them at once, that the'll all go for the same animal. Resolving this is probably a pain to implement. This is of course not an issue when they only go for animals they are master over.
- It gives the player more control over what type of animals pawns should go to compared to the other option.

The only con I see is that pawns that are not master over any animal won't be able to quick-mount.

#531
Releases / Re: [B18] Giddy-up! (animal riding series)
February 28, 2018, 04:02:55 PM
I'm happy to announce a big update that applies to all Giddy-up! mods.
Giddy-up! Core -> v18.6.0
Giddy-up! Battle Mounts -> v18.6.0
Giddy-up! Caravan -> v18.2.0
Make sure to update every Giddy-up! mod you're using to prevent issues (and not only one for instance)

Big changes in Giddy-up! Core:
- Enemy and friendly NPC mounts that have their rider thrown off will no longer become wild animals, but instead they will keep fighting until one of the following happens:
--> Their rider remounts the animal (riders will now attempt to remount their animal whenever possible).
--> The rider owning the animal is killed or downed. In this case the animal will flee in panic and leave the map, as there's no longer a master around to control it.
Note: When facing a dangerous mount, it's now more important than ever to kill its rider, so that it starts fleeing.
- If an enemy mount is downed, it is now turned into a wild animal so you can still tame or hunt it.

Big changes in Giddy-up! Caravan: 
- Friendly NPCs will now park their mount when arriving at your colony, and hop on again when they leave.
- A new zone has been added, named: NPC mount spot . When friendly NPCs arrive, they will park their mounts at the nearest NPC mount spot. Go check this out in Architect->Zone/Areas
Note: Place this spot in a room and you have your own stable for guests!

Small changes and fixes
- The caravan dialog should no longer lag when using Giddy-up! Caravan.
- Fixed UI issue in caravan dialog that appeared when a mount died during a map event (like an ambush).
- Fixed UI issue in caravan dialog that made it impossible to use multiple similar mounts that still had their default name.
- The right click menu item for mounting now also displays the mounts name when using Giddy-up! Battle Mounts.
- Updated Spanish translations (by mora145)
      

Many changes in this update are also to prepare for the next mod that will be released as part of the series, which will be called Giddy-up! Ride and Roll, and will introduce mounting in more non-combat situations. It'll still take some time until that is finished though.

Good luck playing!
Roolo
#532
Releases / Re: [B18][A17] RunAndGun
February 28, 2018, 09:12:52 AM
Quote from: Kori on February 27, 2018, 07:50:01 PM
Hey Roolo, I play with CE and when I switch the ammo of pumpguns to EMP shells, the RaG button disappears as long as this ammo is loaded.
They only do EMP damage and you also get the "hunter lacks ranged weapon" message, so I think they aren't recognized as weapons.
Could you please have a look at this? :)

I'll see if there's an easy way of fixing this. Currently the code that is used in vanilla to check if a pawn can hunt with is also used to check if the pawn can RunAndGun with the weapon. Since it doesn't make sense to hunt with EMP weapons, I figure the CE developers took this into account, and set the EMP loaded weapons properties so that it's not recognized as a weapon suitable for hunting. I may be hard though to detect EMP weapons without explicitly targeting CE code (which would imply a dependency, what we don't want of course), so I'll have to look into that and see what I can do.
#533
Quote from: Ruisuki on February 22, 2018, 08:25:30 PM
i forbid incindeary launcher from running and gunning yet the ai is still using it while fleeing

Ok I'll check that out. Just one question: was it only for a brief moment (like just enough time to fire one shot) or did they do it the entire time while leaving the map?

#534
Quote from: Mr_Man on February 22, 2018, 11:24:29 AM
CE just had a full release for B18 finally yesterday - still compatible?

I'd say just try it out and let us know if it is.
#535
Quote from: Tenshi~Akari on February 09, 2018, 02:50:32 PM

EDIT #2: OK, so not coming across any issues other than MAIs don't gun while they run. They'll draft just fine still, but where they should be shooting, even if it's just them and nothing's blocking their line of fire, they're stuck still doing Vanilla shooting mechanics for some reason. No error logs came up related to this so...

Yes i'm aware of that. I'm planning to completely change the method of linking RunAndGun data to pawns, which should solve this. Right now any race with ThingClass=Pawn in the XML def gets RunAndGun capabilities, but apperently some mods don't set this property.
#536
Yes indeed. It can be safely removed from saves.
#537
I just solved the crashing issue for RunAndGun.

Apparently, this issue occurs when Harmony is used to patch an (implemented) virtual method. Doing this works fine on Windows, but may cause crashes on Unix systems. I recommend any modders to avoid patching virtual methods until this issue is resolved in Harmony.
#538
Releases / Re: [B18][A17] RunAndGun
February 09, 2018, 08:47:58 AM
I released an update for RunAndGun (now v0.18.3.3).
-Fixed crashing issue that occurred on some Unix systems when enemy pawns start fleeing.

I finally managed to fix the notorious crashing issue! Now Unix users can safely use RunAndGun again without having to worry about crashes. Apparently there's a problem in Harmony that causes a crash when patched (implemented) virtual methods are called.  Thanks to lashtear, I now know how to get debug information to track down such crashes (the Rimworld log didn't contain any information, but using gdb to introspect Rimworld proved very useful). So if any other modders happen to get such crashes, they can contact me now so I can help them.

Please do report it when you still get crashes after the update.


Quote from: Tenshi~Akari on January 23, 2018, 12:22:40 PM
Hello!

Thanks again for the work & updates to this mod. Very essential to my experience.

I think I came across a not-so-friendly issue when using this with Miscellaneous MAI mod, though...

[...]
What happens: Whenever the MAIs are loaded after auto draft into a generated caravan event map (ambush, rescue, etc.) or even selected while drafted on said map for that matter, there is absolutely no UI or context menus that appear, no matter where I click or what I press... almost as if the game becomes unresponsive, but can only get out of the predicament by double-clicking on the base pawn group and selecting a human pawn.

I've already mentioned this in Haplo's thread, but since the log & thousands of hidden ticks mentioned this mod in particular, is there any possible fix for this? It works just fine with the MAIs on the main base map, it just this small issue when caravaning with my android crew to take out bandit camps or rescue pawns becomes a slight issue, especially if there's no normal human pawn that's with them... they'd end up stuck there until their energy runs out or something of the like, I guess.

Tenshi~Akari, I couldn't reproduce the issue you reported. I formed a caravan with an MAI robot, and made sure it was ambushed. Everything seemed to work properly when I drafted the robot and selected it. Are you sure the version of RunAndGun you use is up to date?
#539
Help / Re: Mac and certain Ubuntu Crashing with my mods
February 09, 2018, 08:37:41 AM
I also had this problem with RunAndGun when I tried patching the MentalState.PostStart method, and solved it like you did, by looking for another class to inject to. The hint given by lashtear helped me finding the patch that caused the crash, so thanks for that lashtear.

Like in your case, the method I patched was a virtual method implemented by a subclass. Apparently, patching such methods can cause crashes on certain Unix systems. I'll report this to the creator of Harmony.
#540
Really strange, but running the game trough gdb completely solved this issue for me:

For anyone who wants to try this workaround but doesn't know how to run Rimworld through gdb:
In the command line go to the Rimworld main directory. cd ~/.local/share/Steam/steamapps/common/RimWorld
type gdb

now in gdb, type:
exec-file ./RimWorldLinux.x86 (you only need to do this once)
run ./start_RimWorld.sh