ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
How to add an exception to this function?

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  19:23:13  7 May 2013
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070
How to add an exception to this function?

Hi there,

I have a function in bind_stalker.script to kill all humans, and it works... but i need to add an 'exception by name'. In short i need the exception not to die like all the others.

bind_stalker.script:


---QUOTATION---


local every_human_dies = true
-- IF 'true' ALL Humans die...


---END QUOTATION---



in update function:


---QUOTATION---


if every_human_dies then

for i= 1,65534 do
local die_hum = level.object_by_id(i)
if die_hum and (IsStalker(die_hum)) and die_hum:alive() then
die_hum:kill(die_hum)
end
end

end



---END QUOTATION---




So now, i just need to add somehow the name 'this_is_my_npc_name_in_all_spawn'... but how can i do this?


Thanks in advance.
  22:21:18  7 May 2013
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
 

Message edited by:
Vintar
05/07/2013 22:22:42
Messages: 6349

if every_human_dies then
	for i= 1,65534 do
		local die_hum = level.object_by_id(i)
		if die_hum and (IsStalker(die_hum)) and die_hum:alive() and die_hum:name() ~= "my_dudes_name" then
			die_hum:kill(die_hum)
		end
	end
end

  04:09:37  8 May 2013
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070

---QUOTATION---

if every_human_dies then
	for i= 1,65534 do
		local die_hum = level.object_by_id(i)
		if die_hum and (IsStalker(die_hum)) and die_hum:alive() and die_hum:name() ~= "my_dudes_name" then
			die_hum:kill(die_hum)
		end
	end
end


---END QUOTATION---




Thank you Vintar. It works very well. Thanks again.
 
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-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.