Jump to content

Symbolic labels in D files


Skye

Recommended Posts

STATE_WHICH_SAYS is a TP2 action though. How would I use that in a D file? Can I do OUTER_SET myvar = STATE_WHICH_SAYS @123 FROM MYDLG in my TP2 file and then do EXTERN MYDLG myvar in the D file?

Essentially, yes. You mark up "myvar" as a variable by delimiting it with percentage signs and compile the D file with the EVAL option, to have variables evaluated.

D:

 

EXTERN some_dlg %some_state%

 

TP2:

 

OUTER_SET some_state = STATE_WHICH_SAYS @something FROM some_dlg
COMPILE "mymod/some.d" EVAL

Though you probably either want to use the alternate form of STATE_WHICH_SAYS or WITH_TRA, to avoid loading the TRA file for some_dlg into the global scope.

Link to comment

You can also check if a given mod is either installed or in your game folder, then search for states.

//1
OUTER_SET GW_Uhmer01_state_remise1 = STATE_WHICH_SAYS 11105624 IN ~Diamant_Eternel/tra/%s/GWQueleL.tra~ FROM UHMER01

//2
OUTER_SET GW_Mazzy_state_Stivan = STATE_WHICH_SAYS 232 IN ~stivan/tra/%s/tb#stivj.tra~ FROM MAZZY // @232 = ~I'd say we shouldn't wait any further and open our way in this place of evilness.~

Then,

// COMPATIBILITY with Solaufein Romance: dialog UHMER01.
// -----------------------------------------------------
ACTION_IF (GW_Uhmer01_state_remise1 > 0) BEGIN

    <<<<<<<< .../Diamant_Eternel/inlined/uhmer01.d
A_T_T UHMER01 %GW_Uhmer01_state_remise1% ~!GlobalGT("SolaTalk","GLOBAL",13)~
EXTEND_TOP UHMER01 %GW_Uhmer01_state_remise1%
    IF ~GlobalGT("SolaTalk","GLOBAL",13)~ THEN DO ~StartStore("GWwwmer1",LastTalkedToBy(Myself))~ EXIT
END
>>>>>>>>
    COMPILE ~.../Diamant_Eternel/inlined/uhmer01.d~ EVALUATE_BUFFER

END    // of ACTION_IF (GW_Uhmer01_state_remise1 > 0)


// COMPATIBILITY with Stivan the Hunter: dialog MAZZY.
// ---------------------------------------------------
LAM ~GW_COMPATIBILITY_STIVAN~        // Macro which looks for compatibility with Stivan the Hunter.

ACTION_IF (GW_Mazzy_state_Stivan = 0) AND (GW_Stivan_Hunter = 1) BEGIN

    <<<<<<<< .../Diamant_Eternel/inlined/mazzy.d
EXTEND_TOP MAZZY %GW_Mazzy_state_Stivan% #%MAZZY_Transition25%
    + ~Global("GWChevaucheuseKit","GLOBAL",2) Global("GWLyrielUmar","LOCALS",0)~ + @461401113 DO ~DialogueSetGlobal("GWLyrielUmar","LOCALS",25)~ GOTO Mazzy_Lyriel_1    // ~Je dois vous prévenir que je suis à la recherche d'une certaine Lyriel venue enquêter sur ces événements. Elle a disparu. L'auriez-vous aperçue ?~
END
>>>>>>>>
    COMPILE ~.../Diamant_Eternel/inlined/mazzy.d~ EVALUATE_BUFFER

END    // of ACTION_IF (GW_Mazzy_state_Stivan = 0) AND (GW_Stivan_Hunter = 1)

Note : #%MAZZY_Transition25% is also outlined in GW_Dlg_functions_and_macros.tpa IF Stivan the Hunter is either installed or downloaded in the game folder.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...