Turning a croup of actors on and off in RT

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

spatte

New Member
Feb 26, 2004
74
0
0
Sweden
Hi!

Maybe somebody can help me out with this one. I am making a forrest as a part of a research program at the Uni and I would like to have the names of the trees floating above the tree tops. Like in the screenshot

No to my problem. I would like to be able to turn them on and off when I am running the map, preferably with a single keystroke if possible. I am not much of a coder, so please be gentle in your explanations ;) Good tutorials and such are much appreciated

//Spatte
 

Attachments

  • sprites.jpg
    sprites.jpg
    77.2 KB · Views: 48

dug

New Member
Jun 14, 2004
11
0
0
Have you had success with this yet? If not, maybe I can suggest something, and more experienced people can correct my errors.

You could make the names be ScaledSprite objects, which you could place in the map above the trees. At runtime you could toggle the "bHidden" value of all of these sprites to make them visible/invisible.

I suppose the way to do this is to use the "Interaction" class to pick up the keystroke. Then iterate through all the ScaledSprites and change their bHidden value. There are two difficulties, though. Using the AllActors iterator would be a convenient way to find all the ScaledSprites, but this isn't available to an Interaction object because it isn't an actor. Also, if you're using ScaledSprites for anything else, you may not want to toggle their visibility.

A way around the second problem is to extend ScaledSprite with ToggleSprite, which could have a ToggleVisibility() function. Then you could look for all ToggleSprites and call that function for each, which would leave other ScaledSprites untouched.

There may be some easy solution to the first problem, but I don't know it. What I do is extend the pawn class (like ExampleBoy), and give it a function (say ToggleLabels) that will iterate through AllActors, find the ones I want, and call their function. Then in the Interaction (in the PostRender function) I look for PlayerOwner.Pawn and call ToggleLabels in that actor.

I realize this leaves many details unspecified. If you're still interested in the problem, I could be more specific. Maybe someone can suggest a better approach altogether, or tell us why this one wouldn't work.
 

Jojodi

New Member
Jun 25, 2004
2
0
0
hmm interesting idea.. I would say that each tree in the map could have a name and a US that could find the names of the X closest trees then draw those names at X height in their direction. hmmm... lemme study on it