ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
release NPC

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  11:37:00  6 April 2016
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
 

Message edited by:
The Xenus
04/06/2016 11:37:31
Messages: 144
release NPC

Hi,
i need help with this release function. After i get the right info portion, the npc should be removed. But he isnt removed.

Whats wrong with the release code ?

This is the release function:

function delete_npc()
  local se_obj = alife():object("addon_npc")
if has_alife_info("task_1_done") then
  if se_obj then
    alife():release(se_obj, true)
  end
end
end



This is the spawn function:

function add_npc_spawn()
local obj=amk.spawn_item("addon_npc",vector():set(-213.27,-23.18,-122.93),59,39931)
	if (_g.IsStalker(obj)) then
		local tbl = amk.read_stalker_params(obj)
		tbl.sid = 99001
		tbl.health = 1
		tbl.updhealth = 1
		amk.write_stalker_params(tbl, obj)
end					
end

  16:22:41  7 April 2016
profilee-mailreply Message URLTo the Top
777Wlad
(Novice)
 
On forum: 08/29/2008
Messages: 4

---QUOTATION---


Whats wrong with the release code ?


---END QUOTATION---



First, you need to get the serverside id of npc.

Use amk.remove_item function, for example.
  13:04:30  10 April 2016
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
 

Message edited by:
The Xenus
04/10/2016 13:04:51
Messages: 144

---QUOTATION---


Whats wrong with the release code ?



First, you need to get the serverside id of npc.

Use amk.remove_item function, for example.
---END QUOTATION---



Hope i understand it right:


function remove_addon_npc()
local npc = alife():story_object(99001)
if npc then
amk.remove_item(npc)
amk.send_tip(game.translate_string("NPC REMOVE"),nil,nil,30,"wolf")
end
end



But it doesnt work
 
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.: Shadow of Chernobyl Forum » Mod discussion
 

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


 

Copyright © 1995-2022 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.