collapse

* Notice

Important notice (31 July): We have recently recovered from a nearly two day downtime due to an attack. No data was lost or stolen but the server has been reinstalled as a precaution. Please let us know if you encounter any issues. We apologise for the unacceptable inconvenience. Please read here for more information.

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: [Tool] ZVTool  (Read 10022 times)

Offline [archive] Signothorn

  • Antediluvian
  • *****
  • Posts: 3472
  • Reputation: +0/-0
Re: [Tool] ZVTool
« on: April 07, 2008, 06:51:00 am »
                Here I go again...
 
 As anyone who's tried to do any serious Bloodlines "mapping" knows, we're pretty severely constrained in this regard. Without access to the Bloodlines-compatible version of Hammer, we're limited to using VPKTool to skim off the plaintext entity descriptions, tweaking them, slapping them back in, then firing up Bloodlines to check our results. Repeat several dozen times to accomplish anything nontrivial.
 
 So this weekend I hacked out an alternate approach-- a big pile of Python script that implements functionality for manipulating objects in-game. It's still a little rough around the edges, but it's far enough along that I figured I could toss it out to the community for feedback.
 
 So, here's ZVTOOL version 0.1 stealth double-secret alpha release:
 <a target="boardLink" href="http://home.att.net/~clay.h/bloodlines/ztools_v01.zip" <a class="BoardRowBLink" href="http://home.att.net/~clay.h/bloodlines/ztools_v01.zip">http://home.att.net/~clay.h/bloodlines/ztools_v01.zip</a> </a>
 
 To install:
 1. Copy zvtool.py into Vampire\python\
 2. Add the line "from zvtool import *" to vamputil.py
 
 Since all the code is in an external file, all you have to do when installing or updating a patch that changes vamputil.py is re-add the import line.
 
 To use this, you'll need the console enabled (add "-console" to the launch shortcut). The way it works is by defining a whole lot of functions that you type from the console, which affect the game world in various ways. Here's the list of what's currently available:
 <blockquote class="BoardBlockquoteTag">znear() - List entities near to player; zn() for short
 zlist() - Repeat last znear() list
 zgrab() - Grab entity by znear() number or targetname
 zpos() - Player position & angle
 zorg(x, y, z) - Set grabee origin
 zx(n), zy(n), zz(n) - Set grabee X/Y/Z origin
 zix(n), ziy(n), ziz(n) - Increment grabee X/Y/Z origin
 zang(p, w, r) - Set grabee angles
 zp(n), zw(n), zr(n) - Set grabee pitch/yaw/roll angle
 zip(n), ziw(n), zir(n) - Increment grabee pitch/yaw/roll angle
 zhide(), zunhide() - Hide/Unhide grabee
 zmark(), zunmark() - Mark/Unmark grabee
 zinf() - Grabee info
 zspawn(class, model) - Spawn new entity of class name, model filename
 zhate(), zlove(), zkill() - Make all AIs hate you, love you, and dead, respectively
 zbuff() - Max stats and inventory
 zhelp() - Display this list</blockquote>
 This isn't nearly as horribly overwhelming as it looks. The way it works is this--
 While in-game and near to something you want to manipulate, bring up the console and type:
 znear()
 This will list the 15 entities nearest to you, sorted by distance. Note that each line has a number at the beginning. Say you want to work with the first item on the list. You'd type:
 zgrab(1)
 The purpose to the numbering system is that (besides requiring less typing), it lets you manipulate entities that don't have a targetname. You can also use a targetname-- zgrab("room_key"), or whatever.
 
 Anyway, you've now "grabbed" an entity. This is henceforth referred to as the "grabee", for lack of a better and less stupid-sounding term. Most of the functions listed above are for manipulating grabbed entities. zorg() and zang() let you specify an origin and angles directly. zz(), zr(), etc let you set an individual coordinate or angle. But what will probably get the most use are the increment functions. Say you want to rotate an object until it's facing just the right direction. You'd grab it, then type:
 ziw(5)
 This is the function to increment the yaw angle (I used W for yaw because Y was already taken for Y-coordinates). Once you've typed this, you can just repeatedly hit up-arrow, Enter, and every time you'll see the object update in realtime to the new heading. Once you're done, type:
 zinf()
 This will display some information about the object, pre-formatted for copying and pasting directly into the big map text file for VPKTool. Just select what you need in the console window and hit Ctrl-C to copy it. Using these commands, you can accomplish in only a couple minutes what used to take the better part of an hour. Like <a target="boardLink" href="http://img519.imageshack.us/my.php?image=smpawnshop10000vo9.jpg">this charming little Malkavarian tableau</a>.
 
 Now some other random stuff--
 zlist() will display the same list that you got the last time you typed znear(), in case you want to refer back to the list but have moved since then.
 znear() can also be typed as zn().
 znear() accepts a class filter. For example, znear("npc*") would only list NPCs (the asterisk at the end is treated as a wildcard character).
 zmark() will add inspection sparkles to the current grabee. This is essential for working with invisible objects like triggers or sound emitters. zunmark() gets rid of the sparkles.
 zmark() and zunmark() also accept class filters. Typing zmark("trigger*") would highlight every trigger on the map.
 zhide() and zunhide() work the same way as zmark()/zunmark(). They default to affecting the grabee, but can act on anything/everything. Try going into the Santa Monica haven and typing zunhide("npc*"). Yikes! And then zhide("*") to give the place that nice freshly-robbed look.
 
 Remember that any text should always be in quotes when passed to a function, and that lists of numbers should always be separated by commas, not spaces.
 
 There will often be a few characters of scrambled text at the bottom of znear()'s output. This seems to be a bug with printing large quantities of text all at once. Nothing I can do about it.
 
 Sometimes znear() will list entities that are actually in the player's inventory. ztools tries to filter these out, but the detection method fails occasionally. Haven't figured out why yet. Anyway, it doesn't hurt anything.
 
 When messing around in the console, remember that if you screw up and cause the game to freeze (and you will, eventually. everyone does.), you can almost always unfreeze the game by bringing up the inventory or quest log screens.
 
 EDIT: version 0.2 available. Scroll down for the post announcing it.                        <p> </p>-----signature-----<div id="ctl00_ctl00_cphMain_cphMain_ccSkin_ctl00_ucBoardTopicView_ccSkin_ctl00_rptMessages_ctl00_ucMessageView_ccSkin_ctl00_ucBoardSignature_lnlSignatureText" class="SignatureText">           ZylonBane's opinions do not represent those of the management.
    </div>                                                    
