Results 1 to 6 of 6
  1. #1
    Iron Guard
    Join Date
    Feb 2008
    Posts
    775

    Default 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

    Default

    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.
    Wormbo's UT/UT2004/UT3 mods | PlanetJailbreak | Unreal Wiki | Liandri Archives

    <elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
    <TNSe> nono
    <TNSe> its always funny to find code a week later you dont even remember writing
    <Pfhoenix> what's worse is when you have a Star Wars moment
    <Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
    Note that your questions via PMs will be ignored if they actually belong in the forum.

  3. #3
    Iron Guard
    Join Date
    Apr 2008
    Posts
    542

    Default

    The call should instead be this:

    Code:
    return Super.DriverEnter(P);

  4. #4

    Default

    Giving fish and teaching how to fish...
    Wormbo's UT/UT2004/UT3 mods | PlanetJailbreak | Unreal Wiki | Liandri Archives

    <elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
    <TNSe> nono
    <TNSe> its always funny to find code a week later you dont even remember writing
    <Pfhoenix> what's worse is when you have a Star Wars moment
    <Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
    Note that your questions via PMs will be ignored if they actually belong in the forum.

  5. #5
    Iron Guard
    Join Date
    Apr 2008
    Posts
    542

    Default

    Something like that

  6. #6
    Iron Guard
    Join Date
    Feb 2008
    Posts
    775

    Default

    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.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.