BlackAlpha Posted October 30, 2012 Share Posted October 30, 2012 (edited) I'm trying to add Rapid Fire to a weapon. As some of you already know, the problem is that the ability is grayed out during the battle. Perk abilities such as Rapid Fire only seem to work if you acquire them through leveling up in the skill tree. I'm trying to find a way around that. I've been looking to find the code responsible for disabling the ability icon. No luck so far. But I believe this might be the best chance to make this work, so I keep searching for it. But I probably won't find it on my own, there's so much code... I've also been trying to "break" the perk by giving it a different ID and such, but it doesn't seem to change anything. So no luck there either. Did someone figure this out already? Any ideas? Want to help search for the code responsible? Edited October 30, 2012 by BlackAlpha Link to comment Share on other sites More sharing options...
BlackAlpha Posted October 31, 2012 Author Share Posted October 31, 2012 (edited) I figured out that if I switch the ability IDs between Rapid Fire and another ability, Rapid Fire will inherit the properties of the other ability and vice versa. So I'm now pretty sure that there's a piece of code somewhere that looks at the ability IDs and then assigns them certain properties. And this code is not present at the place where the ability is initially created! Madness! That's the thing, I haven't been able to find any code that dictates the special properties of each ability, like what makes regular fire, regular fire, and what makes a smoke grenade a smoke grenade, etc. Just need to find that code. Although I'm afraid it might be inside the .exe file. Not entirely sure yet. There's still a pretty big chance I overlooked something. By the way, I found the GUI code that enables/shows/hides stuff in the GUI during battles, but judging by the code, it doesn't have the power to "unlock" abilities. It checks at an unknown location if the ability is "available". So the GUI code seems to be a dead end. I did find out how to virtually eliminate the chances of your soldiers killing friendlies when in panic, so that they only shoot at enemies. Judging by the names in the code, it's actually a bug that makes your soldiers shoot friendlies, but I guess the devs then decided to call it a feature. Or maybe it's just lazy programming... And I also figured out how to increase the chances of your soldiers becoming incapacitated rather than die. But need to go to bed for now... Edited October 31, 2012 by BlackAlpha Link to comment Share on other sites More sharing options...
PepprmintButler Posted October 31, 2012 Share Posted October 31, 2012 I haven't been able to find any code that dictates the special properties of each ability, like what makes regular fire, regular fire, and what makes a smoke grenade a smoke grenade, etc. Just need to find that code. I've been all over the upks looking for that code, no luck yet. Can't say I have combed averything, but I'm running out of ideas on likely places to find it. It's super frustrating. Also, good job on modding both panic friendly fire and the critical injury rate. :thumbsup: Will you share ? (I'm not planning to do anything with it personally, but I'm sure many would be eager to try those out) Link to comment Share on other sites More sharing options...
BlackAlpha Posted October 31, 2012 Author Share Posted October 31, 2012 (edited) A lot of code seems to check if an ability is available and then it shows/hides the ability icons/etc. They call "CheckAvailable", which I think leads to this: In XGAbility: native final simulated function bool CheckAvailable(); That's it, that's the entire code! Unless I'm mistaken, that doesn't actually do anything. Or does it? Am I reading this wrong? Other functions expect a true or false response from this code, how is that possible? Some other code contains this function: native function bool InternalCheckAvailable(); But again, there's no actual code! Just a function name! What sorcery is this?! Unless... the function is hardcoded somewhere else... which would mean the devs ported more than just the .ini files into the .exe file. But I'm really hoping someone can prove me wrong on this! Also, good job on modding both panic friendly fire and the critical injury rate. :thumbsup: Will you share ? (I'm not planning to do anything with it personally, but I'm sure many would be eager to try those out) Was too tired last time I posted, but I just did. See other topic created by me. Edited October 31, 2012 by BlackAlpha Link to comment Share on other sites More sharing options...
bokauk Posted October 31, 2012 Share Posted October 31, 2012 (edited) native function bool InternalCheckAvailable();But again, there's no actual code! Just a function name! What sorcery is this?!Native functions are coded somewhere else (such as the .exe), but they can also be called from the scripts. There's loads of interesting native functions (a lot of the good stuff), which unfortunately, we can't get to :( Edited October 31, 2012 by bokauk Link to comment Share on other sites More sharing options...
BlackAlpha Posted October 31, 2012 Author Share Posted October 31, 2012 (edited) native function bool InternalCheckAvailable();But again, there's no actual code! Just a function name! What sorcery is this?!Native functions are coded somewhere else (such as the .exe), but they can also be called from the scripts. There's loads of interesting native functions (a lot of the good stuff), which unfortunately, we can't get to :( So it's decided then. Abilities are basically hardcoded. We cannot use perk abilities without going through the skill trees of the different classes. Another possible solution is to somehow give perks to our soldiers through other means. But I haven't found a way so far while being restricted to Hex editing. Edited October 31, 2012 by BlackAlpha Link to comment Share on other sites More sharing options...
Recommended Posts