Overwriting a state function

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

Overwriting a state function

Post by Barbie »

How can I overwrite a state function? If I use state MyState Expands OriginalState it looks like that if I declare a function with the same name as in parent class the function of parent's class is called.
If I use an separate, unique state I will lose all other functions of the OriginalState. :noidea
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Alien3674
Novice
Posts: 9
Joined: Tue Nov 21, 2023 6:15 pm

Re: Overwriting a state function

Post by Alien3674 »

By simply redefining a function with a state.

Code: Select all

state PlayerWaiting
{
	function ProcessMove(float DeltaTime, vector NewAccel, eDodgeDir DodgeMove, rotator DeltaRot)
	{
		//The function has been redefined, yuor code here
	}
}
User avatar
Barbie
Godlike
Posts: 2808
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Overwriting a state function

Post by Barbie »

Argl, so simple… I expected losing all other function in parent state by "overwriting" a state with the same name. Thanks. :tu:
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Post Reply