Padman's Recent Forum Activity

  • Problem solved, many thanks.

  • Hello everyone,

    i have some trouble with the scroll to feature.

    Every anchor i set looks like the object is pulled behind.

    here is a capx as example.

    dropbox.com/s/ulj625ojcr2ui0c/scrolling_question_anchor.capx

    is there any way to really "fix" the object? I need it to fix a UI for the worldmap.

    thanks a lot in advance

    padman

  • i solved this problem with a manually builded drag and drop... but it would be good to know if there is any other way

    for the manually drag and drop:

    scirra.com/forum/handmade-drag-and-drop_topic45111.html

  • Hello everyone,

    is it possible to start the dragging of a object via an action?

    I create a object via click on it, then i want this object to be already in the status "Drag n Drop is dragging" when it's created.

    If you need something, let me know.

    Best Regards

    Pad

  • the result in the text box is 0 if i transform it to a string, not 300.

    Is there any way to get a log or debug information?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • hi ramones, did not work.

    just to verify, that is what i have done:

    step one:

    created array in construct with properties:

    width: 1

    height: 3

    depth: 2

    step two:

    loaded this string via ajax:

    {

    "c2array":true,

    "size":[1,3,2],

    "data":[      [ [300],[25] ],

         [ [100],[50] ],

         [ [800],[10] ]

    ]}

    as i understand now the size is similar to the array in construct, so

    • "size":[width,height,depth] - correct?

    step 3

    use the function Load from JSON string with ajax.lastdata (or the string itself)

    step4

    set debug.text to array.at(0,0,0)

    array.at(0,0,0) should be 300, right?

    If i get this thing working i will write a tutorial about it -.-'

    otherwise i have to fill my array with a splitted string...

  • Until anyone has a good idea i helped me with tokenat().

    I have to do many more requests with ajax, but this one is working fine.

    in my case i created this string:

    $string = '3;100;20;200;10;50;40';

    the first value is the count of mobs and behind n-variables.

    then for i <= int(tokenat(ajax.LastData,1,";"))

    set hp = int(tokenat(ajax.LastData,loopindex,";"))

    set speed = int(tokenat(ajax.LastData,loopindex+1,";"))

    hope this will help someone somewhen

  • yes, this one is manually created... i used some examples (found very few) from here for that.

    my first try was to generate it with php and json encode. but this didn?t work either, so i tried it manually.

    the json encode gives me: [{"hp":300,"speed":25},{"hp":100,"speed":50},{"hp":800,"speed":10}]

    phpcode:

    $mob[] = array('hp' => 300,'speed'   => 25);

    $mob[] = array('hp' => 100,'speed'   => 50);

    $mob[] = array('hp' => 800,'speed'   => 10);

    echo json_encode($mob);

    is there any kind of dokumentation of this special format? :(

    regards

    pad

  • Hi Ashley,

    thanks for your response.

    I already read the documentation.

    I want to read something from a database and put it into an array in construct, so i can`t use a simple file in my project folder, right?

    The server is already configured, so this is no problem. Ajax requests are working fine. If i open localhost/project/index.html i can use the ajax funtcions and receive the data. Here a screen, i putted the ajax.lastdata in the text box:

    https://www.dropbox.com/s/9s6jl2ss782gs3w/ajax_form.PNG

    The problem is that the json load function won?t work. (i already tried to put the output directly in with double ", didn?t work either).

    I uploaded the file here:

    Link Capx

    only the mob_load ajax function is neccessary. the rest is testing stuff.

    the output from the mob_load.php is:

    {

    "c2array":true,

    "size":[3,2,1],

    "data":[      [ [300],[25] ],

         [ [100],[50] ],

         [ [800],[10] ]

    ]}

    hope this will help.

    thanks and regards

    pad

    ps. didn`t know that u can?t use a \' here!

  • Hello everyone,

    this is my first post here. <img src="smileys/smiley1.gif" border="0" align="middle" />

    I am testing arround with Ajax and JSON (I used both techniques before).

    My objective is simple, receive some data from a database, create new object, set some variables.

    Well... the LOAD function is not quite specified in the manual, so maybe i have a simple syntax error. Here we go:

    1. Every 5 Seconds: Ajax Request "http://localhost/mob_load.php"

    2. mob_load.php's output:

    {"c2array":true,"size":[3,2,1],"data":[ [ [300],[25] ], [ [100],[50] ], [ [800],[10] ] ]}

    3. Ajax Request finished: Load from JSON string(ajax.lastdata)

    4. Set Text debug 1: ajax.lastdata (just to check if the ajax request is fine)

    5. set text debug 2: array.at(1,1,1)

    Everything is working fine, except of step5. Nothing happens.

    May someone can help me with this. :)

    Thanks in advance,

    Pad

    *EDIT*

    I saw that this post is almost identically to mine:

    scirra.com/forum/im-missing-something-with-the-ajax-object_topic53614.html

    (i searched before the post was created...)

  • Hello, everyone. I'm Patrick(pad) from Germany. I used to be a developer in java/java-script/php/perl/asp/c# and have a lot of experience with databases and project management.

    I found this great program while i was developing my own javascript engine for my first mmo-project. After i looked up some features and tested a bit with construct i decided it had all i need (specially because i can write own plugins).

    If you want to know anything, just contact me.

    <img src="smileys/smiley1.gif" border="0" align="middle" />

Padman's avatar

Padman

Member since 21 Jun, 2012

None one is following Padman yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies