![]() |
|
|
#1 | ||
|
State flow
This has been a little unclear to me and after some searching, I've decided to open this thread to ask how the flow is directed upon state change. There is some explanation on the wiki with regards to GotoState():
Quote:
Say, I've got an actor in state "StartUp". Given: Code:
state StartUp
{
function EndState()
{
Log("StartUp's EndState function was reached.");
}
}
state NewState
{
function BeginState()
{
Log("the BeginState function has been reached.");
}
begin:
Log("the begin label has been reached.");
blahblah:
Log("the blahblah label has been reached.");
}
![]() Anyway, the question was 'In what order are these points reached when I GotoState("NewState");?'. My guess is that we would see this in the Log: Quote:
__________________
- SuperApe ![]() |
|||
|
|
|
|
|
#2 |
|
Incorrect. You should see :
NewState's BeginState called StartUp's EndState called then when that object next executes, the label logs will fire as state code starts executing |
|
|
|
|
|
|
#3 |
|
State code is executed during actor tick, I think after Timer() and Tick().
Example: Code:
state A
{
function fA()
{
log("Before GotoState"@GetStateName());
GotoState('B');
log("After GotoState"@GetStateName());
}
event EndState()
{
log("End state A" @ GetStateName());
}
Begin:
log("In state A");
fA();
log("Still in state A");
}
state B
{
function fB()
{
log("Function B in state" @ GetStateName());
}
event BeginState()
{
log("BeginState B"@GetStateName());
}
Begin:
log("Begin label in state B");
GoingOn:
log("GoingOn label in state B");
}
__________________
Wormbo's UT/UT2004/UT3 mods | PlanetJailbreak | Unreal Wiki | Liandri Archives Everything you ever wanted to know about replication (but were afraid to ask) [in German] | UnrealScript security considerations <elmuerte> you shouldn't do all-nighters, it's a waste of time and effort <TNSe> nono <TNSe> its always funny to find code a week later you dont even remember writing <Pfhoenix> what's worse is when you have a Star Wars moment <Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!" |
|
|
|
|
|
|
#4 | |
|
Quote:
Thanks, Wormbo. These are excellent observations and descriptions. (We should integrate some of this back to the wiki when appropriate) I'll post back if there are any further questions on this.
__________________
- SuperApe ![]() |
||
|
|
|
|
|
#5 |
|
The quickest way to know for sure would be to setup a test script and log() everything.
|
|
|
|
|
|
|
#6 |
|
Right. Thanks.
__________________
- SuperApe ![]() |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|