Ashley's Recent Forum Activity

  • You do not have permission to view this post

  • I guess you're just not used to C2. One of the rules of the event system is if an object is not referenced in any conditions, the action affects all of the instances. So since the 'start of layout' event does not use any Sprite conditions, the Destroy action applies to all the instances.

    If you don't want the action to affect all the instances, you add a condition to pick which instances you want it to affect, e.g 'Mouse is over Sprite'.

    Does that make sense?

  • You do not have permission to view this post

  • We're still working on our manual. Hopefully it won't be long!

  • Oops, should be fixed in next build.

  • quote]You can do this in the plugin/behavior SDK. Javascript doesn't employ any encapsulation (e.g. private variables or functions) so by its very nature you can edit anything in the runtime at any time from a plugin.

    Cool! I'll do a little research on accessing other variables through javascript, this is very interesting to me. Do you know of any plugins that use this, as an example?

    I can't think of any good examples, actually - it's not actually normally necessary to do this. But it's possible in case you really need to. I'd say read through the SDK docs, there's guides on how to access the full list of instances and such.

    hen I put more than one instance of an object and then later want to modify that object it seems that all instances of that object are subject to the same command, and as far as I can tell, you can't pick one specific object through the event system

    That's not true - it would be very difficult to design decent games if the event system didn't let you do that! The conditions in events act as filters to pick the instances you want to affect. For example the condition "Sprite X < 100" picks all individual instances to the left of X=100. If you then have an action 'Destroy Sprite', for example, only those picked sprites get destroyed, and the others are not affected. So the way events work actually is fundamentally based on picking individual instances of objects and running actions on them.

    TBH designing plugins when you're not familiar with the way events work will be tough - I'd spend some time getting to know how C2 works first, then it will be much clearer what plugins are doing in their code.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • D'oh, thought I fixed that, fixed for real in next build!

  • Ah, the data URL is probably going to slow down things a lot... have you tried just 'floating' a div with some HTML content in it over the canvas? This is how the button and text box objects work - it seems to work pretty well.

  • Hey, welcome to the forums!

    2. Remove gravity all together and implement my own.

    This is the best way to go. As you note it's a pain to set gravity for each and every object you want to affect, but we're hoping to introduce the Families (object grouping) system soon which will make this much easier - you'll be able to apply the gravity to a group of objects at once rather than having to re-do it for each object.

    hat I'm getting to is that in the "other" system I could access other scripts through one script. So if I wanted to modify a global variable, I could. Or if I wanted to apply a force to another object I could. And on and on.

    You can do this in the plugin/behavior SDK. Javascript doesn't employ any encapsulation (e.g. private variables or functions) so by its very nature you can edit anything in the runtime at any time from a plugin. Of course, you have to make sure you do it in such a way that it doesn't break the runtime - if you have any specific questions about this I'd be happy to help.

    p.s. what was the "other" system? We don't censor mention of competitors here, because we're confident Construct 2 is the best.

    hat I've been looking for with C2 is a way to do something similar. What I've found so far, if I understand correctly, is that implementing a "scripting" option for the Event system is not possible because of the need to be cross compatible with any exporter that may be developed.

    Implementing scripts in Construct has been something that's been regularly discussed since Construct Classic (released 2007). We've never been keen on the idea: we want Construct 2 to be an event-based tool only, so we can focus all our energies on to making a great event system, rather than a half-baked event system which you're supposed to ignore in favour of script to do anything serious.

    Adding script via a third party plugin currently isn't actually really possible - plugins can't extend the editor at the moment, so the only way to input scripts is via text objects or loading external files, which is probably more hassle than it's worth. And as I said we're not keen on the idea anyway. And as you note, it creates really difficult porting problems if we come to support other platforms further down the line - anyone using a script which is not ported to another exporter will not be able to port their game. I'd also advise against inventing your own scripting language. It's really complicated and hard, and I think inline snippets of javascript would be more useful than some unknown brand new language. And inline snippets of javascript are not far off the SDK, and the SDK makes plugins and behaviors which work really nicely with the editor, rather than random bits of script across your game.

    If you want to design your own language as a hobby project that's cool, but I'm speaking more from a practical point of view (what we really want to be in the editor).

    . A particle system.

    We have an official particle plugin planned (it's the kind of thing very well suited to the plugin system). However if you want to try making your own, well, we can't complain if people are doing our work for us :)

    Hope that covers everything, I would encourage you to have a play with the SDK, it's got documentation which should help you get going too! All the official plugins and behaviors are written in javascript in the SDK too, and you can find them in the install directory (exporters\html5\plugins and exporters\html5\behaviors) - you might find it interesting to see how all the official plugins and behaviors implement their features in javascript.

  • Nice! How does it work? Does it have an SVG context over the canvas or something?

  • I guess this would make a useful tutorial for beginners - we're still working on our manual but it generally is going to be a reference rather than a 'how-to' guide. So try writing up a tutorial! Anyone can submit tutorials on the site.

  • You do not have permission to view this post

Ashley's avatar

Ashley

Early Adopter

Member since 21 May, 2007

Twitter
Ashley has 1,772,401 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
  • x126
    Coach One of your tutorials has over 1,000 readers
  • x74
    Educator One of your tutorials has over 10,000 readers
  • x5
    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
  • x42
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

32/44
How to earn trophies

Blogs