Hi,
I'm thinking @msalaba might be able to help me here, but I've put this public in case anybody else knows.
I'm trying to test something in the ResouceManager.pex script in the latest build. To do this, I'm trying to overwrite a function. Here is the script I'm using :
I have attached the script to the SS2_ResourceManager quest (using another esp) and used FO4Edit to attached the properties. For some reasons some properties are still not filled. I've left them, as I don't think that is the problem (since I'm not using any of the properties anyway). In game, I can call cqf SS2_ResourceManger "ResourceManagerExtend.TestThis" and the "Testing This" debug box correctly pops up.
The AdjustNonPlotMaintenanceCostsOnSettlement function is called when the OnWorkshopObjectPlaced event is called (along with others) and I'm trying to see when and how often it is called. When I place a power generator, I can see through my other debug tools the non-plot costs have been changed, so I believe the function is being called properly in the SS2 script (in that instance), but my override is not working.
Since I'm working with a decompiled script, I'm wondering if the function name or parameters are not the same? Earlier I was able to override one of the functions in the HudResources script so when the InfoBox popped up it ran my code instead. I used this to work out why the InfoBox values were wrong.
I'm thinking @msalaba might be able to help me here, but I've put this public in case anybody else knows.
I'm trying to test something in the ResouceManager.pex script in the latest build. To do this, I'm trying to overwrite a function. Here is the script I'm using :
I have attached the script to the SS2_ResourceManager quest (using another esp) and used FO4Edit to attached the properties. For some reasons some properties are still not filled. I've left them, as I don't think that is the problem (since I'm not using any of the properties anyway). In game, I can call cqf SS2_ResourceManger "ResourceManagerExtend.TestThis" and the "Testing This" debug box correctly pops up.
The AdjustNonPlotMaintenanceCostsOnSettlement function is called when the OnWorkshopObjectPlaced event is called (along with others) and I'm trying to see when and how often it is called. When I place a power generator, I can see through my other debug tools the non-plot costs have been changed, so I believe the function is being called properly in the SS2 script (in that instance), but my override is not working.
Since I'm working with a decompiled script, I'm wondering if the function name or parameters are not the same? Earlier I was able to override one of the functions in the HudResources script so when the InfoBox popped up it ran my code instead. I used this to work out why the InfoBox values were wrong.