1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

UE2 - UT2kX UnrealScript Non Static Func To Static

Discussion in 'Programming' started by LightFusion, Jan 4, 2016.

  1. LightFusion

    LightFusion New Member

    Joined:
    May 21, 2014
    Messages:
    4
    Likes Received:
    0
    Hello, im stuck with this stuff - i want to make a non static native iterator function, to a static
    Code:
    native(310) final iterator function RadiusActors  ( class<actor> BaseClass, out actor Actor, float Radius, optional vector Loc );
    
    Thats what i have !
    Is it possible to convert it to static function like that
    Code:
    static function GetRadActor( Actor DummyActor,class<actor> BaseClass, out actor Actor, float Radius, optional vector Loc  )
    {
      DummyActor.RadiusActors(BaseClass,Actor,Radius,Loc);
    }
    Or mb like that
    Code:
    static function GetRadActor(class<actor> BaseClass, out actor Actor, float Radius, optional vector Loc  )
    {
      return RadiusActors(BaseClass,Actor,Radius,Loc);
    }
    I'v been troubling with this for 3 days, can someone help me out pls!
     
  2. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,913
    Likes Received:
    36
    For reference, my reply on UT99.org:
     
  3. ROSoldier

    ROSoldier New Member

    Joined:
    Feb 1, 2015
    Messages:
    28
    Likes Received:
    0
    I need to make the opposite! I need to make a "non" simulated function a simulated one. (SetPawnClass)
    I redefine the function as simulated but I still get an error:

    I need to call a non-static function from within "SetPawnClass"
     
  4. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,913
    Likes Received:
    36
    A non-static function is always called on some object, so if you are in a static function, you need to provide the object to call that non-static function on. (Same thing as the OP's iterator problem, really.)
     

Share This Page