I got a item ( ex: wood )
i have a market HUD (done with widget HUD blueprint) which have wood i can buy (there is the cost in Gold piece under each item)
I want the value(float) to change by a “curve style”
ex : wood price rise up a little and after a while, goes down and up again later.
I just need a clue to start with? Which node or serie of node did i need ?
thx alot !
i need to get a timeline node to my float expression.
ex:
value of 5 at start
going up to 10 after a while
down to 3
and finaly returning to 5 at start
I would probably do something like add up a few sine waves with a different period and then just sample occasionally. By scaling each of the sine waves slightly differently you could have spikes and lows.
You could even get creative and try to represent another curve for the overall market and have some contribution from that.
my problem is that my number is a text in a widget.
So i need to Bind it with a function.
i cant “cast to” W_HUD any timeline to send time information in my fonction
@RyanB Ya, i was planning to have a global varation in % of each item. And have specials events that change % of certain item value.
Ill try to create my curve with Random Float in Range going up, and a another curve with Random Float in Range going down after.
If someone can help me, im really new here
You could use the float curves you mentioned in the earlier post from the AnswerHub. Just define a set of points in the curve and like Ryan mentioned, add some variation to it to create spikes and lows.
Instead of a bind, you could use a timer to run a function at regular intervals, that add up the timer interval to calculate the current time relative to the starting of the timer. Then use this ‘current time’ value to access the corresponding value along the curve. Of course this would still pose the problem of the current time exceeding the maximum time range of the curve. But to prevent that from happening, you could use the curve’s ‘get time range’ node to retrieve the min and max time along the curve and make the necessary adjustments so that you will be always retrieve the values in a repeating curve fashion.
to get it spawn. i use
" event tick – fonction "
in my main blueprint
and i create a variable in the delta seconds to slow it down (like 00000.5)
is there an another way to keep the fonction firing ? but like in 5 seconds interval ?
Sorry for the late reply, I didn’t get a notification from the thread in my email. So basically you’re trying to call the price change function every 5 seconds right? It’s always better to stay away from Event Tick unless you’re doing something that can benefit from using the tick. In this case, you can use the ‘Set Timer’ node to create a new timer. Give the function name & timer value (5 secs) as it’s inputs & set it to loop using it’s boolean input. This way the timer will automatically call the function every 5 seconds.