Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.
"This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.
1. Figured out how to make a custom options page and fill it with custom options (and they're saved between plays and can affect the game as per their description). This should be useful when people start making mods.
2. Made an in-game GameObject hierarchy browser and components inspector. This is very useful for figuring out what goes where, has what components, has what values, etc. Used to take hours to properly inspect certain things through debug. Now it's instantaneous. Can toggle gameobjects on/off to see if you're on the gameobject that you think you are. Will probably make components' fields editable in the future.
I think I'll polish it up a little and release the sources for everything in a few days.
I've been taking a break since that last post and I still am. I'd like however to share this thing, in case anyone needs it some day.
I'm only an amateur programmer, so the "tool" is in a chaotic and unfinished state, uses shortcuts it shouldn't, etc, so don't be surprised when you see some horrible things inside.
How to set it up:
- Compile Mono.Cecil https://github.com/jbevain/cecil and add other necessary references from PillarsOfEternity_Data\Managed
- The Assembly-Csharp you use in references must have all methods and fields public. In order to do that, use an unpatched assembly first and then run this code once. Replace the Assembly-Csharp in your references with the one this code should produce:
Usage:
- All your classes must be named "Mod", followed by any digits, i.e.: Mod01
- Your Mod-something classes must inherit from the class that you're going to modify (you can see this in examples). Unless you want to inject some code that uses the "base" keyword, in which case you must inherit from its base class. Because of this, in certain rare cases it might cause problems when you use both "base" and "this" keywords, you can see why. Never encountered it though.
- The order matters, kind of like in c++. You can't inject a method that references a variable before injecting that variable into the target assembly first.
What works:
- PatchExistingMethod //clears all instructions in the target method and injects instructions from your custom method
- PatchExistingProperty //patches the get-set methods of an existing property... i don't remember if I tested it at all, sorry
- PatchExistingNestedType // patches an existing enum
- InjectMethodIntoType //injects an empty method into a class, only attributes currently supported are: public static or private
- InjectFieldIntoType //injects a field. It copies the type, attributes and name from the field that it receives as a paramater.
- MakeFieldPublic
- MakeMethodPublic
- RemoveMethodFromType
- RemoveFieldFromType
What doesn't work yet:
- delegates ("delegate" creates and adds a new method to its type... this method has to be found and copied to the corresponding type in the target assembly before it can be refereced in the target assembly)
- lambda expressions (probably for a similar reason)
- The following expression wouldn't work: new int[] { 0, 3, 1, 4, 5, 2 }... The reason being, it creates a field and a type in <PrivateImplementationDetails> and we need to copy them and rename them. For now, simply code it differently instead: new int[7], then myint[0] = 0;, etc...
Limitations:
- Sometimes you're going to have a field and an event of the same name inside a type. There is no way to programmatically distinguish between them that I'm aware of when referencing them in your own code. For Mod4, I had to manually rename in .Net Reflector UIOptionsManager:OnWindowHidden to OnWindowHiddenField in the referenced assembly and in the unpatched assembly that is loaded when the program starts. I don't know if any other workaround for this exists. I only stumbled upon this problem once though.
For this reason, the example mod Mod4 will not compile and execute correctly (unless you perform the same manipulations as the ones I've carried out).
Regarding GameObject browser:
- it can't show all parentless gameobjects yet (when you reach the root of the gameobject hierarchy).
- it can't change components' numerical values yet, although it should be easy to implement.
Licence:
If you make a mod or an improved framework based on this project, please share the sources. I believe this type of license is called CC BY-SA.
I'll make a repository for it when things start moving. Right now I'm taking a break from it.
Regarding modding PoE in general:
- The UI system it uses is NGUI 2.6.5
It's an asset that in theory can be bought on Unity AssetStore for $95, but you won't be able to get this particular version, because it's very old, somewhere from spring 2013. And the new NGUI 3.7 is nothing like that old one, sadly - the syntax and a ton of things changed, it would be completely useless to you. However, it is possible to buy 2.6.4 on torrents. If you can't find it, PM me, I might be able to help you out . This is very useful because it allows you to try your code in your own Unity project. It'll save you tens of hours.
The documentation for 2.5 can be found on webarchive: http://web.archive.org/web/20130322004347/http://www.tasharen.com/?page_id=197 I didn't check if there was a way to get documentation exactly for 2.6.5, but it's quite similar.
- If you're unfamiliar with Unity, you *need* to watch some tutorials in order to understand its components system, gameobject hierarchy, etc. You'll probably need to make a few simple projects of your own, too.
About Unity's UI systems in general if you're just starting to mod. People often seem to be confused about it, so:
- Unity has a legacy UI system, which used to be its main UI system before 4.6 came out. It's the code you see in OnGUI(){...}. You can use it to make interface for debugging purposes, it's the UI you see in GameObject browser. It's ugly by default... it can be made beautiful, but it's complicated. The mouse clicks will go through the buttons created this way - the button will be pressed, and your character will also go where you clicked. To avoid this, you need to create a collider and place it under the buttons. You can find it in the project's examples.
- There's NGUI, a custom UI system, which is what PoE uses.
- There's the new 4.6 UI, which you will be able to use once they upgrade to 4.6. They promised to do that in a few weeks. This UI is probably the easiest to code and resembles NGUI in many ways.
Interesting thing.
Somebody from Obsidian asked me if I could share the sources for this tool with them a few days ago (only noticed the PM today). I suppose they could use such a tool to sometimes avoid waiting for 5 hours for the game to compile in order for the QA to test a small bug fix, because patching the dll directly is instantaneous.
That makes sense in theory, except this "tool" is so horribly coded that they could probably make a better one in less than an hour. So I lol'd, but still sent it to them, asking if they could maybe share their improved version of it in case they actually decide to work with it. If that happens and they do decide to release their improved version, this will be really really good. The chances are low, though.
Interesting thing.
Somebody from Obsidian asked me if I could share the sources for this tool with them a few days ago (only noticed the PM today). I suppose they could use such a tool to sometimes avoid waiting for 5 hours for the game to compile in order for the QA to test a small bug fix, because patching the dll directly is instantaneous.
That makes sense in theory, except this "tool" is so horribly coded that they could probably make a better one in less than an hour. So I lol'd, but still sent it to them, asking if they could maybe share their improved version of it in case they actually decide to work with it. If that happens and they do decide to release their improved version, this will be really really good. The chances are low, though.
Interesting thing.
Somebody from Obsidian asked me if I could share the sources for this tool with them a few days ago (only noticed the PM today). I suppose they could use such a tool to sometimes avoid waiting for 5 hours for the game to compile in order for the QA to test a small bug fix, because patching the dll directly is instantaneous.
That makes sense in theory, except this "tool" is so horribly coded that they could probably make a better one in less than an hour. So I lol'd, but still sent it to them, asking if they could maybe share their improved version of it in case they actually decide to work with it. If that happens and they do decide to release their improved version, this will be really really good. The chances are low, though.
Interesting thing.
Somebody from Obsidian asked me if I could share the sources for this tool with them a few days ago (only noticed the PM today). I suppose they could use such a tool to sometimes avoid waiting for 5 hours for the game to compile in order for the QA to test a small bug fix, because patching the dll directly is instantaneous.
That makes sense in theory, except this "tool" is so horribly coded that they could probably make a better one in less than an hour. So I lol'd, but still sent it to them, asking if they could maybe share their improved version of it in case they actually decide to work with it. If that happens and they do decide to release their improved version, this will be really really good. The chances are low, though.
I was a bit curious and checkout out the unity new gui thing that took so many years to do
no svg support for a new, multiple target systems gui library, really? I had svg support in java looks and feels from 2005! Not to mention the pathetic layout code. Doomed to reinvent badly indeed. Also no notion of separation of looks from GUI elements (CSS). Is there even a docking framework in there? I know there is a sorta clumsy animation editor.i
Adapted the code for the new version and added a few really tiny things. Download here.
What's new:
- Custom options will now allow you to test what Sensuki's been talking about - combat without engagement.
- If you're a hardcore nostalgia fag, you can have IE-like cyan blue circles instead of TOEE-like blue. Also blue circles themselves are now optional.
- You can turn off highlights for things that basically don't require it.
I play like this:
In case anyone has any suggestions for what to add next, post them. I might implement them.
Edit: found a little bug - the highlight will also be disabled for AOE abilities that require you to approach in order to cast them. Will fix in next version.
Well, that feels much better. Not a surprise though. Animations will need some adjustment, since in lieu of engagement the enemies have the habit of gliding around.
Next up on the modding agenda should be the removal of the strict separation between the combat state and non-combat state, if not fully, at least for certain abilities/status ailments/buffs.
Adapted the code for the new version and added a few really tiny things. Download here.
What's new:
- Custom options will now allow you to test what Sensuki's been talking about - combat without engagement.
- If you're a hardcore nostalgia fag, you can have IE-like cyan blue circles instead of TOEE-like blue. Also blue circles themselves are now optional.
- You can turn off highlights for things that basically don't require it.
I play like this:
In case anyone has any suggestions for what to add next, post them. I might implement them.
Edit: found a little bug - the highlight will also be disabled for AOE abilities that require you to approach in order to cast them. Will fix in next version.
Though I'm noticing some issues with enemies jogging in place or standing completely still in combat, not doing anything. Of course this could be a bug of the beta proper rather than the removal of engagement.
The mod simply adds a condition that for an engagement to happen, this checkbox needs to be unchecked. Otherwise, nothing else is touched or changed, so whatever you see happening in combat would also happen if you were playing an unmodded version.