ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
Finding out what artifacts are on the actors belt

1 2 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  05:43:18  21 January 2011
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340
Finding out what artifacts are on the actors belt

Title says it all. How do I go about doing this?
I remember someone once said this was done in SoC, so I was wondering if it works in CS, and if it does, if someone has a link to the mod/code.
  10:14:15  21 January 2011
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
im confused to what your after.
  14:07:47  21 January 2011
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
01/21/2011 14:10:30
Messages: 1072
I think Fluffy22 is looking for a way to check if an artifact is attached to the belt or not. I've messed around with code detecting a specific item on the belt...


function check_backpack()
  if belt["backpack"]~=nil and belt["backpack"]>0 then
    return true
  else
    return false
  end
end

function check_backpackempty()
  if belt["backpack"]==nil then
    return true
  else
    return false
  end
end



It might be something along these lines, just with an artifact. It's only basic, and for something that didn't work in the end. However, it did appear to detect a particular item on the belt (more than likely I might have made an error where part of my other scripting didn't properly account for the item being taken off the belt). I'd bet my work above could do with a lot of improvement, so just take it as a base to possibly build off of or give you ideas. Plus it was for SOC, so...
  17:31:58  21 January 2011
profilee-mailreply Message URLTo the Top
mnn
Senior Resident
 

 
On forum: 06/12/2009
Messages: 2694
Why on earth would think there's some kind of global belt table?

Most likely this is not possible. db.actor:item_in_slot() might not be helpful, because artifact slots are separate than item/weapon slots.
  00:44:19  22 January 2011
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340
Would it be possible to use a combination of code to check if the actor has a particular item with them using actor bject(...), and iterate through the inventory using db.actor:iterate_inventory(..., ...) and see if it is there, or do those commands do the same thing?
  01:40:29  22 January 2011
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
01/22/2011 1:40:55
Messages: 1072
Well, my script worked in part. But I think there was an issue about removing the item, and the game never figuring that part out (effects continued, and then multiplied). It's from the inventory.script, like in the AMK mod.
  01:59:39  22 January 2011
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971

---QUOTATION---
I think Fluffy22 is looking for a way to check if an artifact is attached to the belt or not. .
---END QUOTATION---



sorry to be rude, im still thrown of, dont you go into your invetory screen and see?????

im totally lost. lol
  02:34:33  22 January 2011
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340
I want to find out what artifacts are on the belt via scripts, and get the artifact's section and read data from the corresponding section in the ltx config.
  02:48:38  22 January 2011
profilee-mailreply Message URLTo the Top
mnn
Senior Resident
 

 
On forum: 06/12/2009
 

Message edited by:
mnn
01/22/2011 2:51:42
Messages: 2694

---QUOTATION---
Would it be possible to use a combination of code to check if the actor has a particular item with them using actor bject(...), and iterate through the inventory using db.actor:iterate_inventory(..., ...) and see if it is there, or do those commands do the same thing?
---END QUOTATION---


actor:object(...)

This just finds out if actor (or NPC, too) has given object (e.g. section name) and returns first matching.

db.actor:iterate_inventory(..., ...) - requires callback function, and it's mostly used to get all objects of given section name (or actually you can do anything you want with the object - engine calls callback function with every object actor/NPC has in inventory as argument to the callback function).

So you see there's no way to distinguish between regular items in inventory, artifacts in inventory and artifacts on belt.

Kaidonni: Heh, post entire contents of that script (inventory.script) on pastebin.com and post here the link. I'd like to see that belt table
  03:59:45  22 January 2011
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971

---QUOTATION---
I want to find out what artifacts are on the belt via scripts, and get the artifact's section and read data from the corresponding section in the ltx config.
---END QUOTATION---



haha lol, i was thinking in game. my bad, i know what you mean.
mnn is expert here, il only be throwing in 2c worth.
 
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.