Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
ViperGTS96

How to set your Player's veiwheight.

Recommended Posts

I was able to get APROP_ViewHeight to work finally.

The missing information was: you need to use a decimal place in your integer. Not using a decimal will give you a 0 view height (the floor) even if it's 487.

Script 1 (void)
{
SetActorProperty(0,APROP_ViewHeight,46.0);
}

http://zdoom.org/wiki/Player_properties

http://zdoom.org/wiki/Actor_properties#Player.ViewHeight


This code does require the newer ports fyi.

Hope this helps.


-Viper

Edited by ViperGTS96

Share this post


Link to post

None of this was missing in the wiki at all, you were just reading horribly the wrong place and didn't understand ACS's syntax as a result.

APROP_ViewHeight expects a fixed point number. ACS bytecode has no native type for this so you must suffix a decimal value for when ACC compiles it. 487 is 0.00743103 in fixed point, while 487.0 is 31916032 as normal integer.

Defining it as a string, "487", is even worse as strings are also integer represented in ACS (strings are immutable objects), so you were giving APROP_ViewHeight some invented garbage value instead that the compiler came up with.

Share this post


Link to post

No, the example was even with out a decimal. It was vague and misleading. Only those who wrote the program are going to know what you just said.

I'm helping the the folks who don't know everything about ACS.

This is legitimate help. Helping the community shouldn't be responded to this way. Remarks like that are what stop people from posting such help.

Edited by ViperGTS96

Share this post


Link to post

Calm down. Edward850 wasn't personally attacking you, he just corrected your mistakes. ACS's handling of data types is one of the most essential things in ACS, which is why it's linked from ACS main page right after "A quick beginner's guide to ACS". It's not necessary to know everything about ACS when working with it, but at least checking out the basics before going on to work with more advanced features (and complaining about their "misleading" descriptions) should be preferable.

Share this post


Link to post

The description was misleading and vague...

It simply stated : "changes the player's viewheight. the default is 41."

when other values on the page do show decimal form. Making it misleading.

Edited by ViperGTS96

Share this post


Link to post

That wasn't even APROP_ViewHeight you were linking to, though. APROP_ViewHeight is in ACS_actor_properties.
You changed it there too, but unlike the other fixed point properties on that page, you haven't actually listed it as fixed point. This is inconsistent and can confuse newcomers.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×