subtledoctor Posted April 9, 2023 Share Posted April 9, 2023 (edited) 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 April 9, 2023 by subtledoctor Quote Link to comment
jmerry Posted April 9, 2023 Share Posted April 9, 2023 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. Quote Link to comment
subtledoctor Posted April 9, 2023 Author Share Posted April 9, 2023 Whoops, yeah, meant to say 0x280, edited now. Quote Link to comment
jastey Posted April 10, 2023 Share Posted April 10, 2023 For patching cre files, please consider and add your changes to the unified cre patching list: Quote Link to comment
subtledoctor Posted April 10, 2023 Author Share Posted April 10, 2023 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. Quote Link to comment
argent77 Posted April 10, 2023 Share Posted April 10, 2023 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. Quote Link to comment
subtledoctor Posted April 10, 2023 Author Share Posted April 10, 2023 Oh interesting, so maybe I don’t even need to add them to the .CRE file. I’ll take a look. (But then again these are all unique creatures, and the field at 0x280 is filled in in the IWDEE game, so maybe it’s best for the files to conform to the EE standard…) Quote Link to comment
Recommended Posts
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.