Jump to content

.D EXTERN - How can I use symbolic labels?


Luiz

Recommended Posts

... If that's possible at all.

 

I have an .D for a new creature thus:

BEGIN LZHOKEN

IF ~~ THEN BEGIN Roar
 SAY ~Raaaaaaaaaaaaargh!~
 IF ~~ THEN DO ~Enemy()~ EXIT
END

And a .D alteration for an existing creature (PIRSEA01):

APPEND PIRSEA01
IF ~~ THEN BEGIN 2
SAY ~Time for you to earn your keep, mongrel!~
IF ~~ THEN EXTERN LZHOKEN Roar
END
END

REPLACE PIRSEA01
IF ~~ THEN BEGIN 1
SAY ~Kill the bloody spy, mates!  I'll have no word of this leaking out!~
IF ~~ GOTO 2
END
END

Which results in the following DEBUG:

ERROR: Cannot resolve external symbolic label [Roar] for DLG [LZHOKEN]
ERROR: postprocessing [PIRSEA01]: Failure("cannot resolve label")
Stopping installation because of error.

NB: LZHOKEN.D compiles first in the tp2 so I'm a bit stumped.

 

I've got this working using absolute numbers for the states, ie "0" instead of "Roar", but one of the EXTERN explanations in the WeiDU Documentation says "stateLabel" is fine. Is the problem that APPEND requires an absolute "stateNumber"?

 

Cheers,

Luiz - for whom comprehension of .D syntax remains elusive.

Link to comment

From the .tp2:

// Add new combatant to Pirate group in cave behind the Sea's Bounty

COMPILE ~luizitms/LZHOKEN.D~			// Kensai's dialog

COPY ~luizitms/LZHOKEN.CRE~ ~override~		// Kensai
 SAY NAME1 ~Pirate Enforcer~
 SAY NAME2 ~Pirate Enforcer~

EXTEND_TOP ~AR0310.BCS~ ~luizitms/AR0310.baf~   // Spawn Kensai

COMPILE ~luizitms/LZPIRATE.D~			// Change Pirate Captain's dialog to call on Kensai

Link to comment

I'm afraid I don't quite see the problem, but I see another one: you are replacing the dialogue.

 

In this case all that is needed is, basically, an interjection in this state. Can you work with the Infinity Explorer? You open the desired dialogue, look at the state number of the phrase he is saying(the first one is probably 0, but you need to check), and then you write an interjection into this phrase:

 

BEGIN LZOKEN // so that the dialogue file exists

I_C_T PIRSEA01 0 LZSpeaksToOken // this should be a unique name
== PIRSEA01 ~Time for you to earn your keep, mongrel!~
== LZOKEN ~Raaaaaaaaaaaaargh!~
DO ~Enemy()~
END

 

... or that's what I'd do. Look at the newer mods for examples of I_C_T and CHAIN(Kivan, Xan, Quest Pack), it will help. Weidu Readme has some great tutorials, too.

Link to comment

Right. I'll get to it. :)

 

EDIT: That works a treat, thanks. I'd never thought of I_C_T because I foolishly assumed I needed to destructively change the former final state to be sure it didn't "DO Enemy() EXIT". Good to learn these things.

Link to comment
NB: LZHOKEN.D compiles first in the tp2 so I'm a bit stumped.

.

.

.

I've got this working using absolute numbers for the states, ie "0" instead of "Roar", but one of the EXTERN explanations in the WeiDU Documentation says "stateLabel" is fine. Is the problem that APPEND requires an absolute "stateNumber"?

 

Two things going on here.

 

1. Don't create new states using integer labels. It only leads to problems, as you are seeing here.

 

2. Once you compile a DLG, WeiDU no longer "sees" the state labels from the .d file. So if you need two different files to be able to share labels across, you need to compile them simultaneously:

 

COMPILE ~lzhoken.d~ ~whateverother.d~ ~yetanother.d~

Link to comment

1. Well, I was trying to avoid that as far as possible, which became a problem.

 

2. And that's the solution, I see now. Never knew/realised about simultaneous compiling. :/

 

Thanks very much. Between this and I_C_T I think I can see a way to do things much more efficiently.

 

Cheers,

Luiz.

Link to comment

Archived

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

×
×
  • Create New...