Here is the code in question, which just applies a random preset on the dummy character when testing in editor mode. I'll wrap some lines of interest in double asterisks to make them easier to find.
INIT
DB_EditorMode_Presets(0, "Battlemage");
DB_EditorMode_Presets(1, "Cleric");
DB_EditorMode_Presets(2, "Conjurer");
DB_EditorMode_Presets(3, "Enchanter");
DB_EditorMode_Presets(4, "Fighter");
DB_EditorMode_Presets(5, "Inquisitor");
DB_EditorMode_Presets(6, "Knight");
DB_EditorMode_Presets(7, "Metamorph");
DB_EditorMode_Presets(8, "Ranger");
DB_EditorMode_Presets(9, "Rogue");
DB_EditorMode_Presets(10, "Shadowblade");
DB_EditorMode_Presets(11, "Wayfarer");
DB_EditorMode_Presets(12, "Witch");
DB_EditorMode_Presets(13, "Wizard");
IF
GameModeStarted("Campaign",1)
AND
DB_GLO_FirstLevelAfterCharacterCreation(_Level)
AND
DB_CharacterCreationTransitionInfo(_Level,_Trigger)
AND
**Random(14, (INTEGER)_Random)**
THEN
SetOnStage(S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406,1);
CharacterMakePlayer(S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406);
MakePlayerActive(S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406);
DB_IsPlayer(S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406);
SetFaction(S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406, "Hero");
**ProcApplyEditorPreset(S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406, _Random);**
ProcMovePartyToStart(S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406,_Trigger);
PROC
ProcApplyEditorPreset((CHARACTERGUID)_Player, (INTEGER)_Index)
AND
DB_EditorMode_Presets(_Index, _Preset)
THEN
CharacterApplyPreset(_Player, _Preset);
And here are the test results. Between each run I completely re-open the project and starting level from scratch and have some additional actions noted on some of the other runs.
1st runexec [DIV query] Random( 14, [out] (INTEGER)(undef value) )
Query returns: Random( 14, 4 )
2nd run same as beforeexec [DIV query] Random( 14, [out] (INTEGER)(undef value) )
Query returns: Random( 14, 4 )
3rd run same as beforeexec [DIV query] Random( 14, [out] (INTEGER)(undef value) )
Query returns: Random( 14, 4 )
4th run same as beforeexec [DIV query] Random( 14, [out] (INTEGER)(undef value) )
Query returns: Random( 14, 4 )
**EXIT EDITOR and RESTART**5th run same as beforeexec [DIV query] Random( 14, [out] (INTEGER)(undef value) )
Query returns: Random( 14, 4 )
6th run same as beforeexec [DIV query] Random( 14, [out] (INTEGER)(undef value) )
Query returns: Random( 14, 4 )
** Move some code order around and re-build the story **7th run same as beforeexec [DIV query] Random( 14, [out] (INTEGER)(undef value) )
Query returns: Random( 14, 4 )
** Open a different project and test it for a while **** Open this project back up and test (no code changes) **8th run finally changes!exec [DIV query] Random( 14, [out] (INTEGER)(undef value) )
Query returns: Random( 14, 5 )
** Reload Project and Start **9th run same as beforeexec [DIV query] Random( 14, [out] (INTEGER)(undef value) )
Query returns: Random( 14, 5 )
** Open a different project and test it for a while **** Open this project back up and test (no code changes) **10th run same as beforeexec [DIV query] Random( 14, [out] (INTEGER)(undef value) )
Query returns: Random( 14, 5 )
and so on ...