R0J0hound's Forum Posts

  • You’d get pi from some place like this:

    geom.uiuc.edu/~huberty/math5337/groupe/digits.html

    And copy paste it, or a portion of it into a variable.

  • Numbers are stored in 64bit numbers so that gives only about 15 digits. That seems like that’s what you are seeing.

    If you want more digits of pi you’ll need find an algorithm to calculate digits of pi, and a way to do it without the limits of 64bit numbers.

    The simplest solution would be to just store pi to as many digits as you need in a text variable and use the mid function to get digits.

  • Speaking about links, is there any word on all the missing links in posts? Almost all my links to files on Dropbox and such are just gone, or the url is chopped.

    Anyways just curious. I probably won’t be fixing or re-adding the links in my posts myself.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Else will only run if the mouse isn’t over any buttons. If you move the mouse fast enough you can move it from one button to another without being on any resting space.

    Anyways it’s not a bug, but is an expected behavior when multiple instances are involved.

    There are a few ways you can do it differently so it does what you want. The first is to make a “for each button” event and put your two conditions as sub-events.

    Another idea is to just not use else and use an inverted “is over button” condition.

    Probably what I’d do is

    Every tick

    — button: set frame to 0

    Mouse is over button

    — button: set frame to 1

  • I don’t have time for a while to open construct.

    You can just throw that in a system compare condition. That expression for the first part and 1 in the second.

  • To use or in an expression you have to do it like this:

    Sprite.x=22 | sprite.x=33 | sprite.x=66

    So you’ll probably want to store the the long position expression in a variable first to simplify.

    If you do stuff like that a lot you could make a helper function to simplify things further.

  • The logic to do moving platforms would ideally be:

    1. Move player

    2. Find the platform the player is on, if any.

    3. Move the platform, and move the player by the same amount if they were on it.

    But because of when the behaviors run it can end up being:

    1. Move player

    2. Move platform

    Or

    1. Move platform

    2. Move player

    Depending on their order in the engine. It’s not something you can control. That’s what can cause them to not be synced.

    The platform behavior does have logic to move with the platform it’s on, but it depends on which is moved first I suppose.

    You probably don’t want to create a platform movement entirely with events but that would give the most fine control of stuff. On the other hand, it can be tricky sometimes to move stuff with events or other behaviors in a way to keep other behaviors happy.

    In this case you probably can get away with it. So instead of using a motion behavior on the platform you’ll want to move it with events so we can do that ideal method listed above.

    Here’s some simplish events to do that:

    Global number onPlat =0

    Global number dx=0

    Player: is overlapping platform at offset (0,1)

    —- set onPlat to 1

    Else

    —- set onPlat to 0

    Start of layout

    —- platform set speed to 200

    Platform.x >400

    — platform: set speed to -200

    Platform x < 100

    —- platform: set speed to 200

    Every tick

    —- set dx to platform.speed*dt

    —- platform: set x to self.x +dx

    If onPlat = 1

    —- player: set x to self.x+dx

    Now that assumes just one platform that just moves to the left and right from 100 to 400.

    Multiple platforms could be done by saving the uid of the plat the player is on and only move the player by the amount that play moves.

    Also you can make the platform motion as complex as you like. Just move the player by the same amount.

  • There are a fair amount of places where it can't work so I'd recommend testing every step of the way to verify it's working.

    Like when you do the ajax request, verify it works by setting some text in the "on complete" event. If it doesn't, then maybe look at the manual portion of ajax for ways to see what the error is. Maybe a bad request or something.

    If that works then you could set the text to the returned text to see if it indeed is the data you wanted.

    Next you can do the action to set the "data" variable. Open the browser console. Are there any errors? With the console open type "data" in the prompt. It should show a collapsible tree of the json.

    So the same for any other js you run with the browser object.

  • The website transition was unfortunate since urls where omitted or broken. Maybe they will fix that with further website updates. I'm not going to touch it though.

    A workaround idea could be to use the wayback machine to look at an archived version of the old forum with the link text still intact.

    web.archive.org

  • You use a the ajax object to request the url to get the string.

    There may be a json plugin that lets you parse the text, but you can also just do it with javascipt via the browser object.

    Basically you'd do something like:

    Start of layout

    --- ajax: request url "www.myurl.com/data/"

    on ajax complete

    --- browser: execute js "window.data=" & ajax.returnData

    --- text: set text to browser.execjs("data[0].points")

    Or at least very similar. I didn't bother to check if that's the correct names of stuff.

    It uses window.data to make data a global js variable. This doesn't work in all exports.

    So then in js you can access the global "data" variable to get at your values. Maybe a basic js tutorial could shed some light on this. Typos or errors would spit something to the browser console.

    That json is an array of two dictionaries, so you could start with the above and create some events to create two dictionaries and populate them i suppose.

  • Put both objects at 100% opacity on a layer, and set the layer to 50% opacity.

  • Chome updated so that audio cannot play without a click or tap first. This broke audio in c2 games as well as html5 games everywhere. About 5 versions ago c2 included a fix, but a tap or click is still needed.

    Maybe Firefox followed suit with chrome. Idk.

    In short you need the latest c2 to for audio to work in the latest chrome. The game still need a tap or click first though.

    Audio will work as before if you use older versions of c2 before the fix with older versions of chrome before the change.

    At least that’s my understanding.

  • They deleted all private messages on the 4th of this month. It's in response to the GDPR. I believe it simplifies Scirra's compliance by having all communication between users as public.

    There was a post by Tom about it a few weeks ago. Also he mentioned it again in one of the website issues topics. I'm having no luck finding it though, there is no search on the new forum, and a google search didn't yield anything on the new site, so ehh.

  • You can probably do it with multiple physics objects connected with joints.

    Bare basics would be a two wheels connected with pivot joints to a frame. Acceleration could be done by applying a torque to the wheels which would cause forward motion when in contact with the ground due to friction.

    There are at least three physics behaviors to use. One bundled with C2, and two third party (one isn't free).

  • It was ported to Unity.

    You didn't read the link. It wasn't.