x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How should i go about creating a trending curve from a proximity value with a diegetic-interface?

I need to make a trending curve for a handheld scanner and that scanner works as HUD aswell. The scanner will show a trending curve of an object how close it is located = closer the object the higher will the curve go.

How would one go making this kind of complex system? alt text

The curve will update for like once per 2 seconds or something in that line (easily changeable so it doesnt matter).

So how would you do this:

  1. There is an "toxic" object in the game space somewhere

  2. Something calculates distance to the toxic source and saves a value

  3. The value will be visualized into the handheld scanner screen with a black pixel in height determined in the distance value.

  4. Handheld scanner will fetch this value for every 2 seconds and draw a new black pixel next the last on right.

  5. By doing so you would get a "snake" like trending curve to draw a graph of where this object is located and you can pinpoint where in the map this "toxic" object is.

Also how do you make it so that the graphic is updated on the handheld scanner screen?

This is troubling me alot and the helper is most likely going to get something for the help :) (something just to show my appreciation)

Diegetic interface is just like in Dead Space that health bar system in back of the character and in this case it should be on the scanner we pick up from a table!

Product Version: UE 4.15
Tags:
more ▼

asked Mar 01 '17 at 08:16 PM in Blueprint Scripting

avatar image

3DKolehti
3 1 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You could do this using CanvasRenderTarget2D. I'll show you a basic version below which should give you some ideas.

  1. Make a new Blueprint Class, and choose CanvasRenderTarget2D as the parents class. Mine is named BP_CanvasRenderTarget alt text

  2. In that Blueprint, add the below nodes. Add two float variables, Width and Height. And add a float array with 20 elements, changing the amount of elementscontrols the 'granularity' of the graph.

alt text

  1. Make a new material, mine is called ScannerScreenMaterial. In it, add a texture parameter named TargetTexture. Give it the default texture, and plug it into Base Color.

  2. Make a new Blueprint actor. Mine just has a cube mesh (Named "Scanner") that I will apply the above graph material to. Also add a material instance dynamic variable, called ScannerMaterial. Add two float arrays, once called Distances, and one called ShiftedDistances, make sure both have 20 elements. Also add an Actor variable, and make it editable, this actor will be the actor whose distance to you will be checking. You need to set this from somewhere that makes sense for you project, for me for testing I just used a random object in the scene, and set it in the details panel in the level.

Construction script:

alt text

The Parent material, is the material you made in the previous step.

alt text

Add the above on begin play. The Canvas Render target class should be the BP you made in the first step. The time on the function will control how often the graph updates.

Then create a custom event that matches the name in the time, "UpdateScan". And set up the below: alt text

Note that you will need to set a max and min distance that makes sense for your usage.

Example working below. I was using that cube as the target actor:

Animated: http://imgur.com/nNXDsPE

alt text

1.jpg (156.7 kB)
2.jpg (562.9 kB)
3.jpg (156.9 kB)
4.jpg (229.0 kB)
5.jpg (506.7 kB)
more ▼

answered Mar 03 '17 at 04:54 PM

avatar image

Mosel3y
1.8k 49 20 67

avatar image 3DKolehti Mar 10 '17 at 12:51 PM

That. is. brilliant! I will test those out and try to bring my project to an end... I will get back to you! You have been a huge help!

avatar image Mosel3y Mar 10 '17 at 12:54 PM

No problem, let me know if you encounter any problems.

avatar image 3DKolehti Mar 12 '17 at 10:21 PM

I started putting things together and got little confused of where some of the variables are meant to be and now i get reference errors... doh!

reference error

I think the problem is in my material.. settings it up is weird.

TargetTexture

I made a instance from the material to create MyRenderTarget with "TargetTexture" ticket.

alt text

I'm definitely doing something wrong here haha... but i was able to get something to "Render Target" slot atlast.

So many nodes and things to play with so i got little confused and now i cant use render target as Target.

avatar image 3DKolehti Mar 12 '17 at 10:22 PM

Also

alt text

avatar image Mosel3y Mar 12 '17 at 10:54 PM

Hey, here is the project with my setup in it for you to take a look at. The relevant files are in the Draw folder in the content browser. https://dl.dropboxusercontent.com/u/143773194/Projects/Draw.zip

edit: Your RenderTarget variable needs to be of type BP_CanvasRender, or whatever you named your custom CanvasRenderTarget2D blueprint class

avatar image 3DKolehti Mar 12 '17 at 11:23 PM

I will look at your project and inspect... meanwhile: I named it same as you did in the example but i cant see it? alt text

EDIT: UE is throwing an error with the project :/ EDIT2: I need to update... alt text

canvasrender.png (25.7 kB)
error.png (18.0 kB)
avatar image Mosel3y Mar 12 '17 at 11:28 PM

Not the texture, the actual variable type. Yours is set to Texture, but it needs to be BP_CanvasRenderTarget

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question