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

<Solved> How to, in Decorate, check how far away from the player an object is?

Recommended Posts

The idea is to use 3D models for decorative purposes and, if the player is a good enough distance away, they're rendered as sprites to preserve performance.


Update: Someone gave me a solution. I just use A_CheckRange to check the distance from the player. It requires a new version of GZDoom, though.

Share this post


Link to post

I'd guess A_JumpIfCloser on a 0 tic state. Jump to a 1 tic state with the 3D model defined if the player is within a given distance, else fall through to another 1 tic state with the sprite defined, then loop back to the A_JumpIfCloser.

This might not work well in multiplayer.

Share this post


Link to post

It made the object completely disappear. Not even just invisible, the object deleted itself.

ACTOR EngineerHat : Soulsphere replaces Soulsphere
{
+LOOKALLAROUND
Scale 2
  States
  {
  Spawn:
    SOUL B 0 A_LookEx(LOF_NOSOUNDCHECK)
	SOUL B 0 A_JumpIfCloser(500,"Model")
    SOUL A 5
	Loop
  Model:
    SOUL A 5
	Goto Spawn
  }
}

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
×