Online and offline alife

From Mod Wiki

Jump to: navigation, search

Hi there, this is not a real entry but an link to a conversation on the GSC Forum. Barin has written interessting stuff about this topic. Here are some sentences:

To understand how it works, first you need to know that in stalker there are two types of entities: either something is on-line or off-line. If it is on-line (somewhere around actor, not further then alife radius), then it is controlled by so called object_binder or any class derived from object_binder (bind_*.script; for npcs - xr_motivator.script). There you can save data using save() method and load via load() method, however, data saved in binder will be lost if you change level (because such data is no more needed, like for instance what doors npcs opened - not needed since you are on a completely different level then that npc is).

Finally, no matter if object is on- or off-line, it is controlled by its server class (se_*.script). This class remembers all data you save, so that's what you are after. In short, first you need to define your own variable (pda_spawned) in constructor (in this case: se_stalker::__ini()). Then to access this property, you first need to get off-line object (instance of this class):

alife():object(npc:id())


will return pointer to object of se_stalker class.- quote Barin

Link to the whole conversation: Saving unique npc:id() as script info

And some more info´s and just another conversation:retrieving online instance of object

Personal tools