ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
Spawned NPC id

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  14:23:10  19 December 2010
profilee-mailreply Message URLTo the Top
Dielos
(Novice)
 
On forum: 05/06/2007
Messages: 21
Spawned NPC id

Hello again,

I'm having trouble getting the id of a spawned NPC. It doesn't seem to work like in the tutorial on the wiki (it's for SoC only?). I'm not sure if maybe he spawns in offline mode, even if he appears right in front of me?

I'm testing trying to add an object to his inventory. This is the code:


dnpc = alife():create("d_npc",a,45868,569)
alife():create("val_quest_scope_x8",
dnpc osition(),
dnpc:level_vertex_id(),
dnpc:game_vertex_id(),
dnpc:id())


It gives me an error of value in global variable = "nil". It works if I place it in my own inventory with db.actor.

What is the correct way of retrieving the id of a spawned npc?

Thanks!
  14:34:10  19 December 2010
profilee-mailreply Message URLTo the Top
mnn
Senior Resident
 

 
On forum: 06/12/2009
 

Message edited by:
mnn
12/19/2010 14:36:36
Messages: 2694
Is d_npc defined somewhere in configs?

alife():create() returns server object, and server object has properties unlike client object which has simple functions for retrieving stuff like position, gvid, lvid.


dnpc = alife():create("d_npc",a,45868,569)
alife():create("val_quest_scope_x8",
dnpc.position,
dnpc.m_level_vertex_id,
dnpc.m_game_vertex_id,
dnpc.id)


And next time use pre tag for any code.

Edit: Read this piece of information on online/offline...
http://sdk.stalker-game.com/en/index.php?title=Online_and_offline_alife

Also I suggest looking into lua_help.script when interacting with engine objects for their definitions...
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2020 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.