A little mod for taking screenshots

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

A little mod for taking screenshots

Post by Eraser »

I've made a really small mod that I just needed myself. I thought I'd share, because it could be useful to others as well.

Here's the little blurb I included as readme:
SetViewPos is a tiny mod that can be used to teleport yourself through a Quake III Arena map. This can be useful for taking comparison screenshots from the exact same location twice.

The mod only changes a few small things:

The existing \setviewpos command is expanded to also include pitch and roll values. It moves the player to the specified location using the specified viewing angles.
Usage: \setviewpos X Y Z YAW PITCH ROLL
Where X, Y and Z refer to the position in the map and YAW, PITCH and ROLL control the viewing angles. All values are required. Note that the default "straight" roll angle is 0.

The \setviewpos command no longer gives you a little nudge forward after using it. The position you specify to teleport to is the exact position you'll end up in.

The mod also adds the \position command, which echoes out your current X, Y, Z and YAW PITCH and ROLL values.

Note that cheats must be enabled to use the \setviewpos command. The command is usable while using \noclip.
The use-case here is that I wanted to compare certain -light settings of q3map2 with other -light settings, but to really see the difference, I actually needed to exactly identical screenshots, only of different builds of the map.

So I wrote this mod with which I can find the position values of a position where I wanted to take the screenshot, write those down, take the screenshot, do another build, teleport back to that position and take the screenshot again.

The result is a great way to compare two builds of the same map. Maybe people have other uses for it as well, dunno. Enjoy.

Download here.
User avatar
Hipshot
Posts: 1547
Joined: Sun Jan 20, 2002 8:00 am

Re: A little mod for taking screenshots

Post by Hipshot »

Thanks. When I did that before, I used to go alt-enter, switch the bsp and then go alt-enter again. The I would get the exact same pos.

This is probably a lot easier.
Q3Map2 2516 -> http://www.zfight.com/misc/files/q3/q3map_2.5.16_win32_x86.zip
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
User avatar
Hipshot
Posts: 1547
Joined: Sun Jan 20, 2002 8:00 am

Re: A little mod for taking screenshots

Post by Hipshot »

Yea, this was great. Thanks. So simple, since the console stores what you typed, you can just keep switching level version and redo the command...
Q3Map2 2516 -> http://www.zfight.com/misc/files/q3/q3map_2.5.16_win32_x86.zip
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Re: A little mod for taking screenshots

Post by Silicone_Milk »

I dig this. Wondering why it's taken a decade for somebody to come up with this.

:up:
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: A little mod for taking screenshots

Post by Eraser »

I did notice that the "roll" value isn't as useful as I'd like it to be. Because they're floating point numbers, they aren't exact. For instance, if you specify a roll of 30, you'll actually end up with a roll of 29,998169, which is seeminly rounded differently by Q3 every time. I took two screenshots using identical values (and a roll of 30) and one was slightly more rolled than the other. But it's still useful as a neat effect for levelshots :)
VolumetricSteve
Posts: 449
Joined: Sat Nov 06, 2010 2:33 am

Re: A little mod for taking screenshots

Post by VolumetricSteve »

What if you specify an arbitrary floating point number just to keep quake3 from playing numberies-funzies by rounding? In other words, if you give it 20.414214 will it hold true to that value?
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: A little mod for taking screenshots

Post by ^misantropia^ »

Q3A performs vector math on the yaw/pitch/roll and that causes the rounding errors.

@Eraser: Try clamping down the player's view angles. The dirty hack approach:

Code: Select all

client->ent->s.angles[0] = atof(va("%.4f", client->ent->s.angles[0]));
client->ent->s.angles[1] = atof(va("%.4f", client->ent->s.angles[1]));
client->ent->s.angles[2] = atof(va("%.4f", client->ent->s.angles[2]));
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: A little mod for taking screenshots

Post by Eraser »

Awesome, that appears to work.
I've made a new build and uploaded to the same location. So download the new version if you already have it downloaded before.
User avatar
monaster
Posts: 532
Joined: Mon Apr 28, 2008 1:52 pm

Re: A little mod for taking screenshots

Post by monaster »

Nice useful tool, thanks!
If you are caught on a golf course during a storm and are afraid of lightning, hold up a 1-iron. Not even God can hit a 1-iron.
-Lee Trevino, golfer who actually has been struck by lightning.
stevec
Posts: 16
Joined: Fri Aug 13, 2010 12:35 am

Re: A little mod for taking screenshots

Post by stevec »

Very cool, I had done something similar for a project I'm working on but with a couple of additions that were inspired from a similar feature the source engine has :

I added a new map entity called misc_devshot that can be given a targetname and pitch/yaw/roll values (or optionally a info_target to point at).
This is combined with a new console command \devscreenshot.
Naked, it will loop through all found 'misc_devshot' entities, position the camera and then save a screenshot with a filename based on the current misc_devshot's targetname (i.e capturearea_01_0002.jpg).
You can also call it using the format \devscreenshot target_name. This only takes a screenshot at the specified misc_devshot entity.

Adding this command to the batch/shortcut you perhaps compile + run maps with allows you to create rather cool animated shorts of different areas in your levels progressing through development. Valve has some excellent examples with Team Fortress 2.
Post Reply