ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Setting condition of an item

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  06:12:56  10 September 2012
profilee-mailreply Message URLTo the Top
ddraig
Senior Resident
 

 
On forum: 06/19/2012
Messages: 158
Setting condition of an item

I want the Marked One to start off with a very broken, busted stalker suit. I've already managed to create the suit itself (basically a novice outfit with the appearance of a stalker suit), and edited the all.spawn so it starts off with you wearing it, but the actual item condition is always full, which I don't think is particularly realistic. Is there any way to set the specific condition to lower than what it is?
  07:42:16  10 September 2012
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070

---QUOTATION---
Setting condition of an item

I want the Marked One to start off with a very broken, busted stalker suit. I've already managed to create the suit itself (basically a novice outfit with the appearance of a stalker suit), and edited the all.spawn so it starts off with you wearing it, but the actual item condition is always full, which I don't think is particularly realistic. Is there any way to set the specific condition to lower than what it is?
---END QUOTATION---




You can use a trick like in stalker cop:



---QUOTATION---


function damage_actor_items_on_start(actor, npc)
local actor = db.actor

local obj = actor bject("helm_respirator"
if obj ~= nil then
obj:set_condition(0.8)
end

obj = actor bject("stalker_outfit"
if obj ~= nil then
obj:set_condition(0.76)
end

obj = actor bject("wpn_pm_actor"
if obj ~= nil then
obj:set_condition(0.9)
end

obj = actor bject("wpn_ak74u"
if obj ~= nil then
obj:set_condition(0.7)
end

end


---END QUOTATION---




So for now lets imagine the item has the name ... 'whatever',right?

Put this code in xr_effects:



---QUOTATION---


function test_damage(actor, npc)
local actor = db.actor

local obj = actor bject("whatever"
if obj ~= nil then
obj:set_condition(0.8)
end
end



---END QUOTATION---



Important... 0.8 in this case represents 80%... so change the value as you like. This trick as some advantages for cheating... eventually. If you take a very damaged 'whatever' item from the ground ... like 10%... you just need to call the function again... and zap... 80% lol. Because the function does not call damage, it just sets a condition value.


Now we just need to execute the function 'test_damage' somewhere...

We could call the function in bind stalker.script, but my advise use this instead:

config\gameplay\info_l01_escape.xml:


---QUOTATION---

<info_portion id="esc_kill_gunslinger">
<task>storyline_eliminate_gunslinger</task>
<action>xr_effects.test_damage</action>
<article>about_enciclopedia</article>
<article>sl_beginning</article>
</info_portion>

---END QUOTATION---



That's it, but i didn't test it.

Ok, scratch that... i just tested with 'novice_outfit' and it works.

Have fun.
  09:17:34  11 September 2012
profilee-mailreply Message URLTo the Top
ThunderFreak
Senior Resident
 

 
On forum: 08/07/2009
Messages: 685
Afaik you can use this for named Stalkers or for tasks only.
If you want to have condition set on dropped weapons or items, when dropped on death, it is a little bit different.
  23:29:04  11 September 2012
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070

---QUOTATION---
Afaik you can use this for named Stalkers or for tasks only.
If you want to have condition set on dropped weapons or items, when dropped on death, it is a little bit different.
---END QUOTATION---




It works... i tested it.
 
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.