To clarify, consider the following code. After a thing of class child_class goes into state2, the *desired* behavior is for it to print
- "state2 on the other hand is just a small modification of the parent's state2."; followed by
"parent_class is in state2"; followed by
"The child class needs to do something totally different in state1.".
- "state2 on the other hand is just a small modification of the parent's state2"; followed by
"parent_class is in state2"; followed by
"parent_class is in state1".
Code: Select all
actor parent_class
{
States
{
state1:
TNT1 A 0 // This is necessary in a spawn state. It's not necessary in general though, is it?
TNT1 A 0 A_PrintBold("parent_class is in state1.")
loop
state2:
TNT1 A 0
TNT1 A 0 A_PrintBold("parent_class is in state2.")
goto state1
}
}
actor child_class: parent_class
{
States
{
state1:
TNT1 A 0
TNT1 A 0 A_PrintBold("The child class needs to do something totally different in state1.")
// New completely different code goes here.
loop
state2:
TNT1 A 0
TNT1 A 0 A_PrintBold("state2 on the other hand is just a small modification of the parent's state2.")
goto super::state2
}
}
Is there a more efficient way to accomplish what I would like? (Note that the solution can only involve modification of the child class---the parent class is part of a separate mod that is not mine.)