randomly's Recent Forum Activity

  • If I understand you correctly, please do this:

    Create this Function:

    Whenever your money or the price of a tower changes, execute this function.

  • Cannot read property 'ApplyLinearImpulse' of null

    Judging from this, it sounds like the action is trying to apply an Impulse on an object that doesn't exist.

    Since you said that the error occurs when you are in a different layout than the one the game saved before:

    • Can the object that you are applying the impulse to be destroyed?
    • What kind of object is it that you are applying the impulse to?
    • What physics type are you using? Did you try to change it? (Project properties -> asm.js/web

    Can you also try to put a "Wait dt seconds" before you apply the impulse?

    If all this doesn't help, you can try to save the object's status' in an Array and save the Array as JSON in LocalStorage.

    This will, of course, be a very tedious thing to do, but if it's the last option, you might wanna do this instead of leaving the error in your game.

  • Try Construct 3

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

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

    Don't know whether this is intentional or not, but your app recently stopped showing descriptions.

  • You can either use the System action Scroll to: Player.X, Player.Y, every tick

    or

    You can apply the Scroll To behavior to your Player

  • We will definitely need your project .capx or at least a shortened version of it to reproduce the possible bug and to help you with this.

    I am positive though that it is no bug and just a line of code that needs to be changed.

  • You can always use this workaround:

    - (Condition) Is touching object [Button][/code:2p05s6u7]
    If you are using the mouse, you can use this:
    [code:2p05s6u7]- (Condition) Mouse is over object [Button]
    [ul]
    	[li](Condition) Left mouse button is down[/code:2p05s6u7][/li]
    [/ul]
    Also, a little side note:
    
    

    "System - Every tick + Touch - Is touching (Sprite) > Player - Move 5 pixels at angle 90"

    You can remove the Every tick condition, see why here.

    Also, one last thing:

    If you're asking questions that are specific to your project, try to always attach a .capx of your project.

    It helps the community to understand your problem better and thus, it helps you to get a faster and better response.

  • Problem Description

    Hi everyone.

    When requesting the location with the native Geolocation plugin under an NW.js export or preview, the event "On error" triggers, the error message is:

    "Network location provider at 'https //www.googleapis.com/' returned error code 400"

    This seems to be related to NW.js only.

    I googled the error message, some results said it's related to Google Chrome (would make sense, NW.js uses Chromium), but when previewing in Chrome (not NW.js), everything works.

    I'm no programmer, but I would assume, this problem is related to NW.js, not C2.

    But maybe there's a workaround to get it to work (apart from not using NW.js, obviously) without having to rely on an NW.js update.

    Capx

    You can use the default Geolocation template.

    Description of Capx

    Testing the Geolocation plugin to its full content.

    Steps to Reproduce Bug

    • Use either action Request location or Track location
    • When previewing in or running the exported NW.js, On error will trigger
    • The expression Geolocation.ErrorMessage will be the above-mentioned message

    Observed Result

    See steps above.

    Expected Result

    The event On location update should trigger and the expressions Geolocation.Longitude and Geolocation.Latitude should return the approximate location.

    Affected Browsers

    • Chrome: (NO)
    • FireFox: (NO)
    • Internet Explorer: (NO)
    • NW.js: (YES)

    Operating System and Service Pack

    Windows 7 64bit, SP1

    Construct 2 Version ID

    Construct 2 r244, most current NW.js (v0.22.0 (Chromium 58)), released 20th of April 2017.

  • I won't even bother asking why you would want to create this kind of game, but I have taken the time to create an example .capx for you.

    You can download it here.

    Two sidenotes:

    • It is quite complicated, don't hesitate to ask if you should have questions
    • I am convinced that the way I did it is not the perfect way of doing it in C2, but I couldn't think of any other way. If anyone has a better idea, please post it, I'm interested.
  • Hi,

    you're probably wondering why your post doesn't get any responses.

    I think the reason for that is that your question is very specific, while at the same time, not explaining what you are talking about.

    • What App ID?
    • Where is that App ID needed?

    I'm guessing you are talking about the ID property in the About tab in the Project properties.

    Have a look at the Construct 2 Manual, it usually helps you with C2-native properties.

    Extracted from there:

    [quote:16ib8ztl]ID

    An ID uniquely identifying your application. This should be in reverse domain format, such as com.mycompany.mygame. Some exporters use this as the ID for your exported app, so try to ensure it will be unique.

    This should answer your question.

  • You might wanna have a look at this thread and ask the author to reupload the .capx, looks like that's what you need.

    (Also, in the future, have a look at this post, it usually answers your normal questions.)

    For a simple and short example, I have created an example .capx for you.

    This will suffice for your situation 1 and should give you help starting your project.

    If you need more help, don't hesitate to post a reply.

  • Assuming, you are using the Platform behavior for the Player and the Solid behavior for the platform(s), you can use the Solid action Solid: Set enabled to disable the collision between the Player and the platform.

    As a side effect, this will cause the player to fall through the platform.

    Since I'm not completely sure whether your intention is to completely eliminate the collision or to just make the player not move along with the platform, you can use this workaround to make the player not stick to the platform, but also not fall through it:

    When you disable the platform's solid state, also set the Player's Platformer gravity and speed to 0.

    This will make him keep his position.

    Remember to switch the gravity and solid state back on when needed.

  • I'm pretty sure you can remove the Trigger once condition and move the Sprite conditions under the On touched event.

    No criticism, just simplifying.

randomly's avatar

randomly

Member since 26 Sep, 2016

Twitter
randomly has 1 followers

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies