Super(Pawn)

  • 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.

Darknigh+

New Member
Oct 19, 2003
113
0
0
www.cis.usouthal.edu
Okay I have some code that I have been looking at as a refrence to what I am trying to do. I have however run into some confussion. The class extends from the bot class and has a functions called AddInventory. Now I have search this functions and it only exsit in the Pawn class.

I understand that the Super key word refers to the parent class and that Super(className).function() would call the superclasses className function.
But how can you use Super(Pawn) inside a bot subclass. This would mean Pawn is a parent of Bot which it isn't.
Code:
function bool AddInventory( inventory NewItem )
{
	Super(Pawn).AddInventory(NewItem);
//Other code.
}
 

Darkblaster

New Member
Mar 2, 2003
43
0
0
Visit site
Try "Pawn.AddInventory(NewItem)", the "super" wrong here, you only use it inside of functions to call the function in the parent-class too.