UberDark's Recent Forum Activity

  • If it is anything like the webstorage and AJAX options for storing data it has to do with the fact it gets an error when retrieving the highscore. NaN means Not a Number. So it expects a number but gets text pretty much.. Usually this is an error message of some sort. Perhaps local storage cannot be reached from the arcade? Maybe due to a relative path situation?

  • Tokencount? Awesome!

    And then I just use the 'set size' and that will solve my problem yeeeeuy

    CHEERS LittleStain

  • I want to load data into an array but the amount of data depends on the mysql database and that amount of data can grow and shrink.

    I am placing little flags on a city map and have 4 bits of data coming in per flag. (id, color, x-coordinate and y-coordinate)

    The number of flags will change constantly though because users can add and remove them.

    So every time the map loads it gets the current flags (4 bits of data each) from the mysql database.

    I want to have a 2 dimentional array to load the data into and use a row per flag. So position 1.0, 1.1, 1.2 and 1.3 are the first flag.

    Then 2.0, 2.1, 2.2, and 2.3 for the next etc..

    But I don't know how many flags will be loaded so i cannot beforehand create the array since I don't know the size it has to be yet.

    So is there a way that i can either..

    -Check the number of bits of data that come in through AJAX.LastData (divided by a separator). And then quickly create the array in the right size and load the data into the array?

    OR

    -Create a 4x1 array and increase the Y size of the array on the fly while loading data into it?

  • I see! Cool glad you figured it out. Sorry i didn't understand.

  • For scrolling:

    Make one 16x16 object and stretch that to fit the screensize. Break the high resolution map up in smaller pieces and 'pin' those to the 16x16 object. Make the 16x16 object draggable. This way you only have to animate one object and have a map that can be higher than 2000x2000 pixels.

    For zooming:

    Now make a global variable named "Zoom' which has a default of 1 and set the layer scale to match this variable. On mousewheel-up add 0.2 to the variable 'Zoom' and on mousewheel-down subtract 0.2. On every tick set layer scale to 'Zoom'. If Zoom < 1 Zoom = 1.

    I hope this helps. I cannot open your file for i am using the last stable version and you hve a newer version of C2.

  • Works like a charm by the way.

    Awesomeness!

  • Hold on.. I initially asked if <script> was the way to go but you corrected me it should be <javascript>..

    Now you use <script>?

    Confusing haha

    Cheers though man. You rule

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In that case i was overthinking..

    Thanks

  • ramones

    Will it just forever be auto incrementing and leaving empty spots then?

  • lennaert

    Let me bother you some more maestro..

    I get the concept of what you are saying but since i only just learned a bit of php and now i have to get into javascript i am finding it hard to do.

    In Construct2 i should basicly do something like this?

    System>Set variableX to "ExecJS('username')" ?

    Is this correct? Or is it not ExecJS I should be using? Perhaps EvalJS?

    Completely lost it now..

  • Would you really think that would not be too much info to do all the markers every minute for every user? I mean.. just the locations and status perhaps but if i would allow a description for each marker of let's say 150 characters per marker that becomes a lot of data.. Interesting idea though. I thought every time a change was made just only change that entry in the database and leave all the other markers untouched. Not sure how i would identify the individual markers though since if i would use the database ID and markers get deleted the ID changes.

    So if person A and B both log in..

    Person A edits marker #5..

    At the same time person B deletes marker #4..

    This would cause marker #5 to become marker #4..

    Now when person A is done editting and the system autosaves that data it saves it to the wrong spot in the database.

    Or am I overthinking this now?

    Perhaps when a marker gets deleted I instead of actually removing it I should just make the database entry say DELETED and once a day at a specific moment remove all deleted entries at once?

    *scratches head*

  • There will be roughly 50 members so not likely more than a couple will use it at once. This is why I already decided to only send to database the current pin/marker that user is placing or modifying. I don't want people to often overwrite each others data by accident. If it happens once every now and then so be it. I know how to write to database now a bit so that is not really a problem, but I am not sure about specific problems this specific project will cause. For example..

    If I have 3 markers in the database and the second one will be deleted does this leave a gap in the database or in the array when I load the data into construct? I want to avoid that sort of things as much as possible. If two people are using the map at the same time and one deletes a marker but the other adds one I don't want it to cause a conflict. This basicly means I don't want to number the markers or use the ID in the database for identifying the marker.

    I will figure this out

    It is a wonderful learning project.

    Thank you for recommending the plugins I will make sure to check those out.

UberDark's avatar

UberDark

Member since 14 Jan, 2012

None one is following UberDark yet!

Connect with UberDark

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies