Aller au contenu

Photo

Will GetObjectByTag get an object in another area?


2 réponses à ce sujet

#1
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
I have a plot flag that I use to deactivate an NPC in the current area and activate another version of that NPC in an adjoining area.

It doesn't seem to be working though - I'm wondering if the problem is that I'm using GetObjectByTag when I'm defining the target object for the command that makes an object active and that doesn't work across areas?

If it doesn't, is there another command I should use?

#2
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
Generally speaking, the answer is no. You can only manipulate objects in your current area. The way we handle this in the main game is with the EVENT_TYPE_AREALOAD_PRELOADEXIT in the area script. When the player enters the second area, you check the plot flag, then change the active/inactive status of the creature accordingly.



That said, I believe that GetObjectByTag will work across areas if the two areas are in the same area list. I do not recommend taking this approach, but it probably will work.

#3
QuickQuipt

QuickQuipt
  • Members
  • 7 messages
Thank you, David. Yes, yes, and Oh Yeah!



GetObjectByTag does work within an area list, but it's not particularly useful because I can't manipulate the referent unless it's the same area.



Oh Yeah: I wondered why I couldn't override EVENT_TYPE_AREALOAD_PRELOADEXIT. It only goes to area scripts. Thanks.