subtledoctor Posted March 24 Share Posted March 24 (edited) I need to remove an NPC. The IESDP says this: Quote This action removes the active creature from the game. No death variable is set. Global creatures like joinable NPCs, familiars and recipients of MakeGlobal are still accessible by script name and are not fully removed. So if I want to, say, remove Bentley Mirrorshade from the game, would this be best practice to make the NPC still accessible by script name? IF Global("bentley_global","GLOBAL",0) THEN RESPONSE #100 ActionOverride("bentley",MakeGlobal()) SetGlobal("bentley_global","GLOBAL",1) END // ...is that ^ necessary? IF GlobalGT("CHAPTER","GLOBAL",6) Global("bentley_dead","GLOBAL",0) THEN RESPONSE #100 ActionOverride("bentley",DestroySelf()) SetGlobal("bentley_dead","GLOBAL",1) END Or is the first block unnecessary? (That would be added to the area script.) Edited March 24 by subtledoctor Quote Link to comment
jmerry Posted March 24 Share Posted March 24 So, is there any conceivable reason that, if you removed Bentley and had some later event bring him back, it would matter that it's that particular version of Bentley and not a newly created one? Stores are always global, by the way - it's just stuff like personal inventory and local variables that would care about a particular instance of an NPC. I'd conceptualize DestroySelf(), like EscapeArea(), as "send to nowhere". Global creatures can be recalled back from that nowhere with the MoveGlobal() action, while non-global creatures can't because any reference to their script name only "looks" in the current area. Quote Link to comment
subtledoctor Posted March 24 Author Share Posted March 24 (edited) The issue is how to be conduderate if other modders. If, say, some mod wanted to bring Bentley into your party in TOB to battle Amelysan - if that mod scripts some events targeting the bentley script name, would it fail because of my DestroySelf action? I just want to remove Bentley from the player’s view. I suppose I could just move him out of his normal area and stash him in the tutorial, or the prologue version of Candlekeep or something. I am doing this in chapter 7 of BGEE, so the chance of something like this happening is extraordinarily remote. I just want to make sure I don’t mess anything up for others. Edited March 24 by subtledoctor Quote Link to comment
Ardanis Posted March 25 Share Posted March 25 (edited) Deactivate() or however it's spelled isn't enough? Also if you're concerned that some hypothetical mod might make him playable, you do realize that removing him from the area without completely eliminating from the game would still mess with that mod regardless, right? I.e. some compatibility workaround would be needed anyway. So just DestroySelf() him and call it a day imo. Edited March 25 by Ardanis Quote Link to comment
Galactygon Posted March 25 Share Posted March 25 This may be an old myth that's been debunked, but don't large number of Globals have an effect on ingame performance? 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.