1. How do I translate this C# command to Python?

    Code:
    AutoTurret[] turrets = GameObject.FindObjectsOfType<AutoTurret>();
     
  2. GameObject.FindObjectsOfType[AutoTurret]() might work.
    Make sure to import GameObject, though.
     
  3. Yea I tried that but I get ironPython error that I can't import GameObject.
    Don't have the exact error with me now but I will post it later when I get on my other PC.
     
  4. How are you trying to import GameObject?
     
  5. import GameObject

    is there any other way :)

    this is the error that I get when loading python plugin
    ImportError: Import of module GameObject not allowed
     
  6. The ImportError messages for Python are missleading. "Not allowed" can mean either "Not allowed" or "Not found".
    In this case it's "Not found".
    GameObject is in the UnityEngine namespace.
    Try
    Code:
    import UnityEngine.GameObject
    (and use it as UnityEngine.GameObject) or try
    Code:
    import UnityEngine.GameObject as GameObject
    and use it as GameObject.
     
  7. Thanks!

    Got that working now :)

    would you also happen to know how to modify bulletDamage on the AutoTurret.
    Looked at JustDecompile it's private variable so it';s not present on the turret.

    TurretsConfig.cs uses this:
    FieldInfo bulletDamageField = typeof(AutoTurret).GetField("bulletDamage", (BindingFlags.Instance | BindingFlags.NonPublic));
    bulletDamageField.SetValue(turret, GetBulletDamage(userID));

    have no idea how to get that field out from AutoTurret in python
     
  8. I just tried a bunch of things, but none of them worked, so not sure if it's possible.