Jump to content


Symbolic labels in D files

16 replies to this topic

#16 Wisp

  • Modders
  • 1084 posts
  • Gender:Male

Posted 19 April 2017 - 08:32 AM

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.


EXTERN some_dlg %some_state%



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.

#17 Gwendolyne

  • Members
  • 139 posts
  • Gender:Male
  • Location:France

Posted 19 April 2017 - 11:12 AM

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

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

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.~


// 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
    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 ?~
    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.



In progress : Menace sur le Royaume de Diamant Éternel

Reply to this topic


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users