Moving cardinally in relation to camera

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
LanHikariDS
Posts: 179
Joined: Tue Aug 04, 2015 11:30 pm
Location: Playing in the snow

Moving cardinally in relation to camera

Post by LanHikariDS »

So, this may or may not be possible, but I'm hoping it is, and to know how to go about it. So, I'm using The Zombie Killer's 3rd person camera ( http://forum.zdoom.org/viewtopic.php?f=37&t=46797 ) for a project, and my request will take a little bit of explaining... So, when the camera is enabled, it essentially acts like chasecam, but allows the camera to turn away from the player's back. What I want is when the player strafes or backpedals, they will instead turn in that direction and move forward, without turning the camera like it does when the player normally moves forward.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Moving cardinally in relation to camera

Post by The Zombie Killer »

Well, first off, have the latest version of the camera (it's near-identical to the built-in one now):
zk-chase.pk3
(2.78 KiB) Downloaded 90 times
I'm not entirely sure what you meant, but if you're good with ACS (and use GDCC-ACC), you should be able to add an extra camera mode (chase_type) to the scripts.
User avatar
kodi
 
 
Posts: 1355
Joined: Mon May 06, 2013 8:02 am

Re: Moving cardinally in relation to camera

Post by kodi »

Could try setting the players angle to vectorangle (velx, vely) in a loop? Will be instant unless you do it incrementally though.
User avatar
LanHikariDS
Posts: 179
Joined: Tue Aug 04, 2015 11:30 pm
Location: Playing in the snow

Re: Moving cardinally in relation to camera

Post by LanHikariDS »

The Zombie Killer wrote:Well, first off, have the latest version of the camera (it's near-identical to the built-in one now):
zk-chase.pk3
I'm not entirely sure what you meant, but if you're good with ACS (and use GDCC-ACC), you should be able to add an extra camera mode (chase_type) to the scripts.
I wasn't trying to make a new camera, I was explaining your camera to help with what I want to do. (Using Chaseplr=1 by the way) I want pack pedaling to instead rotate the player 180 degrees and move forward, without returning the camera to their backs, and same with strafing, but 90 degrees.

EDIT: Also, your newest one doesn't work with 2.8.1, and I don't like developing with nightly builds...
Last edited by LanHikariDS on Tue May 31, 2016 11:35 pm, edited 1 time in total.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Moving cardinally in relation to camera

Post by The Zombie Killer »

Oh I know, I said camera mode. You'd basically add an extra mode that gives the chasecam that functionality.
So basically you want the player to move relative to the camera angle?
User avatar
LanHikariDS
Posts: 179
Joined: Tue Aug 04, 2015 11:30 pm
Location: Playing in the snow

Re: Moving cardinally in relation to camera

Post by LanHikariDS »

Yes, that's about right.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Moving cardinally in relation to camera

Post by The Zombie Killer »

LanHikariDS wrote:EDIT: Also, your newest one doesn't work with 2.8.1, and I don't like developing with nightly builds...
There... really isn't any reason not to develop with a dev build (except in circumstances where they're broken, like when the scripting branch was first merged), but if you really don't want to for some strange reason, you should be able to safely remove the +ALLOWTHRUFLAGS flag from the Chasecam actor in decorate. That should make it work in the current stable build (I think)

As for the movement, I'll see if I can add that now

EDIT: Alright, here you go. There's still work that needs to be done, but it gets the job done for now. Use chase_type 2.
Attachments
zk-chase.pk3
(3.73 KiB) Downloaded 143 times
User avatar
LanHikariDS
Posts: 179
Joined: Tue Aug 04, 2015 11:30 pm
Location: Playing in the snow

Re: Moving cardinally in relation to camera

Post by LanHikariDS »

Well, it's simply because I typically develop for the version I play on, and I don't bother with downloading every development build. Just a personal nitpick, but whatever.

EDIT: I tried it, ZDoom just acts as if there's only the IWAD (I was trying it before integrating it into my project), no chasecam at all
EDIT2: Tried it in the newest dev build (With the flag), and when I used cam_mode 2, It was first-person, and I was unable to move.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Moving cardinally in relation to camera

Post by The Zombie Killer »

that's weird, chase_active was on, right?
User avatar
LanHikariDS
Posts: 179
Joined: Tue Aug 04, 2015 11:30 pm
Location: Playing in the snow

Re: Moving cardinally in relation to camera

Post by LanHikariDS »

... nope. Dunno why you would have that false by default, but whatever. Also, as for the moving issue, it was simply because I hadn't set the controls for GZDoom, so still my bad...
However, Chase Type 2 isn't what I was wanting to do, it just acts like ZDoom's chasecam. What I was wanting to do was, say, when strafing right, Doomguy will instead turn to face that direction (while the camera stays at the same angle), and run 'forward'. (Think Legend of Zelda or Super Mario 64)
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Moving cardinally in relation to camera

Post by The Zombie Killer »

LanHikariDS wrote:... nope. Dunno why you would have that false by default, but whatever. Also, as for the moving issue, it was simply because I hadn't set the controls for GZDoom, so still my bad...
However, Chase Type 2 isn't what I was wanting to do, it just acts like ZDoom's chasecam. What I was wanting to do was, say, when strafing right, Doomguy will instead turn to face that direction (while the camera stays at the same angle), and run 'forward'. (Think Legend of Zelda or Super Mario 64)
That's exactly what chase_type 2 does, are you sure you're not accidentally using type 0 or type 1?
User avatar
LanHikariDS
Posts: 179
Joined: Tue Aug 04, 2015 11:30 pm
Location: Playing in the snow

Re: Moving cardinally in relation to camera

Post by LanHikariDS »

Positive.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Moving cardinally in relation to camera

Post by The Zombie Killer »

Changing the value in CVARINFO does not change the value in-game. You need to change it in the console.
Since chase_type does not have "noarchive", it gets saved in your ini, which is why the value wasn't changing for you (it was using the value saved in your ini instead of the default value defined by CVARINFO).
User avatar
LanHikariDS
Posts: 179
Joined: Tue Aug 04, 2015 11:30 pm
Location: Playing in the snow

Re: Moving cardinally in relation to camera

Post by LanHikariDS »

Okay, thanks. I added noarchive to it, tried it without ALLOWTHRUFLAGS, and lost the ability to turn it. Whatever. My final issue with the camera is that when firing, it's still aimed by camera angle, not player angle, so the player jerks to that angle when firing. I apologize for all the trouble, I originally asked how to do it, and end up having it done for me.

EDIT: Think I found it. Going to fiddle with it, see what happens.

EDIT2: Well, I can only assume it's hiding in 'tpcam.o', as what I pulled out of 'tpcam.acs' (The section starting in line 150) didn't seem to do anything...
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Moving cardinally in relation to camera

Post by The Zombie Killer »

tpcam.o is the compiled version of tpcam.acs. You'll need a copy of gdcc-acc in order to compile it and make changes.
The player rotating to the camera view when firing was intentional, but is easy to change. Try camera mode 3 in this:
Attachments
zk-chase.pk3
(3.79 KiB) Downloaded 110 times
Locked

Return to “Editing (Archive)”