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 - MAGGen

#1
Yes! Find the solution! 8) Pls, Tynan don't kill me for this kind of code! I hate reflection but somtimes it's the fastest way...

CompFacility t = TargetA.Thing.TryGetComp<CompFacility>();
List<Thing> l = (List<Thing>)t.GetType().GetField("linkedBuildings", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).GetValue(t);
l[0].Property_I_Need_To_Set = my_value;
#2
Is it even posible to use reflection in rimworld? I have only nulls from fields...
#3
Well I just findout that all linked buildings is private in CompFacility...
Aaaaahhh.... Comon... I don't want to use reflection in my mod or override CompFacility class! Is ther any normal solutions to get this affected building without override?
#4
I know that sounds weird but is there any way to get thing (and it's properties) with "affected by facility" comp from the facility thing that connected to it? I have a facility with job driver that need to change some props in "affected by facility" thing only after job done... I have no idea how to do it without using map.getComponent... And please, is there any metods that allows searching objects in area of current cell with structure like: cell(or thing).FindObj(integer_with_search_area_radius). Thank you in advance, and sorry for my bad english...
Also, Is there any xml documentation to existing rimworld code, where can I find it?