PixelHero's Forum Posts

  • That makes sense!

    I was hoping for the behavior, to avoid any confusion over why certain actions were done one way vs the other, but that's pretty minor, and will be far faster to implement.

    Thanks!

  • I understand, but I'm trying to teach a young child the absolute fundamentals. And I'm trying to teach her by slowly introducing more concepts. She doesn't even understand what a variable is yet (not in computer programming terms anyway).

    We're just starting to go over what conditions are. So I'd like to be able to build an "animal" behavior. She can call the actions to "go to food bowl" etc, and behind the scenes, I can set a target destination and control the movement, etc)

    How do I create custom behaviors so that they show up in the UI with their own events and actions?

  • I'm trying to teach my daughter, and I want to abstract away some complexity and provide a set of events and actions for her to use without needing to know the details behind them.

    How do you make custom behaviors in Construct 3? I've tried scouring the documentation, but I don't see anything other than the SDK. Is that the way, javascript only?

  • Hmmm... I'm not sure what I did, but I broke it. I can export my data to a new capx, and Construct2 can't open it.

    Failed to open project....

    Found an event condition referencing an object 'DataSets', but this does not appear to be an object type or family in the project

    Under element: c2eventsheet\events\event-group\sub-events\event-block\sub-events\event-block\sub-events\event-block\sub-events\event-block\conditions\condition

    Line 74, column 49

    in c:\.....\data.xml

    I tried to get the data.xml, but it appears to be temporary and was gone even before I closed the dialog.

    here's the Json:

    {"c2dictionary":true,"data":{"This is a string":"{\"c2dictionary\":true,\"data\":{\"This is a key\":\"{\\\"c2array\\\":true,\\\"firstRowIsColumnNames\\\":true,\\\"size\\\":[7,2,1],\\\"data\\\":[[[\\\"column1\\\"],[\\\"column2\\\"]],[[0],[0]],[[1],[1]],[[2],[2]],[[3],[3]],[[4],[4]],[[5],[5]]]}\"}}","This is another string":"{\"c2dictionary\":true,\"data\":{\"This is a key\":\"{\\\"c2array\\\":true,\\\"firstRowIsColumnNames\\\":true,\\\"size\\\":[7,2,1],\\\"data\\\":[[[\\\"column1\\\"],[\\\"column2\\\"]],[[0],[0]],[[1],[1]],[[2],[2]],[[3],[3]],[[4],[4]],[[5],[5]]]}\"}}","This is yet another string":"{\"c2dictionary\":true,\"data\":{\"This is a key\":\"{\\\"c2array\\\":true,\\\"firstRowIsColumnNames\\\":true,\\\"size\\\":[7,2,1],\\\"data\\\":[[[\\\"column1\\\"],[\\\"column2\\\"]],[[0],[0]],[[1],[1]],[[2],[2]],[[3],[3]],[[4],[4]],[[5],[5]]]}\"}}"}}

    ---------------------------------------

    *edit*

    Importing into a blank project appears to have fixed the issue. I'm not quite sure exactly what broke, but I can't get it to fail on a blank project. *shrug* If I imported into existing project or "save all to capx" the resulting capx would break. But If I created one in Construct as blank and then imported, it worked.

  • I usually just destroy them on layout start.

    Depending on the type of object, you can also start it with 0 opacity if you don't want to destroy it for behavior reasons. That way it won't show until you intend it to.

  • Tnindie

    Taking a frame can be done like so:

    scirra.com/forum/taking-photo-of-an-area-and-turn-it-into-sprite_topic79223.html

    Capturing every frame... I don't know about that. If it exists, it is probably a plugin, I don't think there is a built in way to do that.

  • I have two approaches:

    I have an event sheet reserved for globals. Then they are all together in their own file. Since they are globals, I don't have to worry about including it in all my other event sheets, but I can reuse them for different layouts.

    However, if I need an object to hold the variables, I've found a size zero array works well (set the Width to 0, leave Height and Depth at 1). I can give it instance variables for the globals, set it to persist, and I don't have to give it a space in the layout.

    I might have misunderstood you, though.

  • Burvey

    There isn't a trigger for this that I've found. (That is, a reactive trigger that will happen whenever the variable changes anywhere. Personally, I want these too, but I can see why they aren't in the software).

    I've been able to handle this in two ways:

    1) Have two variables instead of one. The old value that only gets set in my checker and a "new value" everywhere else. I can compare to see if it got set Every Tick.

    2) Or, I create a function that handles the what I want to do and call it everywhere I change the value.

    Neither is truly reactive, but they work.

  • <img src="smileys/smiley25.gif" border="0" align="middle" /> There are folders for events. I have quite a number of folders, and I have an event sheet in the top one that includes all the sub sheets so I can easily bulk-import the logic.

    If you right-click on "Event sheets," do you get the "Add subfolder" option?

    (Just took a quick snapshot of prototype I started a few days ago -- this is what you're looking for, right?)

    db.tt/3bX0U084

  • Well, logically, they could do it, but it has to do with picking. A pick by UID (as it currently is), sets the object type in the editor, so it knows exactly what actions to offer.

    A global pick by UID can definately happen, but with out some type detection events (like, if object is PlayerSprite), then only common events would be allowed. And I don't even think Destroy is common, because that isn't available to Mouse, etc.

    So you could pick, but without some type detection events, I don't think you could do anything with it. Now, if we get filtering type detection events, that could work...

    But then you could have done the selective pick that it currently does. I just don't think that works with their editor paradigm.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It might be better to flip that around ArcadEd. In your example it would be the time since the previous attack that would determine what attack you could perform (rather than time since previous), and I believe he's actually trying to prevent canceling the punch.

    I would invert the meaning of your punchtimer like so:

    variable punchTimer = 0

    every Tick | subtract DT from punchTimer

    then actions are only allowed if the punchTimer = 0. You can even prevent changes in direction or other actions that would cancel the punch. In this way, different punch styles can set the punchTimer to different values, so you can have more time to recover from a running punch than a idle punch, for example.

    'Course, I could have also misunderstood what he wanted to do, too.

  • I don't have one with me, but can you make touch simulate click? This is sometimes a problem in multi-platform because of multiple input methods, but if you are touch only then you might be able to get around it this way.

    In the layout view, select your touch object and set "Use mouse input" to Yes, and give it a whirl.

    There is probably a better answer, but it would require someone with more experience than me.

  • Another alternative to a function is to use the system condition "pick all". So your event could look like this:

    spriteShot: On Colision with spriteEnemy

    system: pick all spriteEnemy

    ---> spriteEnemy Destroy

    You know, you'd think I notice something that obvious. If you aren't interested in re-use, that's definitely the most direct method, and less error prone (you can't misspell it) <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Ah, found the problem.

    Here it is fixed, and annotated in the comments

    db.tt/FYRfoCZ9

    See what was happening was you were setting the player position right before you pinned your animations to the player. But you had your pin set to remember the position relative to the object. This meant that your objects were very far apart, and as the player moved and rotated your player sprite went all over the place.

    So I set them to be at the same position, then pinned. Problem solved.

    Note that it LOOKS a little funny in the player, because it will look like there are times when your player and animations don't match. However, that is a visual only bug, due to the way you have the bullet. Because you are setting the angle of the bullet, it is setting the angle of the sprite.   If you look, they always have the same position, the player sprite is just rotating around the upperleft corner, causing it to appear out of alignment when walking anything other than right. If you run it through the debugger, you can see they actually are at the same position. Just don't use that player for collision, and you'll be okay.

    If you do want to use the player for collision, I would recommend using Lerp and doing an actual linear interpolation (keep track of the move timer yourself and update it every frame, don't feed the position back into the Lerp, that performs asymptotic movement.

  • Hmmm... good point about families. If you're looking to "depick" you can use the trick I posted on the other topic.

    scirra.com/forum/destroy-sprites_topic79122.html