Thing_SetScale?

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: Developers

Thing_SetScale?

Postby CaptainToenail » Mon Apr 09, 2012 1:19 pm

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 allExpand view
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
CaptainToenail
 
Joined: 06 Jul 2007

Re: Thing_SetScale?

Postby NeuralStunner » Mon Apr 09, 2012 2:16 pm

You can set its scale through ACS with SetActorProperty. 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 A_SetScale. 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
NeuralStunner
O'Neill with it.
 
Joined: 21 Jul 2009
Location: The Colonies

Re: Thing_SetScale?

Postby LilWhiteMouse » Mon Apr 09, 2012 2:48 pm

NeuralStunner wrote:You can set its scale through ACS with SetActorProperty. 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 allExpand view
ACTOR BigTreeRandom : BigTree REPLACES BigTree
{
   States
   {
   Spawn:
      TRE2 A 0
      TRE2 A 0 ACS_NamedExecuteAlways ("BigTreeRandom", 0)
      TRE2 A -1
      Stop
   }
}


Code: Select allExpand view
#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
LilWhiteMouse
"Stop the world, I'm getting off."
 
Joined: 15 Jul 2003
Location: Maine, US

Re: Thing_SetScale?

Postby NeuralStunner » Mon Apr 09, 2012 2:57 pm

LilWhiteMouse wrote:You don't need to use TIDs.
True!

LilWhiteMouse wrote:ACS_NamedExecuteAlways
You can also use the much shorter CallACS.
User avatar
NeuralStunner
O'Neill with it.
 
Joined: 21 Jul 2009
Location: The Colonies

Re: Thing_SetScale?

Postby CaptainToenail » Mon Apr 09, 2012 3:42 pm

Ah, ok. :)
User avatar
CaptainToenail
 
Joined: 06 Jul 2007


Return to Feature Suggestions

Who is online

Users browsing this forum: FDARI and 0 guests