How to call state function in Super.Super?

Discussions about Coding and Scripting

How to call state function in Super.Super?

Postby Barbie » Thu Jan 26, 2017 5:29 pm

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
Barbie
Godlike
 
Posts: 1649
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

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

Postby sektor2111 » Thu Jan 26, 2017 5:53 pm

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.
User avatar
sektor2111
Godlike
 
Posts: 3917
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.


Return to Coding, Scripting

Who is online

Users browsing this forum: No registered users and 3 guests