ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Dumping game_vertex_id/level_vertex_id?

1 2 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  06:31:55  4 October 2007
profilee-mailreply Message URLTo the Top
silverpower
short-haired anarchist hippy scum
(Resident)

 

 
On forum: 08/26/2007
Messages: 790
Dumping game_vertex_id/level_vertex_id?

I know that obtaining the actor's current game/level vertex ID is possible through a script, but not how to dump it somewhere I can record it (like a screenshot or to the log).

This is part of the data I need in order to successfully build a level_changer, hence the question. (I know that Freeplay adds most of the level_changers I want, but I'd rather do it myself.)
  08:38:04  4 October 2007
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4297
Wow, it seems like every entity in the all.spawn file has these identifiers.

I can see a couple of ways offhand of doing this. One is via the dbglog() call (in bardak's _g.script) with the parameters as %s arguments in the varargs (printf() style) string. That will put it in the log file.

You could also output it with a news_manager tip, triggered off a timer in actor_binder:update() in bind_stalker.script. Or better still (and knowing you, you've already figured this out), re-use or create a CustomStatic in that same routine, and update it every second or so to reduce the processing hit.

Look at the text example for obtaining the "main_task" CustomStatic from the hud object in news_manager.script, track down the XML definition for its particulars, then clone it or co-opt another and tuck it into a nice corner, like the upper right. Cool debug tool. Or a way to have the time on the display...

GB Shaw noted that the reasonable [person] conforms and adjusts to his surroundings, while the unreasonable [one] seeks to adapt his surroundings to himself. All progress depends upon the unreasonable one. And Terry Pratchett said something like this: Give a man a fire, and he's warm for a day. Set fire to him, and he's warm for the rest of his life.

There is a severe shortage of appropriate smilies on this forum...
  09:10:48  4 October 2007
profilee-mailreply Message URLTo the Top
silverpower
short-haired anarchist hippy scum
(Resident)

 

 
On forum: 08/26/2007
Messages: 790
Wow, thanks!

I didn't know/remember a lot of this, but your post gave me enough hints to start exploring my options. Perhaps between this method and the Stalker keyhook program I found, I can make all sorts of interesting things...
  09:47:52  4 October 2007
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4297
Here's a crude example of what I was talking about, showing the position of the player (something you might want in placing your level changers)

[link]http://img251.imageshack.us/img251/7706/ss100407033957l03agroprll1.jpg[/link]

I got that with this:

In gamedata\config\ui\ui_custom_msgs.xml, after the <main_task> entry, I have this:
_________________
    <debug_task  x="800" y="10" width="200" height="30" complex_mode="1">
        <text align="c" font="graffiti32"  r="240" g="217" b="182" a="255"/>
    </debug_task>

_________________
In gamedata\scripts\bind_stalker.script, in the function actor_binder:update(delta), I do this:
_________________
    if self.next_restrictors_update_time < time then
        bind_restrictor.actor_update(delta)

        self.next_restrictors_update_time = time + 200

        -- nv 070922 comment out for no auto-quests
        task_manager.actor_update()

        -- debug output
        local hud = get_hud()
        local custom_static = hud:GetCustomStatic("debug_task" )
        if custom_static == nil then
            hud:AddCustomStatic("debug_task", true)
            custom_static = hud:GetCustomStatic("debug_task" )
        end
        local myPos = tostring(db.actor[b]:[/b]position().x)..", "..
            tostring(db.actor[b]:[/b]position().y)..", "..
            tostring(db.actor[b]:[/b]position().z)
        custom_static[b]:[/b]wnd()[b]:[/b]SetText(myPos)
    end

_________________
Earlier in the script, at the beginning of function actor_binder:net_destroy() I remove the custom static:
_________________
    local hud = get_hud()
    local custom_static = hud:GetCustomStatic("debug_task" )
    if custom_static ~= nil then
        hud:RemoveCustomStatic("debug_task" )
    end

_________________
Just add direction and anything else you want. You can change color, too. Be sure what you output is valid; I'm assuming that db.actor is okay here.

What an obstacle course this forum is, just to post some simple code.
  11:04:42  4 October 2007
profilee-mailreply Message URLTo the Top
silverpower
short-haired anarchist hippy scum
(Resident)

 

 
On forum: 08/26/2007
Messages: 790
Thanks, this should get me going quite nicely.

And yeah, db.actor should be valid, because if it isn't, something's *really* wrong!
  11:48:50  4 October 2007
profilee-mailreply Message URLTo the Top
DC-
Senior Resident
 

 
On forum: 07/04/2007
Messages: 451
Could one of you guys please explain to me, what the vertex id's actually are?
  12:03:40  4 October 2007
profilee-mailreply Message URLTo the Top
silverpower
short-haired anarchist hippy scum
(Resident)

 

 
On forum: 08/26/2007
 

Message edited by:
silverpower
10/04/2007 12:04:23
Messages: 790

---QUOTATION---
Could one of you guys please explain to me, what the vertex id's actually are?
---END QUOTATION---



From what I understand, it's one of two things - the closest vertex of the CFORM you're playing on - or a node on the level graph. I think it's the former. The entire level's basically a huge Maya scene, remember?
  05:01:19  8 October 2007
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4297
Something silverpower has probably already done, but others might be interested in this: To turn the on-screen debug info on and off, add a global boolean flag (nv_debug = false) to the top of bind_stalker.script, then test for it to determine whether to output the debug info. (Requires the other stuff in the earlier post.)
____________
    if self.next_restrictors_update_time < time then
        bind_restrictor.actor_update(delta)

        self.next_restrictors_update_time = time + 200

        -- nv 070922 comment out for no auto-quests
        task_manager.actor_update()

        if nv_debug then
            -- debug output
            local hud = get_hud()
            local custom_static = hud:GetCustomStatic("debug_task"[i][/i])
            if custom_static == nil then
                hud:AddCustomStatic("debug_task", true)
                custom_static = hud:GetCustomStatic("debug_task"[i][/i])
            end
            local myPos = tostring(db.actor:[i][/i]position().x)..", "..
                tostring(db.actor:[i][/i]position().y)..", "..
                tostring(db.actor:[i][/i]position().z)
            custom_static:wnd():SetText(myPos)
        end
    end

____________
In ui_main_menu.script, I added this to the function main_menu:OnKeyboard():
____________
    if dik == DIK_keys.DIK_D then
        bind_stalker.nv_debug = not bind_stalker.nv_debug
        if bind_stalker.nv_debug == false then
            -- turn off any existing display
            local hud = get_hud()
            local custom_static = hud:GetCustomStatic("debug_task"[i][/i])
            if custom_static ~= nil then
                hud:RemoveCustomStatic("debug_task"[i][/i])
            end
        end
    end

____________
This is a toggle to turn on/off the debug display. It is only accessible from the main menu. In game, one would press ESC, then D, then ESC again to return to the game.

This is not the "D" used in the game to move by default to the right.
  12:12:27  8 October 2007
profilee-mailreply Message URLTo the Top
dezodor
level designer
(Resident)

 

 
On forum: 04/08/2007
Messages: 3803
a little bit offtopic, but: to add levelchangers we need the level_vertex_id ... and its okay, but if we'd like to add a lc to a muliplayer map, because its possible, but we nedd to find out that level's id... any idea if its possible?
  12:52:39  8 October 2007
profilee-mailreply Message URLTo the Top
silverpower
short-haired anarchist hippy scum
(Resident)

 

 
On forum: 08/26/2007
Messages: 790

---QUOTATION---
a little bit offtopic, but: to add levelchangers we need the level_vertex_id ... and its okay, but if we'd like to add a lc to a muliplayer map, because its possible, but we nedd to find out that level's id... any idea if its possible?
---END QUOTATION---



That reminds me - how *do* you add a level_changer? As I understand it, I need three things - a level_changer with source and destination direction/position/game vertex ID/level vertex ID, a space_restrictor at the destination, and a waypoint for rejecting level changes. Am I correct, or is there another piece of the puzzle (or do I *just* need the level_changer)?

Also, without a graph builder, there isn't going to be any way to get a new level into SP. The Russians have partially reverse-engineered the game.graph (if I understand one of their wikis correctly), but there's not yet a tool to build the graph or work with it, or work with the other resources needed to have NPCs in a level.
 
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-2021 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.