Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: individual militia
Re: New feature: individual militia[message #353107 is a reply to message #353094] Fri, 13 April 2018 02:56 Go to previous messageGo to previous message
RunAwayScientist is currently offline RunAwayScientist

 
Messages:84
Registered:September 2001
>does not return an ID if the profile does not exist. Does that compile?

Yes. It compiles and runs correctly. This is not good practice, I know, so perhaps you'd prefer a return null or 0? This function does not apparently require a return and terminates normally if no returned ID is provided. Your code is very robust.


> Second, if we do not have a profile, we need to create one, otherwise militia would be without it. So...

Nope, this is not required. What ends up happening is that if there is a problem or bug, it *will* create a new militia. This new militia ID orphans the old militia ID. This is how we get duplicated militia with orphan militia IDs that cannot be removed from savegames or dismissed. They are 'ghost' or 'phantom' IDs sitting in a vector. The game counts their salaries and results in a doubling of daily expenses. They *can* be dismissed manually, but this is annoying for the end user. They also /cannot/ be dismissed after their linked actual militia dies or disbands, resulting in stuck 'phantom' militia IDs in the save file that cannot be removed no matter what you do.



> As to the warnings...

Yes, I agree. This is good practice. However, a new variable should be used to measure the current computer clock time so that only *1* single debug message should be displayed every 30 minutes, or use in-game time for every day. This would cut back on the spam and still be a useful reminder to the player that they have unarmed militia.

For my games: I commonly smuggle in Kerberus militia into ports and docks and move them completely unarmed to reinforce current combat locations where I can give them equipment. This is how I encountered this issue.




@LatZee: If I understand the Kerberus code correctly, purchase prices are directly related to the settings in MilitiaIndividual.xml ; have you tried modifying those values and then going back to it? After I changed those values, I noticed that the purchase price for my Kerbs went up. I believe it's a hardcoded percentage or multiplier, but this can definitely be modified in the code or through the .xml to match the default prices.

I will pay.... a fair price.

[Updated on: Fri, 13 April 2018 03:05]

Report message to a moderator

Corporal 1st Class
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message light45.png
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message thumbs26.png
Read Message
Read Message
Read Message
Read Message bug6.png
Read Message
Read Message bug6.png
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New feature: advanced repair/dirt system
Next Topic: New (unofficial) mercs: The Ryder twins (Mass Effect: Andromeda)
Goto Forum:
  


Current Time: Sat Nov 30 09:27:11 GMT+2 2024

Total time taken to generate the page: 0.02010 seconds