Thing_SetScale?

Moderator: GZDoom Developers

Post Reply
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Thing_SetScale?

Post by CaptainToenail »

Would it not be cool to be able to set the scale of a thing using the map editor? Imagine you have a lot of repetitive trees, rocks etc. that would look better if they were all slightly different sizes.

It could be a property of an object set in UDMF mode
or...
an action special so you could apply it via acs
or...
perhaps you could make it possible to set the scale property as a thing argument, i.e.

Code: Select all

ACTOR Rock 12345
{
  Radius 16
  Height 16
  Scale Args[0]
  States
  {
  Spawn:
    NROK A -1
    Stop
  }
}

The only way to do this at the moment as far as I know is to either create many multiple versions of the same actor with different scale properties, or use A_Jump with lots of states controlled by thing arguments.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Thing_SetScale?

Post by NeuralStunner »

You can set its scale through ACS with [wiki]SetActorProperty[/wiki]. Possibly an OPEN script. Won't appear that way in map editor, and you'd have to give it a TID, but it would work.

Alternatively, pass (args[0] / 1000) to [wiki]A_SetScale[/wiki]. Setting the argument to 1000 acts as 1.0, and you can scale to 3 decimal places of precision. (If the arg is 0, assume 1.0 as default.)

Though it would be pretty great to set certain properties (including user variables) via UDMF.
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US
Contact:

Re: Thing_SetScale?

Post by LilWhiteMouse »

NeuralStunner wrote:You can set its scale through ACS with [wiki]SetActorProperty[/wiki]. Possibly an OPEN script. Won't appear that way in map editor, and you'd have to give it a TID, but it would work.
You don't need to use TIDs. This is basically what I use:

Code: Select all

ACTOR BigTreeRandom : BigTree REPLACES BigTree
{
	States
	{
	Spawn:
		TRE2 A 0
		TRE2 A 0 ACS_NamedExecuteAlways ("BigTreeRandom", 0)
		TRE2 A -1
		Stop
	}
}

Code: Select all

#library "BigTreeRandom"
#include "zcommon.acs"

script "BigTreeRandom" (void) {
SetActorProperty (0, APROP_ScaleX, random (0.8, 1.2));
SetActorProperty (0, APROP_ScaleY, random (0.8, 1.2));
}
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Thing_SetScale?

Post by NeuralStunner »

LilWhiteMouse wrote:You don't need to use TIDs.
True!
LilWhiteMouse wrote:ACS_NamedExecuteAlways
You can also use the much shorter [wiki]CallACS[/wiki].
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Re: Thing_SetScale?

Post by CaptainToenail »

Ah, ok. :)
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Thing_SetScale?

Post by Xaser »

This can be closed with [Already In] since SetActorProperty handles this, as mentioned.
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: Thing_SetScale?

Post by Arctangent »

LilWhiteMouse wrote:
NeuralStunner wrote:You can set its scale through ACS with [wiki]SetActorProperty[/wiki]. Possibly an OPEN script. Won't appear that way in map editor, and you'd have to give it a TID, but it would work.
You don't need to use TIDs. This is basically what I use:
Couldn't you just use [wiki]A_SetScale[/wiki] for this?
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Thing_SetScale?

Post by Xaser »

2012. D:
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: Thing_SetScale?

Post by Arctangent »

Xaser wrote:2012. D:
This is a very valid point, yes.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”