« Last Edit: January 24, 2011, 03:45:50 pm by Wesp5 »

Offline [archive] Wesp5

  • Antediluvian
  • *****
  • Posts: 2767
  • Reputation: +0/-0
Re: [Tool] ZVTool
« Reply #1 on: April 07, 2008, 07:20:00 am »
               
ZylonBane posted:

 So this weekend I hacked out an alternate approach-- a big pile of Python script that implements functionality for manipulating objects in-game.

 
 Where was this when I fixed all those floating objects and stuff wink ? Honestly, thanks for the effort and while it's probably a little too late for single player mapping, maybe some people out there could use this to turn some of the single player maps into cool and working multiplayer maps!                        

 

                                                  

Offline [archive] ZylonBane

  • Methuselah
  • ****
  • Posts: 465
  • Reputation: +0/-0
Re: [Tool] ZVTool
« Reply #2 on: April 07, 2008, 11:10:00 am »
                Hey, you've still got an empty Giovanni mansion to fill up!                        

 

-----signature-----
           ZylonBane's opinions do not represent those of the management.
   
                                                  

Offline [archive] MooCHa2

  • Antediluvian
  • *****
  • Posts: 3209
  • Reputation: +0/-0
Re: [Tool] ZVTool
« Reply #3 on: April 07, 2008, 11:15:00 am »
                I will certainly look at this when I have time to play around. I stuck it in my tools archive on hdd so that it doesn't disappear over time.
 
 Regards...                        

 

                                                  

Offline [archive] Offkorn

  • Antediluvian
  • *****
  • Posts: 5024
  • Reputation: +1/-1
Re: [Tool] ZVTool
« Reply #4 on: April 07, 2008, 11:24:00 am »
                Perhaps I'm missing something obvious...but how exactly does this save the changes to the map file?                        

 

-----signature-----
           Nemo non Morior
 Anime Overviews
 Kindred of the oWoD
 MP3 Player Playlist
   
                                                  

Offline [archive] ZylonBane

  • Methuselah
  • ****
  • Posts: 465
  • Reputation: +0/-0
Re: [Tool] ZVTool
« Reply #5 on: April 07, 2008, 01:12:00 pm »
                It doesn't. The idea is that you position an object in-game until it's exactly right, copy the origin/angles data, then paste that into the map text file and go through the usual VPKTool process of updating it. The advantage is that it'll be exactly right the first time, instead of having to go through many iterations of this process, guessing your way toward something that looks good enough.
 
 The other big gain, thanks to the znear() function, is that it lets you identify which of dozens of identical entities is the one you want to adjust. For example, say you've got a level packed full of torches, but one of them has the particle emitter misaligned. Just looking at the BSP dump would be hopeless... hundreds of lines of identical unnamed particle emitter definitions, differing only by their coordinates. With ztool, you'd just walk up to the one you want in-game, zgrab it, zinfo it, and write down the coordinates. Then a simple text search would yield the correct definition to apply the updated data to.
 
 Oh crap, that reminds me-- the current version rounds all coordinate and angle displays to the nearest hundredth. I'll have to change zinfo() to display precise coordinates.                        

 

-----signature-----
           ZylonBane's opinions do not represent those of the management.
   
                                                  

Offline [archive] Dark666Prophet

  • Antediluvian
  • *****
  • Posts: 2209
  • Reputation: +0/-0
Re: [Tool] ZVTool
« Reply #6 on: April 07, 2008, 06:52:00 pm »
               
