Results 1 to 6 of 6

Thread: Super a variable function

  1. #1
    DazJW
    Guest

    Super a variable function

    I'm trying to extend
    Code:
    function bool DriverEnter(Pawn P)
    In my vehicle code.

    So of course I have the super at the end to call UTVehicle's code like this
    Code:
    	Super.DriverEnter(Pawn P);
    But this gives me a bad or missing expression for token error.
    Having just P in the brackets will compile but the super doesn't work (my code executes but you don't enter the vehicle).

    What am I missing?

  2. #2
    Wormbo
    Guest
    Note that your function must return a value. If you don't want to change the parent class implementation's return value, just use it as your function's return value.

    Remember: Super calls are just regular function calls, with parameters passed in and optionally a value returned.

  3. #3
    280Z28
    Guest
    The call should instead be this:

    Code:
    return Super.DriverEnter(P);

  4. #4
    Wormbo
    Guest
    Giving fish and teaching how to fish...

  5. #5
    280Z28
    Guest
    Something like that

  6. #6
    DazJW
    Guest
    I stopped being a pillock, went hunting instead and found:
    Code:
    if ( super.DriverEnter(P) )
    Which seems to be how Epic do it, though either works.

    Thanks for the help.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •