How do I store multiple object's position, to be created later

0 favourites
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Now its working

    Thank you so much

  • dop2000

    I have done everything. Now i am saving those data into arrays.

    I have 2 types of data files, 1 file is saving dots object and another files is saving steps object.

    I want to save dots in (x0-x25) Y0 and steps in (x0-x25) Y1. When I do x = Array.IndexOf(0), y = 0, value = AJAX.LastData

    then data is saving in y0 but when i do x = Array.IndexOf(0), y = 1, value = AJAX.LastData, then its not saving to y

    what i am doing wrong in these events.

  • I don't know. Run the project in debug mode, check array contents, try changing events, check debug mode again etc. It's basic troubleshooting.

  • i am doing it from few hours not getting.

    i have named files as A1, A2, A3 ... and step1, step2, step3 ...

    so i am doing when ajax > on completed tag "A"&loopindex

    nothing working

    i also made a variable and everytick add 1 to variable

    and then on tag "A" & variable

    still not getting

  • No, that won't work.

    You need to use "AJAX On any completed", and inside this event compare AJAX.Tag. If you need, you can also get file number by removing "A" from the tag, for example int(replace(AJAX.Tag, "A", ""))

  • there is no way to compare tags after "Ajax on any completed".

  • Yes, there is. From the manual:

  • this is in action side not in condition side

  • It doesn't matter! AJAX.tag will return tag anywhere in this event.

    Look, this guessing game is taking too much time, you need to post your project file if you can't figure it out yourself.

  • I got it

    it working now

  • on any completed > i removed "A" from tag in x index and last data in value

    now its working

    but there is no comparing tag, means i did not compared any tag here

  • Well, if you have different AJAX requests in the game for different file types, you might want to add conditions like these:

    System compare two values (left(AJAX.tag,5)="steps") ... Array set value... 
    else
    System compare two values (left(AJAX.tag,3)="dot") ... Array set value... 
    
  • No, file types are same .txt files but they have 2 different object's data

    Now i am able to save data in array.

    a small thing is happening here

    on start of the layout I did ajax requests

    first 25 are dot and others are steps

    In y0 dots saved perfectly but in y1 steps x0 is saving data of 25th of the dot

    when i moved ajax requests 26-50 to top and 0-25 to the bottom then y1 is saving perfectly and y0 is saving data of 25th of the step.

    what may reason?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • See my previous comment, change your code accordingly and it should work.

    If it doesn't, you'll need to post your project.

  • thank you thank you thank you so much

    finally no issues

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