Author Topic: Question to COMPILE ~first.d~ ~second.d~  (Read 160 times)

Offline jastey

  • Planewalker
  • *****
  • Posts: 1182
  • Gender: Female
Question to COMPILE ~first.d~ ~second.d~
« on: August 10, 2017, 08:33:23 AM »
If I compile two .d-files with one COMPILE they are treated as if the content would be in the same .d-file - or so I thought?
 
This doesn't seem to be true for INTERJECT or ADD_TRANS_TRIGGER, at least not if I try to do it into a mod/custom dialogue state.
 
What I mean is, the following works if it is inside the same .d file:
 
 
Code: (auto:0) [Select]
APPEND SENIYA
IF ~~ THEN BEGIN JA#SENIYA_07
SAY @17
IF ~~ THEN DO ~AddexperienceParty(600)SetGlobal("SeniyadXP","GLOBAL",1)Shout(3)EscapeArea()~ EXIT
END
END

ADD_TRANS_TRIGGER SENIYA JA#SENIYA_07
~OR(3) !InParty("jaheira") !InMyArea("jaheira") StateCheck("jaheira",CD_STATE_NOTVALID)~
DO 0

 
But if it is separated into two .d-files and compiled as one via COMPILE ~first.d~ ~second.d~, the error message is that it cannot resolve dlg state "JA#SENIYA_07". Same if I try INTERJECT SENIYA JA#SENIYA_07 etc.
 
Is this intended behavior / something we have to live with or could it be changed so that both cases work?

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 897
Re: Question to COMPILE ~first.d~ ~second.d~
« Reply #1 on: August 10, 2017, 12:19:22 PM »
COMPILE does not treat several files as a single one, it maintains state between each (it's not quite the same thing, as we see here). It just so happens that files are compiled in reverse order. You can also use APPEND_EARLY to make the append action order-independent, which is the intended way to append states which are to be targetted by actions in other D files.
« Last Edit: August 10, 2017, 12:21:52 PM by Wisp »

Offline jastey

  • Planewalker
  • *****
  • Posts: 1182
  • Gender: Female
Re: Question to COMPILE ~first.d~ ~second.d~
« Reply #2 on: August 11, 2017, 01:12:18 AM »
It didn't occur to me that the order of files could be the problem. This was very helpful information. And indeed, if I compile it as "COMPILE ~second.d~ ~first.d~" with "second.d" being the patches, it works.
Thank you very much! I am very happy.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: