How to call state function in Super.Super?

Discussions about Coding and Scripting
Post Reply
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

How to call state function in Super.Super?

Post by Barbie »

Example of Nali's code:

Code: Select all

state Roaming {
	ignores EnemyNotVisible;

	function PickDestination()
	{
		if ( bHasWandered && (FRand() < 0.1) )
			GotoState('FadeOut');
		else
			Super.PickDestination();
		bHasWandered = true;
	}
}
I'd like to overwrite that state function PickDestination() and call ScriptedPawn's function PickDestination() in state 'Roaming' instead. But the compiler does not accept "Super(ScriptedPawn).PickDestination()": Unknown function 'PickDestination' in 'Class UnrealShare.ScriptedPawn'
Is a special syntax needed (like "Super(ScriptedPawn).Roaming.PickDestination()" or is this not possible at all because Nail's state 'Roaming' is redefined instead of extended?
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: How to call state function in Super.Super?

Post by sektor2111 »

I don't call those - I have CTRL C and CTRL V from ScriptedPawn in whatever I want. It's how I did NsMonster before XCGE19 - I did not have other solution in that time, and then adding sanity checkers where they were missing.
Post Reply