fisholith's Recent Forum Activity

  • I've tried NW.js, Chrome, Firefox, and Iron.

    (I usually do all my work previewing NW.js)

    Also, wow, I can't believe I didn't think to check the debug console, good call, dop2000!

    ... So I checked it and just as the freeze happens, I get an avalanche of errors, each saying a different image file can't be found. Essentially every image in the game can't be found. Only the logo image loads, and even it didn't load until I overwrote it with a backup version of the logo from an older project.

    On further inspection of the files in the project folders I noticed something very strange.

    The last version that works has all normal looking image files.

    For the next version after it, which spews the avalanche of image errors, all the images and audio files are missing "Date Modified" meta data.

    I mean literally missing,leaving a blank in the column where they would normally appear in Windows explorer. I've never seen that before.

    Opening properties on one of these files, the "Date Modified" field just shows "12:00am", and no date, as you'd normally see.

    All the image files still open and display normally though.

    Interestingly, the only file that has a "Date Modified" value is the logo file, which got filled in only after I replaced it with an older image file. And that's the only image that loads, that I know of.

    I'm starting to suspect there may be some hard drive problem, but I'm not sure. It's all pretty weird. I backed up the last several versions (working and not) to separate drives just in case.

  • Hey thanks for the info dop2000. :)

    I've seen a few references to the logo png, like in the other post I linked, though I wasn't sure if that was related to my case, but it looks like it might be in part.

    I tried copying an old logo png over the current one, and even though they appear identical, my game loads slightly farther now and no longer gives an error.

    It will now show the loading image, partially fill the progress bar in red, then freeze. The red loading bar usually indicates some kind of loading failure, but I don't know what problems do or don't trigger that color change.

    In Debug mode, it seems it loads to 17% before freezing every time.

    This is what it looks like.

    So this is farther than I was getting before.

    Is there any kind of weird event that might have corrupted an image file?

    i.e.

    If C2 crashed while the image editor was open, or crashed as the image editor was closing and updating the file? I don't recall a crash off-hand, but one might have happened.

    Or maybe if the computer went into sleep mode when the animation editor was open and didn't quite restore correctly, on waking?

  • (edit: See [SOLVED] post below... )

    The game I'm working on had no issues launching in preview mode a few days back, and today this same project now crashes on preview.

    I've made no changes to the project file.

    When attempting to preview, the game begins to load, and halts at a black canvas with the error shown below.

    Javascript error!

    Uncaught InvalidStateError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The HTMLImageElement provided is in the 'broken' state.

    Still investigating this, but I figured I'd ask, just in case anyone knows off hand what might cause this.

    Things I tested

    This error occurs in Chrome, Firefox, and NW.js.

    Several older versions of this same project also now crash on previewing, with the same error, so I don't think it's a change in the most recent version of the game.

    I tried making a new blank project, and that seems to preview just fine.

    So I think there is something in my game that's triggering the problem, but the fact that older versions also trigger this error (which I don't recall ever seeing before ) is strange.

    I did find a 10 month old version of the game project that seems to preview just fine, so whatever it is, doesn't affect all copies of the game.

    I'll be looking to see if I can spot the difference between versions.

    It seems like there must be some resource, object, or image in the game that is suddenly not playing well with HTML canvas for some reason.

    More info

    I can't think of anything that would mess with this.

    I did rollback my graphics drivers in the last few days, I would think that'd be pretty separate from HTML 5 though, and in particular separate from the minutia of changes in older versions of the game. Still, it's the only thing that comes to mind. (edit: Just tried installing the newest drivers and I still get the same error, so looks like drivers aren't the issue.)

    I also tried updating Construct 2 and that didn't seem to change anything.

    I'm using Windows 7 x64 Pro, Nvidia GTX 780, Construct version r265

    Related posts

    I found one other post that mentions this error message, but it seems to be in a differnt context, using web proxy preview, so I'm not sure how much it overlaps with my case.

    construct.net/en/forum/construct-2/how-do-i-18/invalid-state-error-81533

    Any thoughts or suggestions are welcome.

  • Hey heater19 and justifun, :)

    This is the latest themes bundle:

    Themes Bundle - Fisholith Themes v2.zip

    My themes bundle and my Theme Editor are downloadable in the first post of my Editor thread:

    construct.net/en/forum/construct-2/works-in-progress-feedback-requests-24/color-theme-editor-for-c2-rele-111846

  • Hey Ashley,

    Thanks for the reply, and for explaining some of the inner workings, it's always interesting.

    The storing of global vs instance data is an interesting aspect.

    It sounds like maybe making an in-event-sheet wrapper function (via Function object), for enabling and disabling physics collisions might be a good alternative then. The wrapper could automatically update our own external collision relationship list, that could be stored on-save and later used to reload the relationships via "on load complete".

    Anyway thanks again.

  • Hey , thanks for the reply.

    It does work, and it's one of the two options I can think of for dealing with the Physics save/load behavior.

    Using "On load complete" to manually reconstruct the prior "collision relationships list" is a workaround I've spent some time looking into. It gets a bit trickier in larger projects with conditionally disabled collisions, but it's still workable.

    In essence you have to store your own hand-made parallel "collision relationships list" in a dictionary object or something similar. You update your dictionary-based hand-made list every time you update the real Physics object. Since that dictionary object will be restored correctly when the save state is loaded, you can get the collision relationship data out of it and use it's entries to reconstruct the correct collision relationships in the Physics object.

    The other possible workaround, (much more self-contained, but much more iffy with update compatibility), is to modify the physics objects runtime JavaScript.

    The "instanceProto.saveToJSON()" function is responsible for serializing the internal state of the object into JSON. I think it should be possible to add the collision relationships list data into that outgoing data.

    Then in the "instanceProto.loadFromJSON()" you would have to extract the info and feed it back into the Physics object to reconstruct the collision relationships state.

    This is how most objects store and recall their collision state info, and it's what would be changed in order to resolve the save/load behavior described in the bug report.

    There are compatibility downsides to making unofficial modifications to the JavaScript of an official plugin though, so I don't really recommend it.

    Anyway, thanks again for the suggestion, drg81. I think the "On load complete" method is the way to go for the time being.

  • That is true , though I think rafaelsorgato was trying to go from the Ship to the Antenna, rather than from the Antenna to the Ship. Still, it's a good piece of information to know.

    As for the Antenna physics, rafaelsorgato,

    I might be wrong, but I don think the pin behavior works with the Physics behavior.

    What you might want to do is make the Antenna a non-Physics object, and pin it to the Ship physics object. Then the Ship does all your physics, and the Antenna is just a sprite along for the ride.

    If you need the Ship to break into physics pieces when destroyed, and the Antenna is one of them, then you can replace the live sprite Antenna with a dead physics Antenna at the moment the Ship is destroyed.

    If you really do need the live Antenna to use physics, so it can flex around while the Ship moves, you can try attaching it to the Ship using a physics joint, but if you do, the Antenna will change how the ship controls and moves, unless the Antenna has very low mass.

  • Just released another small update "v4e", (previous was "v4b").

    Fixes and refines a few small things, like the position and visibility of the "Stretch to fill window" option, and other minor stuff.

    Also the Scirra Arcade version now shows the link to this thread correctly. Unlike the desktop version of this app, the Scirra Arcade version can't just directly open a link to a webpage, so instead it pops up a copyable link.

    Hey there totoe, thanks for the comment.

    Thanks mOOnpunk, happy to hear you find it handy.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No problem A01214706, glad it helped out.

  • Hey there mOOnpunk,

    Not only will I make an osx version for you, I'll make an entire new update to the whole program!

    That's what ended up happening anyway. :]

    It's got some new features, like Middle-click-drag for rotation, and each blend mode button has a tiny preview of the subpixel diagram beside it.

    Even the modes not included in C2 are shown for completeness, and if you click on them there's a popup explanation as to what they do and why C2 doesn't include them.

    Also ... there's an owl in there now. It's fairly low res though, so it's safe.

    (fancy thumbnail for Scirra Arcade version)

    (Update: Changed from version "v4b" to "v4e", small fixes, and Scirra version now shows link to this post correctly.

    OSX: fi_BlendCompositeModes_v4e_osx64.zip

    (Let me know if it doesn't work. I've been hearing the NW.js export is having problems with OSX.)

    Scirra Arcade: Blend composite modes sandbox

    I also put it on Scirra Arcade, just in case the osx version has any issues.

    Win64: fi_BlendCompositeModes_v4e_win64.zip

    ...In case anyone else happens by here before I get a chance to update the original post.

    If you have any questions, feel free to ask.

  • Hey there ,

    When you go to the new layout, I think the "Play Animation" action doesn't come along for the ride.

    It will probably try to play the animation in the layout that you're leaving.

    I think you may need to set up an event that will run as soon as the next layout starts.

    You probably can't just say "On start of layout" play animation X, because you don't want it to happen every time that layout starts.

    So, the event will need to know if you wanted to play the animation when you left the previous layout.

    There are a bunch of ways to pass this kind of information between layouts.

    Global variables are one way. If you create a variable and place it at the root event level (not under a parent event), then anything you set that variable to will carry over between layout changes. This will do the job, but it can get a bit ugly if you have a bunch of trivial values being passed around with global variables.

    Another way is to create a Dictionary object (which is global by default). Any values you set in it will be accessible everywhere.

    So, when leaving the first layout, you would set a global-ish variable like "readyToPlayAnimAtStart" to 1.

    Then, at the start of the next layout, another event says:

    Event:

    + On start of layout,

    + Global-ish variable "readyToPlayAnimAtStart" equals 1

    Play animation X.

    Set Global-ish variable "readyToPlayAnimAtStart" back to 0.

  • Hey A01214706,

    which I'll assume is pronounced AOLZLATOB! :)

    Okay, if I understand, you have 2 text objects Text1 and Text2.

    If the player touches Text1, it is moved horizontally to x=544.

    If the player touches Text2, it is moved horizontally to x=464.

    If Text1 and Text2 have both been moved, then TextCorrect (which says "Correct") should be moved to a given [x,y] position.

    There are a lot of ways to make that work, the one I'll explain isn't the most efficient, but it's easy to set up.

    The fast way:

    1. In the Layout View, select the Text1 object.

    2. In the properties panel, in the "Instance variables" section, click the blue "Instance variables" link.

    This will open the "Instance Variables" editor for the object.

    3. In the Instance Variables window, Click the plus "+" button at the top.

    This will pop up the "New Instance Variables" dialog.

    4. Change the Name field to "wasMoved".

    Later, we'll use the "wasMoved" variable to keep track of whether the text object has been moved yet.

    5. Click the "OK" button.

    6. Close the "Instance Variables" editor by clicking the "X" at its top right.

    7. Repeat the same process (steps 1-6) for the Text2 object, to give it a "wasMoved" variable.

    8. In the Event Sheet, find the event where the Text1 object gets moved.

    9. Under the action that moves Text1, add a new action.

    10. In the action browser, double click the Text1 object.

    11. In the "Instance variables" section, double click the "Set value" action.

    12. Make sure that "wasMoved" is selected in the "Instance variable" field.

    13. Change the value to 1, and click the "Done" button.

    We can later check to see if the value is 1, and if it is, we know the object was moved.

    14. Repeat the same process (steps 8-13) for the Text2 object, to create the action for its "wasMoved" variable. You'll need to find the event that moves the Text2 object.

    15. Create a new event with the following two conditions:

    Text1: Compare instance variable "wasMoved" = 1.

    Text2: Compare instance variable "wasMoved" = 1.

    (Note: To add a second condition, you can click in the event and press the "C" key on your keyboard.)

    16. Add the action to move the TextCorrect object to the desired location:

    Finally don't forget to disable your original event that moved the TextCorrect object.

    Done.

    It should look like this:

    Event:

    + Player touches Text1

    Text1: Move to new position.

    Text1: Set "wasMoved" to 1.

    Event:

    + Player touches Text2

    Text2: Move to new position.

    Text2: Set "wasMoved" to 1.

    Event:

    + Text1: Compare instance variable "wasMoved" = 1.

    + Text2: Compare instance variable "wasMoved" = 1.

    TextCorrect: Move to new position.

    A more efficient way

    There are more efficient ways to do this same task, but I didn't want to over-complicate things.

    With the solution described above, the game will be constantly checking to see if both "wasMoved" variables are currently 1.

    If you want to try making it more efficient, you can instead have the game only check when the move events for Text1 or Text2 occur.

    This way the game only checks when there's a chance we should move TextCorrect.

    Event:

    + Player touches Text1

    Text1: Move to new position.

    Text1: Set "wasMoved" to 1.

    ~ ~ Sub-Event: - (You can create sub-events by pressing "B" on your keyboard.)

    ~ ~ + Text1: Compare instance variable "wasMoved" = 1.

    ~ ~ + Text2: Compare instance variable "wasMoved" = 1.

    ~ ~ > TextCorrect: Move to new position.

    Event:

    + Player touches Text2

    Text2: Move to new position.

    Text2: Set "wasMoved" to 1.

    ~ ~ Sub-Event: - (You can create sub-events by pressing "B" on your keyboard.)

    ~ ~ + Text1: Compare instance variable "wasMoved" = 1.

    ~ ~ + Text2: Compare instance variable "wasMoved" = 1.

    ~ ~ > TextCorrect: Move to new position.

fisholith's avatar

fisholith

Member since 8 Aug, 2009

Twitter
fisholith has 1 followers

Connect with fisholith

Trophy Case

  • 15-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies