URGENT HELP VARIABLE

Discussion and feedback on Construct 2

Post » Tue Jul 26, 2016 7:13 pm

Hello , I need help with an action construct 2. How I can do the following ?

An initial variable is 0 .
As the game progresses , the variable changes for example 1, 2 or 3 .
In every change , whatever it is I need an action .

I need to do the following:

EVENT: When the variable change = execute an action .


Please respond urgently .

Thank you very much.
B
10
S
2
Posts: 205
Reputation: 1,619

Post » Tue Jul 26, 2016 8:08 pm

@amariscal

See this:
feature-request-trigger-on-variable-value-change_t82052

Read Ashley's answer
B
10
S
3
G
1
Posts: 46
Reputation: 1,261

Post » Tue Jul 26, 2016 8:09 pm

variable = 1(or 2 or 3 or 4)
trigger once while true

actions .....
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Jul 26, 2016 9:55 pm

Thanks for your help but does not help me . What I'm trying to accomplish is the following:

The mobile GPS sets the name of a street and transforms it into a text variable . Every time we change street , the text of the variable changes to the name of the street where we are.

I need you every time you change , destroy an object , for example :

The GPS provides that we are in the street named : Main Street . The text of the variable becomes " Main Street" .

When we move , and the GPS detects a new street , the text of the variable becomes the name of the new street, for example "Main Street 2" .

When this simple change is made , it is when I need to change the variable an object is deleted.

Someone could help me somehow ? Capx some example ?

Thank you very much.
B
10
S
2
Posts: 205
Reputation: 1,619

Post » Tue Jul 26, 2016 10:20 pm

B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Jul 26, 2016 11:28 pm

Var1 = "main street"
Var2 = "last street"

If var1 different from var2
trigger once while true
do action
set var2 to var1
B
124
S
43
G
41
Posts: 849
Reputation: 28,235

Post » Wed Jul 27, 2016 8:30 am

thank you very much if interest and help. Unfortunately I still do not get it to work . I need a function like textbox ( on text Changue ) that allows simply by changing the text variable to another an action is executed. Any ideas? Thank you
B
10
S
2
Posts: 205
Reputation: 1,619

Post » Wed Jul 27, 2016 8:59 am

This is an example of my project : 1 Every x second : set location ( geolocation plugin) 2- Every tick : set value ( for global variable) - latitude & longitude ....... Now I need that when the variable that longitude and latitude set switch to another , no more or less so , simply change , run an action
B
10
S
2
Posts: 205
Reputation: 1,619

Post » Wed Jul 27, 2016 10:09 am

amariscal wrote:thank you very much if interest and help. Unfortunately I still do not get it to work . I need a function like textbox ( on text Changue ) that allows simply by changing the text variable to another an action is executed. Any ideas? Thank you


That is exactly what i showed you. A string pulled from a 'list' or a 'textbox' is stil just a 'string'. Bringing it in a 'function' you must be able to do yourself ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Jul 27, 2016 10:49 am

Yes, but when I use for example in action Changue textbox does nothing . only performed when the change in the textbox is done by writing into it, not when it is done automatically
B
10
S
2
Posts: 205
Reputation: 1,619

Next

Return to Construct 2 General

Who is online

Users browsing this forum: C4rtman, spartan05 and 7 guests