Very basic problem...about variable with use with bar

How do I…

Very basic problem…about variable with use with bar

I need to retrieve a simple data from a call api… i need to take a portion of the forex api data…with substring function… but i cant use that data to trim a simple bar that i want use…can somebody help me please with a simple example??? i enclose here 2 screenshots to show you more better my problem… thanks a lot in advance.i 'm a new gdevelop happy user. Bye Lestroso


It’s checking the value of an object variable but I don’t see where the variable is being set only the text.

image

You need to set both the text and the variable where you retrieve the values.

The waits also aren’t going to work as I suspect you’re thinking.
image
Wait adds a wait at the point but the rest of the scene keeps going. So, it adds a 5 second wait then continues and on the next frame it adds another wait and so on. When the wait expires, it will trigger the event after the built-up waits. It will act more like an initial delay. The wait 20 seconds doesn’t have any events or subevents directly under it, so it won’t do anything.

In this example: purple is the main path. The orange arrow and box are the events that get triggered each time the waits expire.

I was curious where the waits are executed. Evidently, it’s in between frames. (IDK if it’s post or pre events)

here are the events:

and the results

You can see initially only a,c and e are being added to the text object. It adds a space at the end of each frame. So, you can see each frame. Once the wait expires, the B and D start to get triggered. The waits don’t expire exactly frame for frame as they were added. So, sometimes 1 wait expires and other times 2 expire so then it skips a frame because nothing expired on that frame. At the same time, more waits continue to get added.

dear keith… can you show me an example please how i can retrieve my data for text and variable you said .“eurusdvariable2”…to set my bar??? best regards lestroso

Where you set the text objects, you could set the object variable and the set the text object to the object variable or you could use the text object’s text value directly using ToNumber() to convert the string to a number with a compare 2 numbers.

You’re using SubStr() to put data into text objects eurusdvariable and eurusdvariable2. This sets them as strings to the text property. It then checks for the object variables but the object variables aren’t set. You could check the text directly with the compare text condition except that would compare it as text instead of a number and the text condition doesn’t have a greater or less than operands like numbers.

You can use compare 2 numbers
ToNumber(eurusdvariable2.Text::Value()) > 9200

Or where you set the text object’s text, you could also set the object variables the same way you set the text object’s text.

I prefer the variable route so you don’t need to keep using ToNumber()

I’m on my phone. Later, when I’m on my PC, I can add a screenshot if I’m not explaining it clear enough.

Dear Keith…i’m sorry for my delay for my reply…there’s no words to say for your help…i’m so glad, happy and i want to give you my greetings and shake your hands…your are a friend…now my friend…i’m tryining to experiment the words you say…but now…i don’t have much time to work with gdevelop…but i’m still working in this month…but not continuosly…because i’m working for a electronic project with arduino …but as i can i will dive in this my problem with gdevelop and variable to build my forex dashboard…thanks a lot again…Lestroso…(Saverio Monopoli)

1 Like