Jump to content

MakeGlobal() - best practice before a DestroySelf action?


Recommended Posts

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 by subtledoctor
Link to comment

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.

Link to comment
Posted (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 by subtledoctor
Link to comment

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 by Ardanis
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...