lennaert's Forum Posts

  • Here's a bit of a different thought of approach.

    Currently, with what you are attempting, there is a potential high bandwidth usage, with you trying to tell another player, at high interval, that something (a tree) is somewhere, and you will be trying to communicate regularly (sync) where its position and what its angle is.

    By any means, this is most inefficient.

    The tree wont move (at least, thats my expectation of a tree) so, telling other players its angle and position continuously is not helping aiding the mechanic of the game.

    You could try and have some a variable synced, telling the other player the state of the tree ... but this too .. is .. still too much. As it would continously check if some state has changed, and inform the other player.

    My apporach would be:

    If the map has been made in advance (on the layout editor), on both the host and the peer, then both the host and the peer already know where this static object is, the tree.

    Requiring the destruction of the tree on both ends, would only require 1 side, telling the other side, that a certain tree has been destroyed.

    Now, in actions and conditions: if I destroy a tree, send a message to the other player, containing ID of said tree, in a message indicating it has been destroyed on my end. In response, the other player receives the messages, and aptly destroys the same object.

    player

    Send message "destroytree" message "xxx" (some ID) to other player.

    other player

    on received message, "destroytree" , pick tree with id of lastmessage, destroy tree

    That just about sums it up for relaying the sate of a static object, with just 1 message, instead of a synced object, greatly reducing bandwidth/overhead.

  • From the manual:

    ImageWidth

    ImageHeight

    The original dimensions of the object (its current animation frame image size), in pixels. Since objects can be stretched at runtime causing the normal Width and Height expressions to return different values, these can be used to get the original size regardless of the stretched size.

    Its a matter of approach.

    perhaps, give the Templates a variable, "SelectedScale" (number)

    When sliding the slider scale, set the value of the Templates.SelectedScale, followed by setting that value in the Templates scale propperties.

    When selected the image to edit, grab their SelectedScale and set in the slider.

  • I am guessing the SelectAns.Y should be AnswerBox.Y

  • after adding header = "Content-Type" and value = "application/json" is actually working. and error "400Bad Request" is showing because server avoiding any duplicate entry. So I change data and then its submitting successfully.

    Fantastic !!

    Good luck

  • I use these two lines at the top of php pages to circumvent the cross origin policies:

    header("Access-Control-Allow-Origin: *");

    header("Access-Control-Allow-Headers: *");

  • I use arrays to store variables for settings and such, and save that array to local storage asjason.

    Perhaps that's an approach that could work for you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • lennaert

    I added header = "Content-Type", value = "application/json"then I got error "400Bad Request"

    "400 Bad Request

    The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing)."

    Going by this, you likely have an error in the format of your request (how its build up) Compare the output string with a working example.

    IF you test in a browser, with the browser development tools you can check the content of your actual request.

    When you have the app running, (in chrome) press ctr + shift + j, select network tab. Below should be a list or a link which performed the attempted request. When you click it, the tabs next to it have all sorts of info, from the actual headers to the content of your request.

  • Proof of success *Cheers

    https://i.gyazo.com/fe5e9679bf5b2b650e1ea8ea5d906342.mp4

    Very nice !!

    Looking good there AquarianDoll :D

  • Family objects Also have a UID (Templates.UID)

    Suggestion:

    Give that "text" an instance variable: ToDelete (number)

    Below set Text action, add:

    set value ToDelete = Templates.UID

    add a condition to that delete:

    Famlity Templates >> pick by UID (Text.ToDelete)

    Action Templates destroy

    This will leave your object name mechanic intact and add functionality to delete the template based on it's unique ID.

  • Try setting your ajax mime type before the request to something like: "application/json"

    Or you could try setting ajax request headers to:

    header = "Content-Type"

    value = "application/json"

    perhaps also

    header = "Accept"

    value = "application/json"

    Its been some time for me so I could be totally off ^_^

  • I made a very nice ghosting system some years back.

    Simply stuff all the data in a array, which you can use to loop through at a later stage.

    I used to store the ghost runs in local storage (array.asjason) and pass it to other players in a network game.

    Works pretty decent, looping through it; using moveto.

    The array lends itself for easily adding extra data (timing/tick, angles, sizes, etc)

    You can easy tweak how much data gets stored by either passing a timed interval (every x seconds) or somewhere in the midst of your code.

  • nvm

    I did a horizontal jiggy with android studio and got it to compile ...

    thanks anywaysz

  • Hi

    Using r251-2 because of using the cs2 engine.

    I get an error

    Error: Checking Java JDK and Android SDK versions

    ANDROID_SDK_ROOT=~~/androidSDK (recommended setting)

    ANDROID_HOME=~~/androidSDK (DEPRECATED)

    Using Android SDK: ~~/androidSDK

    :wrapper

    BUILD SUCCESSFUL in 0s

    1 actionable task: 1 executed

    Subproject Path: CordovaLib

    Subproject Path: app

    Configure project :CordovaLib

    [Cordova] cdvMinSdkVersion is overridden, try it at your own risk.

    Build-tool 31.0.0 is missing DX at ~~/dx

    Build-tool 31.0.0 is missing DX at ~~/dx

    FAILURE: Build failed with an exception.

    * What went wrong:

    Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

    Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.

    * Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    * Get more help at https:/~~/help.gradle.org

    BUILD FAILED in 1s

    Command failed with exit code 1: ~~/gradlew cdvBuildDebug -b ~~/build.gradle

    ~~~~~~~~~~~

    Any ideas ?

  • This is deliberately not supported to avoid the many compatibility nightmares that arise from doing just that. You should develop any unique features you need in your own separate addon using just your own code.

    Was worth a shot, thanks for the response.

  • Any chance of getting the video and the usermedia c3p addons for download?

    Wanna take look inside and see if I can extend some functionality.