posted:

 It doesn't. The idea is that you position an object in-game until it's exactly right, copy the origin/angles data, then paste that into the map text file and go through the usual VPKTool process of updating it.
 

 
 Wait, so you're saying that you get to change the map from within the game rather than outside of it? That's amazing if that's the case.                        

 

                                                  

Offline [archive] ZylonBane

  • Methuselah
  • ****
  • Posts: 465
  • Reputation: +0/-0
Re: [Tool] ZVTool
« Reply #7 on: April 07, 2008, 07:08:00 pm »
               
Dark666Prophet posted:
Wait, so you're saying that you get to change the map from within the game rather than outside of it?

 Yes, albeit not permanently. You still have to copy the changes you've made and manually apply them to the map file. This just lets you preview changes "live" as opposed to sitting there with a calculator trying to figure out what you need to punch in to get the desired placement.                        

 

-----signature-----
           ZylonBane's opinions do not represent those of the management.
   
                                                  

Offline [archive] ZylonBane

  • Methuselah
  • ****
  • Posts: 465
  • Reputation: +0/-0
Re: [Tool] ZVTool
« Reply #8 on: April 09, 2008, 02:57:00 am »
                Updated version available--
 http://home.att.net/~clay.h/bloodlines/ztools_v02.zip
 
 Adds zhere() to center grabbed entity on player, ztaxi() to unlock all taxi destinations, zammo() to refill all ammo, and various minor fixes.                        

 

-----signature-----
           ZylonBane's opinions do not represent those of the management.
   
                                                  

Offline [archive] Dark666Prophet

  • Antediluvian
  • *****
  • Posts: 2209
  • Reputation: +0/-0
Re: [Tool] ZVTool
« Reply #9 on: April 09, 2008, 04:35:00 am »
                Oh, cool. Would this in any way allow for cut scene changes? I'm not sure what the limitations are that prevent fixing things like the PC running sideways to Nines at Griffith Park, but if this could help, that would be spiffy.                        

 

                                                  

Offline [archive] Wesp5

  • Antediluvian
  • *****
  • Posts: 2767
  • Reputation: +0/-0
Re: [Tool] ZVTool
« Reply #10 on: April 09, 2008, 05:55:00 am »
               
ZylonBane posted:
Updated version available--
 http://home.att.net/~clay.h/bloodlines/ztools_v02.zip
 
 Adds zhere() to center grabbed entity on player, ztaxi() to unlock all taxi destinations, zammo() to refill all ammo, and various minor fixes.

 
 I think you should include a short readme explaining all the commands and what they do with the file. Otherwise we will need to look through this thread all the time...                        

 

                                                  

Offline [archive] ZylonBane

  • Methuselah
  • ****
  • Posts: 465
  • Reputation: +0/-0
Re: [Tool] ZVTool
« Reply #11 on: April 09, 2008, 01:09:00 pm »
                Oh, absolutely. This is more of a work-in-progress thread. I'll write up some proper documentation when the whole thing is in a more stable state. In the meantime, zhelp() will list all the currently supported commands.
 
 By the way, you'll be interested to know that I finally figured out how to access the name of the currently loaded map. It's stored in __main__.cvar.host_map. In fact, you can use the __main__.cvar class to access all the cvars.                        

 

-----signature-----
           ZylonBane's opinions do not represent those of the management.
   
                                                  

Offline [archive] Wesp5

  • Antediluvian
  • *****
  • Posts: 2767
  • Reputation: +0/-0
Re: [Tool] ZVTool
« Reply #12 on: April 14, 2008, 12:28:00 pm »
               
ZylonBane posted:
Oh, absolutely. This is more of a work-in-progress thread. I'll write up some proper documentation when the whole thing is in a more stable state. In the meantime, zhelp() will list all the currently supported commands.

 
 I figured zhelp out myself in the meantime but didn't use your tools much besides znear which is very helpful indeed. Would you mind if I included it with the patch so I won't have to change the main python file? I'll give you credit of course...                        

 

                                                  

Offline [archive] ZylonBane

  • Methuselah
  • ****
  • Posts: 465
  • Reputation: +0/-0
Re: [Tool] ZVTool
« Reply #13 on: April 14, 2008, 07:07:00 pm »
                I'd prefer that you not include it with anything just yet. It's still in a very preliminary state.
 
 A bit off-topic, I had a question for you. The custom BSPs that you include in your patch, are they modified using VPKTool only? Or is there other modification too?                        

 

-----signature-----
           ZylonBane's opinions do not represent those of the management.
   
                                                  

Offline [archive] Offkorn

  • Antediluvian
  • *****
  • Posts: 5024
  • Reputation: +1/-1
Re: [Tool] ZVTool
« Reply #14 on: April 14, 2008, 07:23:00 pm »
                There's a separate BSP editor. He includes it with the UP itself.
 
                       

 

-----signature-----
           Nemo non Morior
 Anime Overviews
 Kindred of the oWoD
 MP3 Player Playlist
   
                                                  

 

SimplePortal 2.3.7 © 2008-2020, SimplePortal