Page 1 of 1
scripting, how can i set the line GetActorViewHeight
Posted: Tue Feb 22, 2011 20:20
by doomexpert
hi can somebody help me about the view height of the player?
i have this:
script 4 enter
//player view height
{
GetActorViewHeight(x,y,z coordinators???);
I dont know the normal coordinators/settings of the player. also i dont know if i get trouble with jumping and crouching. I must adjust the speed and height of crouching if possible. How the sprites gonna work out, i think that the sprites gonna be set apart from that, also i dont know if i can adjust that to one y coordinators to the camera height value is the same as the gun sprite height coordinator so that i know what the excactly height is to adjust the weapon sprites easy to the players view height coordinator. so i can adjust the height value for each weapon in a easy way or is that already sticked with the player view height?
and I do not mean the 3rd person view mode height but the eyeview height.
here is it on zdoom wiki:
http://www.zdoom.org/wiki/GetActorViewHeight
Re: scripting, how can i set the line GetActorViewHeight
Posted: Wed Feb 23, 2011 0:48
by Salad Viking
I don't really know what you're talking about, but [wiki]GetActorViewHeight[/wiki] returns the
absolute Z-coordinate of an actor's (in this case, the player) viewing position (accounting for adjustments to the view height, such as in the case of crouching), and [wiki]GetActorX[/wiki], [wiki]GetActorY[/wiki], and [wiki]GetActorZ[/wiki] get the absolute coordinates of the player. So you can subtract the Z-coordinate of the player from its view height and you get the height of the player's view relative to the ground.
IMPORTANT NOTE: All those functions I mentioned return
fixed-point values, which means that, to get the floating-point value of them, you must divide them by 65536 (0xFFFF as an unsigned short). Considering you've chosen to call yourself "doomexpert", I'll bet you already knew that.

Re: scripting, how can i set the line GetActorViewHeight
Posted: Wed Feb 23, 2011 4:30
by NeuralStunner
Salad Viking wrote:I don't really know what you're talking about, but [wiki]GetActorViewHeight[/wiki] returns the absolute Z-coordinate of an actor's (in this case, the player) viewing position (accounting for adjustments to the view height, such as in the case of crouching), and [wiki]GetActorX[/wiki], [wiki]GetActorY[/wiki], and [wiki]GetActorZ[/wiki] get the absolute coordinates of the player. So you can subtract the Z-coordinate of the player from its view height and you get the height of the player's view relative to the ground.
What. Did you actually read the page you linked?
ZDoom Wiki wrote:For a player, this corresponds to the Player.ViewHeight property, modified by crouching if needs be. For other actors, it corresponds to the CameraHeight if one is defined, or defaults to half their height otherwise.
Re: scripting, how can i set the line GetActorViewHeight
Posted: Wed Feb 23, 2011 18:49
by Salad Viking
NeuralStunner wrote:What. Did you actually read the page you linked?
What do you mean?
Re: scripting, how can i set the line GetActorViewHeight
Posted: Wed Feb 23, 2011 21:00
by doomexpert
next
Re: scripting, how can i set the line GetActorViewHeight
Posted: Wed Feb 23, 2011 21:09
by doomexpert
i know i must use the z coordinator but i cant get the scripting to work. I have this:
script 4
{
getactorviewheight (1);
}
so the number is the thing id and i have it already set the player 1 to id number 1 so it know the connection. but no height value..
now you have arguments like:
GetActorZ (0)
Thing_ChangeTID
but i need to inserting the value, i dont know what to type to change the value
i need only to get the view height of the player heigher, settings like crouch height is already good.
Re: scripting, how can i set the line GetActorViewHeight
Posted: Fri Feb 25, 2011 7:02
by Salad Viking
Well, first you need to be sure that the player indeed has a TID of 1. To do this, you must use a script like this one:
Code: Select all
script 100 ENTER {
Thing_ChangeTID(0, 1);
}
If you have something like that (including any number of other statements inside the same script), then you're good on the TID.
Now you can use
GetActorViewHeight(1) and it will return the
ViewHeight property of the player - contrarily to what I said (after testing it out) this is NOT an absolute value (I see what you mean now, NeuralStunner. The wiki page was too ambiguous). If you want to get the absolute Z-coordinate of the player's view height, you would use a line of code like this:
Code: Select all
GetActorViewHeight(1) + GetActorZ(1)
If you want to
change the view height of the player, you need to create a new player class and override the
Player.ViewHeight actor property. See
Creating new player classes for a guide on creating new player classes.
Re: scripting, how can i set the line GetActorViewHeight
Posted: Sun Mar 06, 2011 1:05
by doomexpert
Salad Viking wrote:Well, first you need to be sure that the player indeed has a TID of 1. To do this, you must use a script like this one:
Code: Select all
script 100 ENTER {
Thing_ChangeTID(0, 1);
}
If you have something like that (including any number of other statements inside the same script), then you're good on the TID.
Now you can use
GetActorViewHeight(1) and it will return the
ViewHeight property of the player - contrarily to what I said (after testing it out) this is NOT an absolute value (I see what you mean now, NeuralStunner. The wiki page was too ambiguous). If you want to get the absolute Z-coordinate of the player's view height, you would use a line of code like this:
Code: Select all
GetActorViewHeight(1) + GetActorZ(1)
If you want to
change the view height of the player, you need to create a new player class and override the
Player.ViewHeight actor property. See
Creating new player classes for a guide on creating new player classes.
wow creating a new player class? so if i must create a new player class then i can always watch the current playerclass back and change it. so i can telll to acs the current height and to change it to whatever i want, like its not an original setting. this engine of zdoom it must be a easy way too adjust the settings of a player class in some weird way i think. so you mean that it cant be done with only scripting? all the thinks and everything goes through acs (scripting) whatfor is the option getactorviewheight? what does that mean? now im confusing. if its logic then i think its possible to adjust the height of a player. the program whacked2 is better then dehacked. so i have w7 64 bit and cant use dehacked anymore, such as old programs like that. maybe some do. i have xwe a very good program and does work under windows 7 64 bit.
would someone post a example wad of the players view height with only scripting? eye height is normally 41. now i want it too set it to 60/70 eye view. people have adjust the speed and height and everything with a simple dos program back in 1991, and its seems even harder to do that with windows xp or windows 7. because of that programs that's have limited options like that.
Re: scripting, how can i set the line GetActorViewHeight
Posted: Sun Mar 06, 2011 2:52
by Salad Viking
You must create a new player class. There is no alternative. And Doom wasn't released until December 1993, so there couldn't have been any mods you played in 1991. (Though it is true that DeHackEd can change things like mobj height, speed, radius, etc., it is highly recommended that you do not use DeHackEd unless you're making a Boom-specific mod)
And, FFS, can you please post in legible English?