Suggestion Issue: Block for getting actor's actor type name


Pages: 1

irock

  • Master Stencyler
  • *
May 03, 2019, 05:02:29 pm
In design mode, if you want to check if an actor is of a certain type, you have to compare entire actor types, like so:



However, the only information you're really interested in is the actor type's name, rather than all the other information that comes with actor types, so for efficiency it's better to use actor.getName().

« Last Edit: May 03, 2019, 05:03:05 pm by irock »


Luyren

  • Master Stencyler
  • *
May 03, 2019, 06:02:09 pm
If you wrap the actor type getter in a "as text" block you will get its name, and you can use that just like any text block. Just tested it on b10321.


irock

  • Master Stencyler
  • *
May 04, 2019, 03:16:31 pm
If you wrap the actor type getter in a "as text" block you will get its name, and you can use that just like any text block. Just tested it on b10321.
Is it not still inefficient, because you're still getting the entire actor type?


Luyren

  • Master Stencyler
  • *
May 04, 2019, 09:16:33 pm
Is it not still inefficient, because you're still getting the entire actor type?
I don't think I understand what you mean by "entire actor type". I attached an image of what I meant on the previous post.

Edit: I re-read your post, got an idea of what you meant and I definitely cannot comment on the efficiency of it. Still, that's the method I use for names and such.
« Last Edit: May 04, 2019, 09:19:36 pm by Luyren »


New attachment added by Luyren - May 04, 2019, 09:16:46 pm


Justin

  • Master Stencyler
  • *
June 27, 2019, 06:16:19 pm
It'll just compare the objects. If it's the same actor type, then it's the same object, at the same memory location in the computer. Quick and efficient.


Pages: 1

Details

  • Reported
    May 03, 2019, 05:02:29 pm
  • Updated
    June 27, 2019, 06:16:19 pm

  • View Status
    Public
  • Type
    Suggestion
  • Status
    New
  • Priority
    Normal
  • Version
    (none)
  • Fixed in
    (none)
  • Assigned to
    (none)
  • Category
    Design Mode Blocks

Tags


Attachments


* actortypething.png (33.33 kB, 1056x443 - viewed 539 times.)