I thought I'd share this here, cos it could be useful info if working with the Future Skill (or Advanced Technology).
So, I was happily working at my Study Skills Online mod, when I found out that the aforementioned skill could not be clicked in the pie menu picker (i.e. the dialog wouldn't disappear).
After a few tests, I discovered that in order to be clicked, the skill element can't be null, or the SkillStage will throw an error when calling a specific method.
Why is that? Of course EA, who else, when overriding ComputeSkillGainMod() in the FutureSkill class, added a call to a method that assumes the element is not null, therefore making the SkillStage tilt and halting the ProcessCallback when clicking the skill in the picker.
I added a workaround in my mod, which is manually adding the element before the SkillStage is initialized.
This is probably something that can't be fixed without going Core, so if any of the NRaas mods has something about skilling where the SkillStage or ComputeSkillGainMod() are used, it might need to be reviewed. The same of course applies if there are plans to implement something similar.
Creating an NRaas project Interesting finding about Future Skill
Ok, let me just add something to laugh at :
BotBuildingSkill :
<!-- ws:start:WikiTextCodeRule:0:
<pre class="text">public override float ComputeSkillGainMod()<br/>{<br/> float num = base.ComputeSkillGainMod();<br/> if (base.SkillOwner != null)<br/> {<br/> num += base.GetVGnomeSkillModifier(base.SkillOwner.CreatedSim);<br/> }<br/> return num;<br/>}</pre>
-->
<style type="text/css"><!--
/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.text {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }
-->
</style><pre class="text">public override float ComputeSkillGainMod()
{
float num = base.ComputeSkillGainMod();
if (base.SkillOwner != null)
{
num += base.GetVGnomeSkillModifier(base.SkillOwner.CreatedSim);
}
return num;
}</pre>
FutureSkill :
<!-- ws:start:WikiTextCodeRule:1:
<pre class="text">public override float ComputeSkillGainMod()<br/>{<br/> float num = base.ComputeSkillGainMod();<br/> return num + base.GetVGnomeSkillModifier(base.SkillOwner.CreatedSim);<br/>}</pre>
-->
<style type="text/css"><!--
/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.text {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }
-->
</style><pre class="text">public override float ComputeSkillGainMod()
{
float num = base.ComputeSkillGainMod();
return num + base.GetVGnomeSkillModifier(base.SkillOwner.CreatedSim);
}</pre>
Gotta love EA coherency and how they manage to make mods fault because one of their programmers doesn't like checking if a value is null before using it
BotBuildingSkill :
<!-- ws:start:WikiTextCodeRule:0:
<pre class="text">public override float ComputeSkillGainMod()<br/>{<br/> float num = base.ComputeSkillGainMod();<br/> if (base.SkillOwner != null)<br/> {<br/> num += base.GetVGnomeSkillModifier(base.SkillOwner.CreatedSim);<br/> }<br/> return num;<br/>}</pre>
-->
<style type="text/css"><!--
/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.text {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }
-->
</style><pre class="text">public override float ComputeSkillGainMod()
{
float num = base.ComputeSkillGainMod();
if (base.SkillOwner != null)
{
num += base.GetVGnomeSkillModifier(base.SkillOwner.CreatedSim);
}
return num;
}</pre>
FutureSkill :
<!-- ws:start:WikiTextCodeRule:1:
<pre class="text">public override float ComputeSkillGainMod()<br/>{<br/> float num = base.ComputeSkillGainMod();<br/> return num + base.GetVGnomeSkillModifier(base.SkillOwner.CreatedSim);<br/>}</pre>
-->
<style type="text/css"><!--
/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.text {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }
-->
</style><pre class="text">public override float ComputeSkillGainMod()
{
float num = base.ComputeSkillGainMod();
return num + base.GetVGnomeSkillModifier(base.SkillOwner.CreatedSim);
}</pre>
Gotta love EA coherency and how they manage to make mods fault because one of their programmers doesn't like checking if a value is null before using it
- Chain_Reaction
- Site Admin
- Reactions:
- Posts: 7624
- Joined: December 30th, 2011, 6:00 pm
- Contact:
Have you checked out the awesome spelling as well?
<!-- ws:start:WikiTextCodeRule:0:
<pre class="text">public void CleanupdAvailableLotLists()<br/>{<br/>}</pre>
-->
<style type="text/css"><!--
/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.text {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }
-->
</style><pre class="text">public void CleanupdAvailableLotLists()
{
}</pre>
<!-- ws:start:WikiTextCodeRule:1:
<pre class="text">public enum AdvantureEvents<br/>{<br/>}<br/><br/>[TunableComment("TextAdvanture: Percent chance if Sim find Genie Lamp. If the items do not add up to 100, the remaining chance will be fore a rubber duck."), Tunable]<br/> private static float kAdvantureGenieLampChance = 1f;<br/><br/> [Tunable, TunableComment("TextAdvanture: Percent chance for random book. If the items do not add up to 100, the remaining chance will be fore a rubber duck.")]<br/> private static float kAdvantureItemChanceBook = 20f;<br/><br/> [Tunable, TunableComment("TextAdvanture: Percent chance for a random rock, gem or metal. If the items do not add up to 100, the remaining chance will be fore a rubber duck.")]<br/> private static float kAdvantureItemChanceRGM = 25f;<br/><br/> [TunableComment("TextAdvanture: Percent chance for a random seed. If the items do not add up to 100, the remaining chance will be fore a rubber duck."), Tunable]<br/> private static float kAdvantureItemChanceSeed = 25f;<br/><br/> [Tunable, TunableComment("TextAdvanture: Maximum amount of time between events.")]<br/> private static float kAdvantureMaxBetweenEvents = 60f;<br/><br/> [TunableComment("TextAdvanture: Minimum amount of time between events."), Tunable]<br/> private static float kAdvantureMinBetweenEvents = 30f;</pre>
-->
<style type="text/css"><!--
/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.text {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }
-->
</style><pre class="text">public enum AdvantureEvents
{
}
[TunableComment("TextAdvanture: Percent chance if Sim find Genie Lamp. If the items do not add up to 100, the remaining chance will be fore a rubber duck."), Tunable]
private static float kAdvantureGenieLampChance = 1f;
[Tunable, TunableComment("TextAdvanture: Percent chance for random book. If the items do not add up to 100, the remaining chance will be fore a rubber duck.")]
private static float kAdvantureItemChanceBook = 20f;
[Tunable, TunableComment("TextAdvanture: Percent chance for a random rock, gem or metal. If the items do not add up to 100, the remaining chance will be fore a rubber duck.")]
private static float kAdvantureItemChanceRGM = 25f;
[TunableComment("TextAdvanture: Percent chance for a random seed. If the items do not add up to 100, the remaining chance will be fore a rubber duck."), Tunable]
private static float kAdvantureItemChanceSeed = 25f;
[Tunable, TunableComment("TextAdvanture: Maximum amount of time between events.")]
private static float kAdvantureMaxBetweenEvents = 60f;
[TunableComment("TextAdvanture: Minimum amount of time between events."), Tunable]
private static float kAdvantureMinBetweenEvents = 30f;</pre>
I could go on and on. Hey EA:
<!-- ws:start:WikiTextCodeRule:0:
<pre class="text">public void CleanupdAvailableLotLists()<br/>{<br/>}</pre>
-->
<style type="text/css"><!--
/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.text {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }
-->
</style><pre class="text">public void CleanupdAvailableLotLists()
{
}</pre>
<!-- ws:start:WikiTextCodeRule:1:
<pre class="text">public enum AdvantureEvents<br/>{<br/>}<br/><br/>[TunableComment("TextAdvanture: Percent chance if Sim find Genie Lamp. If the items do not add up to 100, the remaining chance will be fore a rubber duck."), Tunable]<br/> private static float kAdvantureGenieLampChance = 1f;<br/><br/> [Tunable, TunableComment("TextAdvanture: Percent chance for random book. If the items do not add up to 100, the remaining chance will be fore a rubber duck.")]<br/> private static float kAdvantureItemChanceBook = 20f;<br/><br/> [Tunable, TunableComment("TextAdvanture: Percent chance for a random rock, gem or metal. If the items do not add up to 100, the remaining chance will be fore a rubber duck.")]<br/> private static float kAdvantureItemChanceRGM = 25f;<br/><br/> [TunableComment("TextAdvanture: Percent chance for a random seed. If the items do not add up to 100, the remaining chance will be fore a rubber duck."), Tunable]<br/> private static float kAdvantureItemChanceSeed = 25f;<br/><br/> [Tunable, TunableComment("TextAdvanture: Maximum amount of time between events.")]<br/> private static float kAdvantureMaxBetweenEvents = 60f;<br/><br/> [TunableComment("TextAdvanture: Minimum amount of time between events."), Tunable]<br/> private static float kAdvantureMinBetweenEvents = 30f;</pre>
-->
<style type="text/css"><!--
/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.text {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }
-->
</style><pre class="text">public enum AdvantureEvents
{
}
[TunableComment("TextAdvanture: Percent chance if Sim find Genie Lamp. If the items do not add up to 100, the remaining chance will be fore a rubber duck."), Tunable]
private static float kAdvantureGenieLampChance = 1f;
[Tunable, TunableComment("TextAdvanture: Percent chance for random book. If the items do not add up to 100, the remaining chance will be fore a rubber duck.")]
private static float kAdvantureItemChanceBook = 20f;
[Tunable, TunableComment("TextAdvanture: Percent chance for a random rock, gem or metal. If the items do not add up to 100, the remaining chance will be fore a rubber duck.")]
private static float kAdvantureItemChanceRGM = 25f;
[TunableComment("TextAdvanture: Percent chance for a random seed. If the items do not add up to 100, the remaining chance will be fore a rubber duck."), Tunable]
private static float kAdvantureItemChanceSeed = 25f;
[Tunable, TunableComment("TextAdvanture: Maximum amount of time between events.")]
private static float kAdvantureMaxBetweenEvents = 60f;
[TunableComment("TextAdvanture: Minimum amount of time between events."), Tunable]
private static float kAdvantureMinBetweenEvents = 30f;</pre>
I could go on and on. Hey EA: