Triggering console commands

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
User avatar
GONNAFISTYA
Posts: 13369
Joined: Sun Jan 23, 2005 8:20 pm

Triggering console commands

Post by GONNAFISTYA »

Howdy folks.

Does anyone here know if it's possible to trigger a map load with an applied script for Q3?
Basically, what I mean here is can I set up an event that loads a new map? Is there a way to get the game to execute something like "/map nextsection" when I step into a trigger?

I'm trying to set up some sort of level loading progression for a single-player mission.

Thanks for any info.

P.S. I realize I might have to create a mod that does this but does anyone know where I can look to find this stuff? Has anyone tried this before or has a specific script I could use to pull this off? I've been out of the Q3 loop for quite some time and don't know if any new functionality has been tweaked out by the community.

I've noticed in some third party compilers that you can launch the game (and your specific map) after compiling. I'm not too concerned with relaunching the Q3 game (since it loads so fast on today's machines) so even going that route would be an option I'd consider if someone knew how I could do it from a trigger.
a13n
Posts: 1672
Joined: Thu Feb 10, 2005 2:08 am

Re: Triggering console commands

Post by a13n »

I guess 3w portal map vote map is doing this.
digibob
Posts: 14
Joined: Tue Feb 15, 2000 8:00 am

Re: Triggering console commands

Post by digibob »

Don't think there's any way you're gonna do that without some form of mod.

Abusing the nextMap cvar looks about the simplest way of doing it, but I can't think of any way to set that from a level.

I'm a little out of the loop too though, so I could be wrong ;)
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Triggering console commands

Post by obsidian »

Whoa, digibob... where'd you come from, it's certainly been a while since we've seen you around here? How are things going?



Gonnafistya, Quake III Arena itself doesn't have much by way of triggering level loads from within the level via game entity, for that you'll have to mod the game code in some way.

You could probably do it without a mod via frag limit. See inside baseq3/pak0.pk3/scripts/arenas.txt. It contains the map load queue and the frag limits for each map. You can probably (guessing here) create a game mod with a customized arenas.txt and load each map after a series of frags.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Re: Triggering console commands

Post by Silicone_Milk »

I had made something nearly identical to what you're describing years ago.

I tried looking for the posts but both Q3W and PQ forums purged it and archive.org isn't showing up what I want.

Basically, in a nutshell, I butchered the health items and made them do /exec configfile.cfg instead of giving me health when I touched them. I also stripped the model data so they were invisible.

This let me use the health orbs as triggers in certain areas. The .cfg file held commands like /map mapname

It actually turned out quite terrible.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Triggering console commands

Post by ^misantropia^ »

GONNAFISTYA wrote:P.S. I realize I might have to create a mod that does this
Pretty easy to accomplish. Want a patch? It's probably quicker than trying to explain the how and what.
User avatar
Hipshot
Posts: 1547
Joined: Sun Jan 20, 2002 8:00 am

Re: Triggering console commands

Post by Hipshot »

If I understand right, you want Q3 to work like Q1 when it comes to level changes? Like you can change level during a multiplayer match and/or botmatch? Just run to the "level exit" and the game will switch level?
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
GONNAFISTYA
Posts: 13369
Joined: Sun Jan 23, 2005 8:20 pm

Re: Triggering console commands

Post by GONNAFISTYA »

^misantropia^ wrote:
GONNAFISTYA wrote:P.S. I realize I might have to create a mod that does this
Pretty easy to accomplish. Want a patch? It's probably quicker than trying to explain the how and what.
Hell yeah. Where do I grab it, how do I use it and who do I send the weed to?
User avatar
GONNAFISTYA
Posts: 13369
Joined: Sun Jan 23, 2005 8:20 pm

Re: Triggering console commands

Post by GONNAFISTYA »

Hipshot wrote:If I understand right, you want Q3 to work like Q1 when it comes to level changes? Like you can change level during a multiplayer match and/or botmatch? Just run to the "level exit" and the game will switch level?
Pretty much....I think.

It's not about switching maps in a server rotation or waiting until a specific frag count to load the next map...just basic trigger function of loading a specific level when walking through a specific trigger.

Basically I'm breaking a large map into roughly 4 chunks and want to load the appropriate level when I walk over to that section (non-linear movement therefore non-linear loading). Think of it as one common area/room with 3 smaller areas/rooms that load depending on where I want to go.

The reason this is important is because when I get to one of the smaller areas/rooms I want to load a low-res version of the common area (visible from the smaller rooms) to ease overhead and maintain high detail levels in each particular section as the player moves through it. And conversely when I go to the common area I'm loading low-res versions of the smaller rooms.

If I can do this with whatever ^misantropia^ is speaking of then I'm all set.
jal_
Posts: 223
Joined: Mon Mar 24, 2008 4:13 pm

Re: Triggering console commands

Post by jal_ »

good'ol target_changelevel =)
a13n
Posts: 1672
Joined: Thu Feb 10, 2005 2:08 am

Re: Triggering console commands

Post by a13n »

obsidian wrote:You could probably do it without a mod via frag limit.
For this to work map has to be loaded with /spmap, of course.
Plus, to lift up scores immensely such as 100, target_give could be used.

Just my 2 billion dollars
axbaby
Posts: 3424
Joined: Wed Dec 22, 1999 8:00 am

Re: Triggering console commands

Post by axbaby »

teleporter trigger won't work?
[color=#FF0000][WYD][/color]
pjw
Posts: 860
Joined: Sun May 07, 2000 7:00 am

Re: Triggering console commands

Post by pjw »

axbaby wrote:teleporter trigger won't work?
I was kind of wondering about that myself...why not just fake it? Separate them completely into different spaces and then load low-res facades of the other parts that would be visible, and just make it one big level?

If you did it with a teleport, it seems like it would be a simple mod (says the non-coder) to lose the tele fx and you could make identical areas at each end to get a decent simulation of a seamless switch (and that would be a lot faster than a level change, even these days).

Or is this more about overall engine limits than performance concerns? I guess if the mission was more than a few large areas, or if those areas had a ton of complexity, you would start hitting geometry/entity limits?
User avatar
GONNAFISTYA
Posts: 13369
Joined: Sun Jan 23, 2005 8:20 pm

Re: Triggering console commands

Post by GONNAFISTYA »

axbaby wrote:teleporter trigger won't work?
I'm considering it. It would be a simple matter of copy/pasting the other sections and removing bits so they can be seen from the other areas. The only thing I'm not sure of is the amount of space I have available. I'm making a fairly large space station so I just don't know if all the copies of the various areas will fit...especially since the common area is very large and I'd need a version of the common area optimized for each vista in the sub-areas.

I'm using GTK 1.5 for the first time and did a test to see my area limitations. The editor's grid shows 131,072 units of available space in all three axes but the test I did didn't take...even with the far-clip plane disabled there was a distinct area at the extremes where brushes simply stopped being rendered correctly. I never compiled it and when I reopened the scene all my brushes that were within 8 units of the grid boundaries disappeared.

Basically...I have no idea if the Q3 engine supports a map that big, even if it's shown in the editor. If anyone can tell me how much space I actually have available in the Q3A version of the engine I might be able to get away with using teleporters. I also don't know if the Q3 point releases increased the 2 million texel limit per load. Perhaps it's not a concern with today's hardware? Dunno.

So many questions.

[edit]...crap...I took to long to post and pjw sneaks in. Now I look like a dick repeating things. :)
axbaby
Posts: 3424
Joined: Wed Dec 22, 1999 8:00 am

Re: Triggering console commands

Post by axbaby »

can the low res room be an edited screenshot jpg of the actual room.

i assume you will only see a wall or two of these low res rooms from quite a distance.

i doubt you would exceed the limit if you place these hidden duplicated low res rooms on the other side of skyboxes
[color=#FF0000][WYD][/color]
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Triggering console commands

Post by ^misantropia^ »

The diff in all its twenty line-ish glory: http://89.105.192.10/~bnoordhuis/quake3 ... level.diff

I'm a nice guy so I wrapped it up in a *.pk3. Unzip to your Q3 directory.

http://89.105.192.10/~bnoordhuis/quake3/changelevel.zip

No project is complete without documentation, no matter how small, so here is the (butt ugly) example map:

http://89.105.192.10/~bnoordhuis/quake3/changelevel.map

It basically works like any other target. Create e.g. a target_delay, set its 'classname' value to 'target_changelevel' and give it a key 'map' with the name of the map you want to switch to. Hook it up to a trigger and you're set.

EDIT: Aww, messed up the link to the diff.
Last edited by ^misantropia^ on Tue Dec 30, 2008 5:32 pm, edited 1 time in total.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Triggering console commands

Post by ^misantropia^ »

GONNAFISTYA wrote:Basically...I have no idea if the Q3 engine supports a map that big, even if it's shown in the editor. If anyone can tell me how much space I actually have available in the Q3A version of the engine I might be able to get away with using teleporters. I also don't know if the Q3 point releases increased the 2 million texel limit per load. Perhaps it's not a concern with today's hardware? Dunno.
IIRC, Q3 supports maps that go from -32768 to +32767 (in all three dimensions). Still big, but not as big as the editor supports.

You can have up to 65,356 surfaces per scene. Nothing really bad happens when you have more but some won't show. A surface can consist of triangle strips so you can cram quite a lot of vertexes into a scene. I think the upper limit depends on what com_hunkmegs is set to.
User avatar
Hipshot
Posts: 1547
Joined: Sun Jan 20, 2002 8:00 am

Re: Triggering console commands

Post by Hipshot »

A long time ago, I did a "size test" just to see if I could compile something that span the entire grid. I'm pretty sure I could and that it took about 10min to run from one corner to the opposite one...
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
GONNAFISTYA
Posts: 13369
Joined: Sun Jan 23, 2005 8:20 pm

Re: Triggering console commands

Post by GONNAFISTYA »

^misantropia^ wrote:The diff in all its twenty line-ish glory: http://89.105.192.10/~bnoordhuis/quake3/changelevel.zip

I'm a nice guy so I wrapped it up in a *.pk3. Unzip to your Q3 directory.

http://89.105.192.10/~bnoordhuis/quake3/changelevel.zip

No project is complete without documentation, no matter how small, so here is the (butt ugly) example map:

http://89.105.192.10/~bnoordhuis/quake3/changelevel.map

It basically works like any other target. Create e.g. a target_delay, set its 'classname' value to 'target_changelevel' and give it a key 'map' with the name of the map you want to switch to. Hook it up to a trigger and you're set.
Awesome! Thank you very much.

I'll download it, try it out and no doubt come back with questions. :)
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Triggering console commands

Post by obsidian »

Just how big is this map? If a large part of your map is just decorative stuff in the distance that you can't actually walk around in then perhaps you can make use of the portal skybox entity. If most of this is actual playable area, then :eek:
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Fjoggs
Posts: 2555
Joined: Fri May 03, 2002 7:00 am

Re: Triggering console commands

Post by Fjoggs »

Lloyd_M would be proud if the latter was the case.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Triggering console commands

Post by obsidian »

:olo: I hear tell that he's still working on it during lunch breaks.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Detoeni
Posts: 20
Joined: Fri Aug 16, 2002 7:00 am

Re: Triggering console commands

Post by Detoeni »

Hipshot wrote:A long time ago, I did a "size test" just to see if I could compile something that span the entire grid. I'm pretty sure I could and that it took about 10min to run from one corner to the opposite one...
You can also run a bsp compile on the mymap.bsp with just the "-scale #" key, this will rescale the bsp in size, its a pain to map to the odd scale in radiant, but does mean you can make some very big *looking* maps if you need without taxing the limits too much.
Post Reply