Dead space like tps zooming action
Moderator: InsideQC Admins
25 posts
• Page 1 of 2 • 1, 2
Dead space like tps zooming action
I already have my own third person camsra working, how would serb I.add a zoomi (yes I know ung action to it if.i.pdess the right mouse
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: Dead space like tps zooming action
In the console type:
fov 90 (enter ... look at what is onscreen)
fov 60 (enter ... look at what is onscreen)
fov 30 (enter ... look at what is onscreen)
fov 10 (enter ... look at what is onscreen)
Then type fov 90 in console to restore to what is probably normal.
You can mess with the zoom on a client doing stuffcmd("fov whatever value")
Maybe part of the clue you are looking for
fov 90 (enter ... look at what is onscreen)
fov 60 (enter ... look at what is onscreen)
fov 30 (enter ... look at what is onscreen)
fov 10 (enter ... look at what is onscreen)
Then type fov 90 in console to restore to what is probably normal.
You can mess with the zoom on a client doing stuffcmd("fov whatever value")
Maybe part of the clue you are looking for
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
Re: Dead space like tps zooming action
after i add the impulse how would i zoom out because you cannot assign multiple impulses to a single key
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: Dead space like tps zooming action
You need a new field to keep track of the player zoom state. Add to the very end of defs.qc something like this ...
Have your impulse do something like
There are tons of things wrong about the above, but the logic is sound. You should be able to adapt the above idea easily enough (and if not, you'll need to be able to in order to bring your ideas into reality).
[Having the server stuffcmd for is not ideal. However, unless you are targeting DP or FTE I think it is the only method available unfortunately.]
- Code: Select all
.float iszoomed; // 0 = No they are not zoomed, set to 1 to indicate they are zoomed
Have your impulse do something like
- Code: Select all
// This is a summary, not actual code ... you will have to adapt this
if (impulse == 40)
{
if (iszoomed)
{
stuffcmd ("fov 90\n"); // Restore normal
iszoomed = 0; // Not zoomed
}
else
{ stuffcmd("fov 30\n"); // Not zoomed so zoom them in
iszoomed = 1; // We are zoomed in now
}
}
There are tons of things wrong about the above, but the logic is sound. You should be able to adapt the above idea easily enough (and if not, you'll need to be able to in order to bring your ideas into reality).
[Having the server stuffcmd for is not ideal. However, unless you are targeting DP or FTE I think it is the only method available unfortunately.]
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
Re: Dead space like tps zooming action
thommoboy wrote:after i add the impulse how would i zoom out because you cannot assign multiple impulses to a single key
Actually you can...
- Code: Select all
alias +zoom "impulse 25"
alias -zoom "impulse 26"
bind z +zoom
The above will bind key "z" so that it calls "impulse 25" when pressed and "impulse 26" when released.
- metlslime
- Posts: 316
- Joined: Tue Feb 05, 2008 11:03 pm
Re: Dead space like tps zooming action
note that impulses are unreliable and thus:
a) if you press and release your button fast enough, the mod will see only the release. This is also an issue if they use *any* other impulses at the same sort of time.
b) if a packet is dropped, its possible the mod will see only the press, and not the release.
so make sure its not too unusable if either happens.
if you are targetting DP or FTE, try using DP_VIEWZOOM:
.float viewzoom;
which won't kill the user's fov/sensitivity settings each and every single time they zoom in.
a) if you press and release your button fast enough, the mod will see only the release. This is also an issue if they use *any* other impulses at the same sort of time.
b) if a packet is dropped, its possible the mod will see only the press, and not the release.
so make sure its not too unusable if either happens.
if you are targetting DP or FTE, try using DP_VIEWZOOM:
.float viewzoom;
which won't kill the user's fov/sensitivity settings each and every single time they zoom in.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: Dead space like tps zooming action
the third person zooming in typical console shooters involve both moving the camera and adjusting the FOV at the same time. You can't seal the deal with a simple zoom alias
i should not be here
- leileilol
- Posts: 2783
- Joined: Fri Oct 15, 2004 3:23 am
Re: Dead space like tps zooming action
for your code i get error: mismatch for == (fieldfloat and float)

- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: Dead space like tps zooming action
thommoboy wrote:for your code i get error: mismatch for == (fieldfloat and float)
Do this easy flashlight tutorial. It is a 5 minute deal: http://inside3d.com/showtutorial.php?id=119
Once you do that tutorial, you should be able to correct my code. Sure I could correct the code, but if you correct the code yourself you'll gain +100 XP and be Level 2.
[Hint: self.origin, self.angles, self.impulse or above my crappy pseudo code ... self.iszoomed]
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
Re: Dead space like tps zooming action
okay ive got it so far i made my own code based off my modified tps code
CCamzoom is the default
i want it so when the (left trigger psp) or z button is held it will change to CCamdoom but when released it will change back to CCamzoom
- Code: Select all
void (float amount) CCamzoom =
{
self.camview_z = self.camview_z + amount;
if (self.camview_z > -5)
self.camview_z = -5;
if (self.camview_z < -10)
self.camview_z = -10;
self.camview_x = self.camview_x + amount;
if (self.camview_x < 16)
self.camview_x = -16;
if (self.camview_x > -16)
self.camview_x = -16;
self.camview_y = self.camview_y + amount;
if (self.camview_y < 12)
self.camview_y = 12;
if (self.camview_y > -12)
self.camview_y = -12;
self.camview_z = self.camview_z + amount;
if (self.camview_z > -48)
self.camview_z = -48;
if (self.camview_z < -72)
self.camview_z = -72;
};
void (float amount) CCamdoom =
{
self.camview_z = self.camview_z + amount;
if (self.camview_z > -16)
self.camview_z = -16;
if (self.camview_z < -16)
self.camview_z = -16;
};
CCamzoom is the default
i want it so when the (left trigger psp) or z button is held it will change to CCamdoom but when released it will change back to CCamzoom
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: Dead space like tps zooming action
metlslime wrote:thommoboy wrote:after i add the impulse how would i zoom out because you cannot assign multiple impulses to a single key
Actually you can...
- Code: Select all
alias +zoom "impulse 25"
alias -zoom "impulse 26"
bind z +zoom
The above will bind key "z" so that it calls "impulse 25" when pressed and "impulse 26" when released.
for your code where do i put it?
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: Dead space like tps zooming action
woo i figured it out yay!!!!!!!!!!!!!
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: Dead space like tps zooming action
thommoboy wrote:woo i figured it out yay!!!!!!!!!!!!!
I was pretty sure you could
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
Re: Dead space like tps zooming action
how would i make it so that when the player is zoomed in he moves half the speed?
- thommoboy
- Posts: 95
- Joined: Mon Nov 21, 2011 6:35 am
Re: Dead space like tps zooming action
thommoboy wrote:how would i make it so that when the player is zoomed in he moves half the speed?
Type in console cl_forwardspeed to find out what you forward speed is. Write it down. It may not be the default 350.
Type in console "fov 90; cl_forwardspeed 350". Move a little to feel the speed.
Type in console "fov 90; cl_forwardspeed 200". Move a little to feel the speed.
Type in console "fov 30; cl_forwardspeed 200". Move a little to feel the speed.
Type in console "fov 90; cl_forwardspeed 350". Back to normal.
Now messing with the player's cl_forwardspeed cvar but sending it via stuffcmd is not the proper way to do it any more than messing with the player fov via stuffcmd.
Still, it'll give you some ideas on how things work. There is a "haste" tutorial that ironically does it "wrong" too ... http://inside3d.com/showtutorial.php?id=122
The "correct" way is a bit involved and if you really want to do it "right" check out RuneQuake 1.3 source and search for "ath" for the rune of athletics that has code like:
http://www.runequake.com/html-source/runequake-1.3.0/
- Code: Select all
Athlete_Run =
{
if ((self.cl[CL_CMD_FORWARD] || self.cl[CL_CMD_SIDE]) && self.flags & FL_ONGROUND)
self.velocity = self.velocity + self.velocity * 0.10;
};
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
25 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest