URGENT HELP VARIABLE

0 favourites
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • 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.

  • amariscal

    See this:

    Read Ashley's answer

  • variable = 1(or 2 or 3 or 4)

    trigger once while true

    actions .....

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Var1 = "main street"

    Var2 = "last street"

    If var1 different from var2

    trigger once while true

    do action

    set var2 to var1

  • 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

  • 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

  • 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 ?

  • 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

  • Do you actualy plan to use a textbox? (besides that On text changed works flawless)

    I read this "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""

    Till there it is about a changing string, and when the string changed an action is required.

    I used a list to simulate a changing string. It does not matter how the string is changing, the principle is the same.

    Write previous state of the string in a variable. Compare to the current string. If they are different, do the action & set the previous state of the string to the current state. I think that is pretty clear in the example, no ?

  • Thank you very much , I've got to make it work but with some flaws . The geolocalizacion plugin does not detect an exact position . When I add the following: Set location EveryXsecond ------ Doing this shows our current position by latitude and longitude, but the latitude and longitude varies every second and never leaves an exact figure.

    Any suggestions ?

    Thank you very much.

  • Lets meet halfway.

    You provide a CapX with 2 things :

    A changing string variable & and a function that does some action.

    I will alter it.

  • I am preparing a capx for you to see my project and can help me. Thank you

  • Here I leave my project : https://www.sendspace.com/file/j74y6s

    In the project and including the capx and plugins I use.

    What I need is the following:

    When the player moves and change its location , you must run an action . The action is as follows:

    Create a new Marker ( For example Marker2 ) in a position close to the main Marker, but not the exact position if a slightly longer or shorter distance , so that the player has to move to get a new location for JOINING the " Marker2 " .

    Do you think it will be able to help me do you think ?

    Greetings , thank you.

Jump to:
Active Users
There are 2 visitors browsing this topic (0 users and 2 guests)