Ashley's Recent Forum Activity

  • Well if your plugin crashes don't submit a bug to the tracker, fix your plugin If your plugin has a bug in its serialization code, though, it can cause other parts of Construct to crash after your plugin code has finished running, which is probably what's happening here.

    You can't recompile an edittime plugin while Construct is open (the compiler can't write to the CSX file because construct has loaded it). However, you can recompile a runtime plugin, as long as the loaded serialize data is backwards compatible. If it's not, it will crash on preview, and as above, it might not crash in your plugin, but your plugin will have caused it. It can be very tricky to debug these problems.

    If you change your edittime plugin's serialize data while Construct is closed, it must be backwards compatible. If it's not, all .cap files using that plugin that already exist become invalid and will not load with your new plugin. Have a look at some other plugins to see how they do this. Here's a quick example:

    Say your plugin initially uses this data to save:

    void EditExt::Serialize(bin& ar)
    {
    	int Version = 1;
    	SerializeVersion(ar, Version);
    
    	if (ar.loading) {
    
    		ar >> myint;
    
    	}
    	else {
    		
    		ar << myint;
    
    	}
    }[/code:2etwz5zu]
    
    Suppose you want to add a new value, 'myfloat', to the saved data.  Increase the 'version' number to 2.  The loading code must still support version 1 (to still be able to load old .caps with the plugin's old format).  The saving code only needs to save the current version.  So you'd change it like so:
    
    [code:2etwz5zu]void EditExt::Serialize(bin& ar)
    {
    	int Version = 1;
    	SerializeVersion(ar, Version);
    
    	if (ar.loading) {
    
    		ar >> myint; // both versions 1 and 2 load a myint first
    
    		if (Version >= 2) // version 1 doesn't have this
    			ar >> myfloat;
    	}
    	else {
    		
    		// Save the current version
    		ar << myint << myfloat;
    
    	}
    }[/code:2etwz5zu]
    
    If you don't do it fully backwards compatible like that, all old .caps using your plugin break and will fail to load.  Again, lots of plugins and behaviors use versioning, so check out some on CVS.
    
    Two important points:
    [ul]
    	[li]In this case, you must initialise 'myfloat' to a default value in the edittime constructor.  If you are loading an old .cap (using Version 1), 'myfloat' will contain undefined data unless it has a default in the constructor, because otherwise nothing is ever written to it.[/li]
    	[li]The runtime loading code [b]must support all versions[/b] of the edittime serialize data.  If you open an old .cap using Version 1, and immediately hit Run, the runtime is passed the Version 1 data ([i]without[/i] 'myfloat').  Again, it will crash on preview if you don't support the old version.  So you basically need the same loading code in OnCreate() as you have in the EditExt :: Serialize() loading code.[/li]
    [/ul]
  • So you can easily support ".x" meshes with textures.

    It's never that simple. It has to integrate with the collisions system, the effects renderer, the bounding box and viewport system, etc etc etc. (and people will report it as bugs for anywhere it doesn't integrate properly, and rightly so). It's not a matter of dumping in a mesh. It's got to work nicely with all the other features in Construct for it to be worthwhile and not a useless gimmick. And that can be hard work.

  • voted, hope it wins . (what do you win?)

    The winning project just gets announced at OSCON in July... no real prizes... just publicity and probably a shiny badge

  • Seriously, not the best place for Construct. It's a development tool, should've been placed with the other dev tools.

    We only got enough nominations to make the "Best project for gamers" category... that wasn't even my first or second choice!

  • I think Rich is working on an online multiplayer plugin that should work over the internet.

  • OK, well, I think you should read this. 'Unstable' builds are for testing only - it's not intended that people import their serious, important projects to unstable builds to continue them - precisely because of what happened to you! Things can be seriously broken in unstable builds (in fact, you should expect it), so the plan is everyone imports their .caps, gives it a quick run to check if everything's working, and if it's not, file a bug report. Then keep using the last stable build and only upgrade to the next stable build!

  • Click here to vote for Construct - Best Project for Gamers!

    Construct made it as a finalist in the SourceForge community choice awards under the Best Project for Gamers category! There's a new round of voting so it'd be great if everyone can get their votes in!

    Click 'Best Project for Gamers' to expand it, and click the 'This is the best!' button next to Construct! Fill in any others you feel like voting for as well (we're not in any other categories), then:

    If you're logged in to SourceForge you can just hit 'Send my vote now'

    If you're not you need to enter your email address at the bottom before sending your vote.

    To be honest I think this is a long shot, but hey, may as well try

  • If you're struggling with the basics, maybe try out one of the tutorials?

  • I think this is fixed in the next build, but I'm not sure what's causing it.

    What's with all the drama though? Why not just go back to 0.98.9 and carry on developing with that, in the meantime submitting a "latest unstable build broke my .cap" style bug report so the issue is known to the developers? If you imported your project to an unstable testing build, ignored the warnings in the build descriptions and did not make a backup, clicked "yes" when prompted to save your .cap in the newer build (because it prompts to tell you it no longer will be able to open in the older build the file came from) before even realising it had broken it, then found that your file is broken and you're stuck... would that not have maybe been... unwise?

  • GetData() is nothing more than a general-purpose plugin-defined function that other plugins can call to get data or perform actions specific to that plugin. 'id' is intended to determine what to do, and the void* param is simply four bytes of data to pass as a parameter. The return value is so the callee can get data back from the call (or it can write out to the pointer 'param').

    If the basic syntax is confusing you, you might want to go over a C++ tutorial or book again some time.

  • Oh, its not... humm... well hopefully you can work it out from those functions!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Look at the Physics object source on CVS. At edittime you can use SetGlobalKey/SetLayoutKey to store named global data (a four byte void*). If the 'save' parameter is true, the data is saved to the .cap and also exported to the runtime when previewing. VRuntime also has set/get global/layout key functions, which can then retrieve the data.

Ashley's avatar

Ashley

Early Adopter

Member since 21 May, 2007

Twitter
Ashley has 1,538,264 followers

Connect with Ashley

Trophy Case

  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • Forum Mega Brain Made 20,000 posts in the forums
  • x109
    Coach One of your tutorials has over 1,000 readers
  • x69
    Educator One of your tutorials has over 10,000 readers
  • x3
    Teacher One of your tutorials has over 100,000 readers
  • Sensei One of your tutorials has over 1,000,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x38
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

32/44
How to earn trophies

Blogs