[English] Hardcoded functions

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [English] Hardcoded functions

      In this thread we can collect hardcoded functions and how they work.

      Today Iearned: SpendMoney(Alias, Amount, Reason) does work differently for AI dynasties. Instead of losing the full amount of money, they indeed only lose Amount*(0.8-DifficultyLevel*0.1)

      To avoid that you would need to make it so:

      If DynastyIsAI(Alias) then

      SpendMoney(Alias, (Amount*(10/(8-DifficultyLevel))), Reason) else
      SpendMoney(Alias, Amount, Reason)

      This was probably done to boost the rather weak AI, but you should really know that to balance things correctly. As it is, this hardcoded change in behavior might actualy lead to money inflation, because on highest difficulty it spawns 60 percent (!) additional money everytime the AI buys something.

      Thus I consider it bad design and a bug
    • Interesting side fact for SpendMoney. The function actually has an undocumented fourth parameter of type Boolean. The 4th parameter defaults to "false".

      Source Code

      1. SpendMoney(Target, 1000, "misc", true)
      If set to "true", the money will be spent even if the SIM does not have enough money. Otherwise the money is not spent and the function returns "false".
    • AddEvidence has undocumented parameters.

      Script Docu says:

      Number GetEvidenceValues(Alias ( of type sim) Target, Alias ( of type sim) Actor)
      Alias ( of type sim) Target :
      Target sim Alias
      Alias ( of type sim) Actor :
      Actor sim alias
      Return Value:
      Number :
      Values sum of all evidences the target has about actor
      Returns the value sum of all evidences the target has about actor

      But you can add additional aliases (variable, at least 10) to the function to share the evidence

      So you can use it like this:

      AddEvidence("", "Destination", "EvidenceVictim", Evidence, "Destination", "Sim0", "Sim1", "Sim2", "Sim3", "Sim4", "Sim5", "Sim6", "Sim7", "Sim8", "Sim9")

      Remember: it creates one new memory event; all sims will have the same memoryevent. So if that gets to court, it will cleared from all memories

      Note also: it will add with 100% credibility for all Sims