SetActorViewHeight
Moderator: GZDoom Developers
SetActorViewHeight
I'm making a mod where players can become incapacitated if their health gets too low, and other marines can restore their health and whatnot... But, instead of spawning a camera, I was hoping to actually change the viewheight of the marine... Which doesn't seem possible yet. (The marine will still be able to shoot while he's on the ground, so without doing anything hackish I think the easiest way to do this would be with a SetActorViewHeight function.) I don't see why this would be abuse prone, since we can already set the viewheight of players, just not dynamically. So... Feedback?
Re: SetActorViewHeight
http://www.zdoom.org/wiki/Classes:PowerMorph
make a new player class with lower viewheight and morph to it when you are on the ground.
make a new player class with lower viewheight and morph to it when you are on the ground.
Re: SetActorViewHeight
That's a good idea, but it isn't necessarily applicable to all situations, and it is a little hacky.
If multiple playerclasses: Each distinct player class will require its own morph class just to get the altered viewheight.
If morph is used in the game: The player in question might already be morphed, and you might want the viewheight to affect the current morphed class. You might be able to fix this by having specific altered morph classes for standard morph classes.
Also, SetActorViewHeight seems feasible, but the concept of morphing might complicate it.
If SetActorViewHeight is called on an actor, its view height would be set for its current form. If the form is altered, the change is probably lost. When the form is restored, default view height is likely to be set. You could possibly add a morph-flag to keep view height on morph, and on unmorph, but I think they'd be bad news.
Ok. My guess is that you can do SetActorViewHeight, but that any other effect that temporarily or permanently alters actor viewheight is expected (perhaps guaranteed) to cancel such changes.
If multiple playerclasses: Each distinct player class will require its own morph class just to get the altered viewheight.
If morph is used in the game: The player in question might already be morphed, and you might want the viewheight to affect the current morphed class. You might be able to fix this by having specific altered morph classes for standard morph classes.
Also, SetActorViewHeight seems feasible, but the concept of morphing might complicate it.
If SetActorViewHeight is called on an actor, its view height would be set for its current form. If the form is altered, the change is probably lost. When the form is restored, default view height is likely to be set. You could possibly add a morph-flag to keep view height on morph, and on unmorph, but I think they'd be bad news.
Ok. My guess is that you can do SetActorViewHeight, but that any other effect that temporarily or permanently alters actor viewheight is expected (perhaps guaranteed) to cancel such changes.
Re: SetActorViewHeight
If what you are doing is for GZDoom, I'm sure that there is a Fragglescript instruction that allows you to change the viewheight. I used it once to simulate the player getting up off the ground after being knocked out on the previous level. Unfortunately, I no longer have the map so I don't remember the syntax.
[edit]
Heh
http://forum.drdteam.org/viewtopic.php?f=22&t=2909
[/edit]
[edit]
Heh
http://forum.drdteam.org/viewtopic.php?f=22&t=2909
[/edit]
Re: SetActorViewHeight
ZDoom has [wiki]FraggleScript[/wiki] too now.
However, when I browsed through the code, I saw a few blatant bugs and other Things That Just Cannot Work At All (my favorites: ObjState and ModifyHUPic), so I wouldn't recommend using it.
However, when I browsed through the code, I saw a few blatant bugs and other Things That Just Cannot Work At All (my favorites: ObjState and ModifyHUPic), so I wouldn't recommend using it.
Re: SetActorViewHeight
Oh, I hadn't realised. Thanks for pointing it out.Gez wrote:ZDoom has [wiki]FraggleScript[/wiki] too now.
It's certainly far from perfect but, in the absence of anything else, a simple script like this could perhaps solve the problem at hand. I certainly wouldn't recommend it as a wholesale solution though and the fact that it's implementation is quite different to the lumps and scripts that ZDoomers are familiar with also makes it feel a bit strange to use. A proper, native ZDoom solution would, of course, be better.Gez wrote:However, when I browsed through the code, I saw a few blatant bugs and other Things That Just Cannot Work At All (my favorites: ObjState and ModifyHUPic), so I wouldn't recommend using it.
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: SetActorViewHeight
Since this can now be done with SetActorProperty, this can be closed?

