Jump to content

Addressing scripts to creatures with no script name


Recommended Posts

I want a creature to disappear if a certain variable is set... a script should address them by their "script name" field, correct? And if they have none, then I need to add it. So I've done this:

COPY_EXISTING ~egenia.cre~ ~override~
  WRITE_ASCII 0x280 ~egenia~ #32
IF_EXISTS

ACTION_IF (FILE_EXISTS_IN_GAME ~ID4002.are~) BEGIN
<<<<<<<< inline/id4002_.baf
IF
	Global("D5_EET_IWD","GLOBAL",1)
	Global("Egenia_Gone","GLOBAL",0)
THEN
	RESPONSE #100
	SetGlobal("Egenia_Gone","GLOBAL",1)
	ActionOverride("egenia",DestroySelf())
END
>>>>>>>> 
  COPY ~inline/id4002_.baf~ ~weidu_external/%MOD_FOLDER%/compile/id4002_.baf~
  LAF cd_extend_bg_area_script STR_VAR area = ~id4002~ script = EVAL ~weidu_external/%MOD_FOLDER%/compile/id4002_~ END
END

...Does that look right?

(This is hard to test at the moment because the version I'm working on requires lots of other mods to be installed and I currently don't have a good test game to use...)

Edited by subtledoctor
Link to comment

That WRITE_ASCII needs a location; the first block should be

COPY_EXISTING ~egenia.cre~ ~override~
  WRITE_ASCII DEATHVAR ~egenia~ #32 // DEATHVAR = 0x280 is script name offset
IF_EXISTS

Make that correction, and it looks good to me.

The other option is to put the code to make the creature disappear in the creature itself's script. No script name targeting required that way.

Link to comment
34 minutes ago, subtledoctor said:

Sure. In particular these are IWD creatures which have script names in IWDEE, but the field is blank when they are added to BG2EE by tipun’s IWD1_EET mod. I am simply applying the vanilla IWD script names. But I can add them to the list once my mod is settled. 

Script names are handled differently in IWD and can be found in ARE actor structures instead. The "Name" field is used as script name if actor flag "Override script name" (bit 3) is set. That way the same creature file can be used as a template for different characters on the map. Actor structures may also override character scripts and even dialogs.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...