ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
I just need to find a way to track 'section_name' to the map tracker

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  03:49:19  26 January 2019
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1071
I just need to find a way to track 'section_name' to the map tracker


function mark_var_in_map (actor, npc, p)

 if npc then

 local origin_mark_var_in_map = npc:name()

  if p and p[1] then

  local var = p[1]

   local actor = db.actor


   for all_items = 1,65534 do
      local list_pos_drop = level.object_by_id(all_items)


        if list_pos_drop then -- and list_pos_drop:alive() then


        local list_pos_drop_name = list_pos_drop:name()
        local list_pos_drop_id = list_pos_drop:id()

--[[
get_console():execute("-----")
get_console():execute("list_pos_drop_name="..tostring(list_pos_drop_name))
get_console():execute("list_pos_drop_id="..tostring(list_pos_drop_id))
get_console():execute("-----")
]]--

        local item_to_mark_name = list_pos_drop:name()
          local item_to_mark_id = list_pos_drop:id()

             if item_to_mark_name and item_to_mark_id and string.find(list_pos_drop_name, var) then

local distance = distance_between(list_pos_drop, actor)

get_console():execute("-----")
get_console():execute("varOrigin="..tostring(origin_mark_var_in_map))
get_console():execute("varName="..tostring(list_pos_drop_name))
get_console():execute("varID="..tostring(list_pos_drop_id))
get_console():execute("varDistToActor="..tostring(distance))
get_console():execute("-----")

   level.map_add_object_spot(item_to_mark_id, "alife_presentation_explosive", "%c[255,254,204,154]" .. "Origin=" .. "%c[255,80,120,255]" .. tostring(origin_mark_var_in_map) .."\\n"
                                                                            .."%c[255,254,204,154]" .. "Name=" .. "%c[255,80,120,255]" .. tostring(item_to_mark_name) .."\\n"
                                                                     .."%c[255,254,204,154]" .. "ID=" .. "%c[255,80,120,255]" .. tostring(item_to_mark_id) .."\\n"
                                                                     .."%c[255,254,204,154]" .. "Distance=" .. "%c[255,80,120,255]" .. tostring(distance) .."\\n"

   )
--
             end
        end

   end
  end
 end
end

  03:50:22  26 January 2019
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1071
In short my function is ok, it tracks variation names like 'val_band', 'heli', 'zone', 'wave', 'monolith', 'af_', etc. It tracks full IDs, and distance to actor. It tracks item in level only but it works. It adds a custom mini dot in map (Olive color). However i need to track 'section_name' too. Function is called by space restrictor or npc logic.

Example:

Smart terrain Logic: on_info3 = %=mark_var_in_map(radioactive_ave)%. This way i get all the 'pri_zone_radioactive_average_' variations once in pripyat level in this case. But i need to track the 'section_name'... to get something like 'zone_radioactive_average'.

So, any ideas?

Thanks In Advance.
  08:09:39  28 January 2019
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
 

Message edited by:
NatVac
01/28/2019 8:11:34
Messages: 4255
Use list_pos_drop:section_name(), perhaps? If you can't get the section_name() from a client object, you can get the server object for it from alife():object(client_object_id), something like:

    alife():object(list_pos_drop_id):section_name()

where list_pos_drop_id is already defined as list_pos_drop:id() in your code.

As for only current-level items, you are using the singleton instance of the level class to return only the online items via level.object_by_id() function. That's really all you need for what you are trying to do.

You are also duplicating your effort -- list_pos_drop_name is the same as item_to_mark_name, and list_pos_drop_id is the same as item_to_mark_id. It's okay, other than adding extra work to the processing of the iterative loop.
  00:26:23  31 January 2019
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1071



[link]https://imgur.com/a/5JGmi9s[/link]

---QUOTATION---


For Console:

get_console():execute("varSection="..tostring(alife():object(list_pos_drop_id):section_name()))

For The Mark:

.."%c[255,254,204,154]" .. "Section=" .. "%c[255,80,120,255]" .. tostring(alife():object(list_pos_drop_id):section_name()) .."\\n"

---END QUOTATION---

I could not get "section" to work, but it works in console and the marker... And That's what i need.

Thanks again Natvac.



  00:53:11  31 January 2019
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1071


Interesting, the marker gets almost invisible in that place. It might have something to do with the same reason i can not teleport npcs from Pripyat as a new smart. The choppers in this area are also impossible to track. A fix for this feature would be awesome...

Remember Wolf? And The 7 rookies?

[link]

https://imgur.com/a/iXllBXe

[/link]

But, all npcs get stuck and they can't enter stancia 1. Too bad, but i plan  to return them to rookie camp anyways once in freeplay. Maybe I add fanatic on the deadzone... maybe in fake sidorovich bunker... (Marked one, come here ... we need to talk). BOOM!!! I kinda F.... hate the Bastard. Gonna call it 'Fanatic Dinamit Event'.


 
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-2019 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.