Zacros's Forum Posts

  • Hi

    I'm trying to convert some custom C2 behaviours to C3 runtime and I'm struggling to work out how to pass values between instances.

    In the old C2 runtime I would be able to reference properties of another object by using object.extra["propertyName"] to check a property of another object.

    Is there a way to do this in the C3 runtime? I can obtain the 'object' part and have called GetSdkInstance and GetRuntime but I can't seem to delve any deeper into the properties or call any functions.

    I understand this is much more sustainable to do in the event sheet, but I'd REALLY rather not rewrite the whole game if at all possible.

    I'm not releasing the game, it's purely internal only and for the enjoyment of a small group of friends, so even if it's an unsupported function I'd be happy.

    Cheers

    CB

  • Hi all

    Just wondering if there's a way to link a comment in the editor to an event?

    When I've got lots of events and comments and I want to move them about and reorganise them, it would be nice to have the comment move around with the event that it's "about".

    Thanks!

    CB

  • Actually Colludium, just one minor bug for you.

    The 'On End' event fires continuously once it's hit - In your runtime.js file line 483 it has:

    if (this.currentProfile == 0 && this.progress > 0.99999)

    I think it should be:

    if (this.isTweening && this.currentProfile == 0 && this.progress > 0.99999)

    Seems to fix it, but I'm not sure if it breaks anything else

    Loving this behaviour, cheers!

  • Mate, this is pretty cool - exactly what I was looking for, thank you

  • lucid - I've just come across something odd which I think might be a bug.

    I've attached the capx file which I've used to demonstrate it.

    To demonstrate the issue, press any key when the capx has loaded and you'll see an icon appear in the middle of the screen. It shows a #1 but it should show #2

    All I'm doing is applying a character map when the object is created.

    You'll see that once there is an existing object on the screen and you press any key again then it sets the character map correctly.

    I had a quick look to see if there was anything glaringly obvious in the code but I'm not entirely familiar with the Construct SDK. All I could think of is that it's not populating the c2ObjectArray array prior to the calling of the appendCharMap function, but I'm probably way off base

    In the meantime as a workaround, I'm creating the object at the start of the level, off the screen so it's already preloaded the character maps. Seems to work ok for now.

    Cheers

    Chris

  • Problem Description

    Hi guys

    I'm encounting a crash due to resource issues when previewing my game in Chrome. I have thousands of frames of images all up in maybe a hundred sprites.

    I'm not sure if it's a bug with the way requests are sent via Chrome or not, so apologies if this is in the wrong part of the forum.

    In order to test the issue, I've created a blank layout with no events. I created a single sprite and have loaded a random picture into the frames via the sprite strip import as a quick and easy way of creating lots of individual images. I've created 10k frames for this test in case it's a system specific resources issue - my current game throws up the error when there are approx. 5500 images being loaded.

    When previewing, I receive a red loading percentage - viewing the console I can see the following errors thrown:

    GET http://localhost:50000/sprite-default-6238.png net::ERR_INSUFFICIENT_RESOURCES

    This repeats for every image onwards up to 10,000.

    I then get the following error reported:

    Error loading image 'http://localhost:50000/sprite-default-6238.png': Event {clipboardData: undefined, path: NodeList[1], cancelBubble: false, returnValue: true, srcElement: img…}

    This also repeats for every image onwards up to 10,000.

    After doing a lot of research and troubleshooting, I came across another post on the bug forum with a similar issue that was closed due to not being able to replicate the issue:

    r178-game-crash-in-preview_t112992?start=3 (The same error is reported in the Chrome console in that post)

    Researching the Chrome specific error came up with the following 'bug fix' made to Chromium:

    https://codereview.chromium.org/18541

    [quote:2zkdt5ks]Add a constraint on how many requests can be outstanding for any given render process (browser-side).

    Once the constraint is reached, subsequent requests will fail with net::ERR_INSUFFICIENT_RESOURCES.

    The bound is defined as "25 MB", which represents the amount of private bytes we expect the pending requests to consume in the browser. This number translates into around 6000 typical requests.

    Note that the upload data of a request is not currently considered part of the request's in-memory cost -- more data is needed on the average/maximum upload sizes of users before deciding what a compatible limit is.

    Here's another link discussing the issue:

    https://code.google.com/p/chromium/issu ... il?id=5688

    I don't know if this is a bug with the way that Construct 2 compiles the page requests, hence why I thought it might fit into the bug reporting forums. I'm hoping it's possible to work around this limit somehow, or whether this is a hard coded limit that cannot be worked around within Construct 2 code.

    Thanks

    Chris

    Attach a Capx

    https://dl.dropboxusercontent.com/u/143 ... Issue.capx

    Description of Capx

    Sample file with 10,000 frames loaded into 1 sprite, no events.

    Steps to Reproduce Bug

    • Step 1: Load capx with latest version of Construct 2.
    • Step 2: Preview in Chrome.
    • Step 3: View console.

    Observed Result

    Error messages preventing preview from loading.

    Expected Result

    Game loads successfully without errors.

    Affected Browsers

    • Chrome: YES - v38.0.2125.104 m (64-bit)
    • FireFox: NO
    • Internet Explorer: NO

    Operating System and Service Pack

    Windows 7 Professional SP1 x64

    Construct 2 Version ID

    Latest stable: v184 (Built 15:42:21 on Oct 9 2014)

  • Thanks mate, really appreciate your help!

    While it most certainly helps for this instance, I don't think I can use the same logic with other scenarios.

    For instance, let's say that the Character family has a variable called "HitPoints" and I'd like to destroy only one of the characters (randomly) that have HitPoints of 0 and a Blue weapon.

    If I add in a pick random, it deletes them all, as it's still going through a loop for the weapons.

    To put it in another scenario, I'd like to be able to keep weapon variables on the weapon and character variables on the character. Then I'd like to be able to do "Every 5 seconds, pick one character that has HitPoints > 0 and a linked Weapon that is blue, then move that character 10 pixels to the left. If I use the attached method, it'll move all of the characters that fit the profile, not just a random one.

  • I've attached a sample game where you can get an idea of what's going on. Press 'A' to create 4 sprites (Let's call them 'Characters') in the centre of the screen, each with a small sprite on top of them (We'll call them 'Weapons').

    Each set of Character+Weapon has a unique identifier for them starting at 1 and going to 4.

    Pressing 'S' will delete all 'Blue' weapons as well as their linked (via 'ID') character.

    Or it SHOULD at least... What it does seems to be rather random.

    I'm not sure if it's a bug or if I'm just not doing something correctly... Please help, I've been stuck on this for months!

  • Really struggling here - any thoughts or assistance would be very much appreciated.

    Cheers

    Chris

  • Edit: I've uploaded a cut down sample game to the new post below. It should explain things in more detail.

    Cheers

    Chris

    ---

    Hi guys

    I've been trying to debug a game for a few hours now and I can't quite understand why something isn't working. I've looked through the forum but because I'm not sure what's going wrong I can't really find anything similar.

    Basically, on the start of the layout I create 9 characters (In family 'AllCharacters') and set their associated ChracterID variable to their UID.

    Then I create a random weapon (From the 'Weapons' family) for each of them and set their CharacterID variable to the same as their linked character's CharacterID variable.

    The 'Weapons' family has a variable called 'Type' which indicates if it's a "Melee" or "Ranged" weapon.

    I'm trying to pick all the 'Melee' weapons and their associated character like so:

    [attachment=1:2fkz14pr][/attachment:2fkz14pr]

    When I run this it seems like the correct number of weapons are being picked however their linked character (based on CharacterID) is not being picked correctly.

    If ALL weapons on screen are assigned 'Melee' then it works fine and their associated character is picked 100% of the time. However as soon as one of those weapons are no longer 'Melee' weapons it tends to break and not pick the correct number of characters:

    [attachment=0:2fkz14pr][/attachment:2fkz14pr]

    I've debugged the game above where there is one 'Ranged' weapon and all characters and weapons have the correct CharacterID and Type assigned.

    For the purposes of this test, I was hoping to be able to set all their opacities to 70%.

    I'm obviously not understanding how Construct 2 picking works, so would value some insight into why this might be ocurring.

    Thanks!

    Chris

  • Mate, that's perfect!

    I used the second option - hadn't really looked at solving the problem in that way, so thank you!

    Cheers

    Zacros

  • Hi guys, I've been trying to do this selection for a while now but I can't quite get it to work.

    I'll summarise the issue I'm having:

    • 10 sprites in 'All Objects' family. (Can be a random amount but for now I'm using 10)
    • Family has instance variables of "Dead" and "Running".

    Let's say 5 of those objects have the 'Dead' flag set - I only want to trigger an action if ALL the remaining 5 objects have the 'Running' flag set.

    It seems so simple, but I just keep bashing my head against a brick wall. I'm running into issues trying to code it so would value some expert advise on this please!

    Thanks in advance!

    Zacros

  • Completely agree with this. Would be especially handy to be able to copy whole animations between sprites.

  • Thanks for your help, I hadn't realised that was an option (I should probably reacquaint myself with the manual :)).

    That unfortunately didn't help however thanks for the suggestion anyhow.

    After some investigation I noticed that AVG processes was taking up 30% CPU usage when the preview was generating. It seems the AVG Link Scanner was scanning each and every one of these files being generated, resulting in extremely slow performance. After disabling AVG, preview times went right down. Unfortunately, adding the various cache folders to the exception lists in AVG didn't do anything, so disabling is the only way.

    Cheers

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Cheers - the thing is that I don't know how I would get around this. I've tried importing a sprite sheet with all the different animation frames on it instead of each individual PNG, however Construct splits it up during the import process into individual PNGs anyway.