FANDOM


Icon TFT
"You are accessing the classified database of the Task Force Talon"
This section of the Act of War wiki is archived, containing information from defunct fansites and wikis.
Do NOT edit any information in the archives unless it is fixing up spelling mistakes.
Using Python : first example

Python is very useful to express some developments which are not easy to express in NDF.

For example, python can easily do mathematical calculs. To calculate (TAccesseurA + TAccesseurB)/(log TAccesseurC), you can write in NDF :

<ndf>
ResultOfComplexCalcul is TAccesseurRealDivide :
  AccesseurNumerateur = TAccesseurRealAdd :
                          RealList =
                          [
                            TAccesseurA,
                            TAccesseurB,
                          ]
  AccesseurDenominateur = TAccesseurRealLogN :
                            AccesseurReal = TAccesseurC
</ndf>                            

In python, this is much simpler and easy to modify :

<ndf>
ResultOfComplexCalcul is TAccesseurRealPython :
  ParamsNoEval = MAP
  [
    ('A', TAccesseurA),
    ('B', TAccesseurB),
    ('C', TAccesseurC),
  ]
  Code = """
    import math
    result = (A.Value + B.Value) / math.log(C.Value)
  """
</ndf>

You can use thoses NDF Accessors in the same way

  • TAccesseurIntegerPython
  • TAccesseurBooleanPython
  • TAccesseurStringPython
  • TAccesseurStringListPython

and TEffetDescriptor_EffetPythonInstantane if you want an effect.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.