Impulse on start

Discuss programming in the QuakeC language.
Post Reply
Blackstar1000
Posts: 52
Joined: Mon Sep 13, 2010 5:16 pm

Impulse on start

Post by Blackstar1000 »

I'm having some trouble finding a way to start the game with my Impulse 20 activated at launch.
it also reverts when I change levels. Its finally driving me mad as it helps run my camera.

any advice?
Knives out. Catch the mouse. Squash his head. Put him in your mouth.
thorn3001
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Re: Impulse on start

Post by thorn3001 »

you just have to edit a file called default.cfg, this is in the id1 folder or data folder.


if you use Darkplaces that file is in My Documents/My Games/Darkplaces
Thorn
Spirit
Posts: 1068
Joined: Sat Nov 20, 2004 9:00 pm
Contact:

Re: Impulse on start

Post by Spirit »

The better method would be editing the quake.rc (at least I think this is the better approach).
Improve Quaddicted, send me a pull request: https://github.com/Quaddicted/quaddicted-data
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: Impulse on start

Post by Nahuel »

you can write conditionals in worldspawn, something like

Code: Select all

if (self.model == "maps/start.bsp")
		stuffcmd (other, "impulse xx\n");
	else
			stuffcmd (other, "impulse xxx\n");

But i suggest you do not use impulses in this way, use conditionals like
"cameraactive" or something like that
hi, I am nahuel, I love quake and qc.
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Impulse on start

Post by ceriux »

why would you call an impulse to start a camera?
Blackstar1000
Posts: 52
Joined: Mon Sep 13, 2010 5:16 pm

Re: Impulse on start

Post by Blackstar1000 »

For one, I am using darkplaces.

"Why would you call an impulse to start a camera?" <- Why is a tough one; haha.
Perhaps I am asking incorrectly? My game uses a third person camera. It simply needs to be started every time by typing impulse 20.

If I am going to code this into quake.qc I painfully ask for a more in depth explanation. (I'm an actionscript guy crossing over)

I also want to have any of the stuff I modify be confined to my C:/quake folder and subfolders to allow for easy copy and paste to other computers.
I guess there is no way to call this impulse once automatically from autoexec.cfg or config.cfg?
Knives out. Catch the mouse. Squash his head. Put him in your mouth.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Impulse on start

Post by leileilol »

if you're coding a game that uses probably the old crappy albin chase cam you can throw a camera start command on putclientinserver

if not, chase_active 1.
i should not be here
Blackstar1000
Posts: 52
Joined: Mon Sep 13, 2010 5:16 pm

Re: Impulse on start

Post by Blackstar1000 »

No, it's a custom cam that works much like anachronox or mass effect. I'll have to keep working on a fix I guess.
Knives out. Catch the mouse. Squash his head. Put him in your mouth.
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Impulse on start

Post by ceriux »

why not just call the function somewhere that makes the camera start?
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: Impulse on start

Post by Nahuel »

why not just call the camera function in "putclientinserver"
hi, I am nahuel, I love quake and qc.
necros
Posts: 77
Joined: Thu Dec 16, 2004 10:32 pm

Re: Impulse on start

Post by necros »

ceriux and nahuel have the right idea i think.

if you're still interested in .rc and .cfg files...
.rc is the only config file hard coded by the engine to run. if you open up pak0.pak, there's a quake.rc file in there and if you open that, you can see it is actually running the exec config.cfg and exec autoexec.cfg files in there.

the reason they are saying to edit that rather than autoexec or config is that almost all players have their own custom autoexecs and configs (for key binds or alias scripts, especially with modern engines) so you don't want to annoy players by either wiping out their binds or forcing them to merge theirs with yours.

by editing the quake.rc file, you can add another exec myconfig.cfg line where you put in all the extra stuff you want for your own mod, without messing with anyone elses.

on top of that, you can even control when your config file is run in relation to command line arguments. the 'stuffcmds' line is where the engine is given all the command line arguments the user used to launch the engine (like +map) so you could always make your mod start on a certain map, for example, regardless of what the user typed as long as you put your command after stuffcmds.
Blackstar1000
Posts: 52
Joined: Mon Sep 13, 2010 5:16 pm

Re: Impulse on start

Post by Blackstar1000 »

Ugh, sorry guys. Thanks again for the advice, I was trying so many things to get this right and it seriously came down to mixing up a TRUE/FALSE in my code.
Knives out. Catch the mouse. Squash his head. Put him in your mouth.
Post Reply