AnD4D's Forum Posts

  • I have a JSON file similar to the following:

    {
     "data": [
    	 {
    	 "name": "Bob",
    	 "condition": {
    		 "health": "100",
    		 "married": "yes",
    		 "age": "34",
    		 }
    	 }
     ]
    }
    

    I understand that I can do:

    For Each data
    	For Each .name - JSON.CurrentValue
    

    But I can't quite figure out how to get a specific lower value. For example, I'd have thought:

    For Each data
    	For Each .condition
    		For Each .age - JSON.CurrentValue
    

    Would work... but it doesn't. It all comes up blank.

    If I do:

    For Each data
    	For Each .condition - JSON.CurrentValue
    

    It'll post "100, yes 34" to me, but how do I specifically grab just the one I want?

    In the manual it suggests I do ".condition.age - JSON.CurrentValue"

    But that doesn't work either. Kinda at a loss here...

  • Is it possible to have C3 listen to a PHP file that's stored on a web server, so when said PHP file is changed it downloads the data?

    Honestly scripting is something I simply do not understand, which is why I love Construct so much.

    Basically, I have a PHP file already in place on my server which is being fed data. I want that PHP file to update another PHP file (or whatever is more useful) with JSON data.

    Then when C3 notices that the file has changed, it will download the data and act on it.

    Does that make sense?

    I have systems in place where C3 will listen to a Twitch channel's chat, as well as a Discord server at the same time, reacting when someone writes a message, but I need to be able to react to an event.

    So close... just missing a few more steps.

  • Ah, sorry, the 'and' symbol - &

    Sorry for not responding, but that worked! Thanks :)

  • Just to clarify, is it the at symbol of the and symbol?

    The first example showed both, and the second showed just the at.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • (Edit - Apparently Scirra hates my at sign)

    ughuwh@broadcasterlanguage?

    https://dev.twitch.tv/docs/api/reference#modify-channel-information

    Twitch specifically say it must be PATCH rather than POST (as do other people who have apparently gotten this working) :(

    I've never had any luck sending DATA through Construct. I tend to send things simply up updating the URL.

  • I've always wondered this, so figured I'd ask here.

    How should I go about posting this kind of information? Is is best to do something like this via javascript?

    {"game_id":"33214", "title":"there are helicopters in the game? REASON TO PLAY FORTNITE found", "broadcaster_language":"en"}
    

    This is the example given. Seeing as Construct always seems to struggle whenever a " appears, I immediately knew this was going to be a problem.

    Does anyone have any idea how I should go about posting this? It's odd that it's asking for a PATCH, but then again, I don't know anything about this kind of thing :D

  • Hey, i have already written successfully a discord bot.

    how it works:

    construct 3 (or any other engine) - (websocket) -> node.js app (linux) (discord.js) -> Discord

    and vice versa

    My Discord-Channel/Contact: discord.gg/6ApWyYct

    So this requires an offline program? Can I just set it up with Construct 3? Does it do everything I need it to do as listed above?

  • I have multiple text inputs spread across multiple layers, only one layer is visible at any one time.

    https://1drv.ms/u/s!Am3CPIM7woZ9i40FKOMzUQ1gVGBunw?e=arBiee

    I want to be able to press tab, and it'll take me to the most logical textinput.

    At the moment, Construct 3, in all its wisdom, does it in the order in which the textinput was created, ignoring the fact that sometimes we change our minds later in production.

    In any case, after reading these forums, I thought I read that it was possible to set it based on the Z index of an object, but I've used the "sort z order" action, and that's not worked.

    Does anyone know why we can't adjust the z index of these items?

    Also, while I'm at it, why do these items always appear above the other objects, such as sprites?

    I once used a plugin in Construct 2 where I could display an iframe behind sprites by setting it's z index to -1.

    So yeah, what are my options for fixing this tab issue, beyond recreating all of these textinputs?

  • I want to be able to connect to a Discord and have Construct control the following:

    1. Change user roles

    2. Change user Nicknames

    3. Post messages

    4. Read messages

    I want to be able to put this code into future projects, so I don't want random plugins and external programs.

    I've seen things like this done here:

    https://www.construct.net/en/forum/construct-3/your-construct-creations-9/made-construct-host-discord-155284?utm_campaign=forumtopicemailsub&utm_medium=email&utm_source=1045946&utm_term=txt3-read-eren%2527s-post#forumPost1045946

    So I know it's possible. Please let me know your price :)

  • >

    Yeah the post is quite old and the video was filmed pretty much the same day i got it to work so it has been though some changes.

    As for discord.js it has decent documentation here docs

    when i first started trying to get it to work i did have to change the endpoint. so you may have to look into that.

    but that pretty much all i can help with because i made it so long ago.

    Darn... was gonna start throwing money at you as incentive to get it working.

    Been trying to make a Discord bot through Construct for months now. Being able to change people's roles based on a program I've been making.

    Let me know if you ever feel like coming back to this :)

  • You did all this code yourself, DrMeepso ? Wow! How on Earth did you figure this out?

    Looking at it now, I can't make head nor tails of half of it, and it also appears to be different to the video example.

    This looks like it listens to a Discord, while your video version posts to a Discord.

    Also, "SendDiscordMSGToMainChannel" never appears to be called.

    I'd love to work on this more with you if I can twist your arm? :D

    EDIT - Yeah, I seem to be hitting the CORS issue, too... The Discord API references and instructions are pretty terrible. Doesn't seem to make sense that I can connect to Twitch with relative ease, but Discord is a confusing mess.

  • Thanks, DrMeepso

    That's disappointing to hear. I've been trying to figure this out for a while. Maher to connect to Twitch API without too much issue, but Discord just looks complicated.

    Do you have any other tricks up your sleeves?

    I'd hate to get this close and walk away.

  • I think you can enable/disable the depth buffer per layer. So turn off 3D on the hud layer and it should work I think.

    Haven’t tried it but it was hashed out in the releases after they added it.

    You're right, R0J0hound

    Rendering mode > 2D or 3D :)

  • Am I right in thinking that 3D objects don't care about layers? I have a 3D object on layer 0, and a HUD on layer 5... but the 3D object appears above that because it's taller.

    The only way to fix it is to either move the 3D objects down below the lowest level, or move the hud up... both of which alter their visible X and Y positions.

    So yeah... am I right or wrong?

  • Eren Wow, that's very clever. Having Discord interact with Construct would certainly open up a few options.

    I've been working on a Twitch Bot with Construct for the past 2 years, and I'm hoping to add some Discord interactivity to it, too.

    What do you use these features for?