Wertle's Forum Posts

  • I'm not sure if this is a bug so I'm going to try here first.

    I have it set up so a sprite moves around on its own, and you can stop it and turn it with either mouse clicks or trigger buttons on a game pad.

    However, when you turn the sprite using the game pad, when you let go the sprite returns to its previous angle instead of the new angle. This does not happen with the mouse.

    I am mystified because the mouse input and gamepad input are calling the exact same function. Any idea what could be going on here?

    http://storage.wertle.com/construct2/AngleProblems.capx

  • Yeah, I started off with the .capx when it was a small prototype, but it's really grown enough that I should break it out into a project folder.

  • I figured as much. Moral of the story: Submit to source control often and never mess around with submitting/reverting early in the morning.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is probably in vain by I figure I'll try anyway.

    I'm using perforce and just had a major user-error moment where I reverted a .capx file instead of submitting it :O

    I did, however, export my game before I idiotically lost all my changes. Is there any way to get exported data back into .capx form or am I just screwed?

  • Works like a charm, thank you!

  • Is there a way to get the angle of reflection value from an object with the bullet behavior when it collides with another object?

    I was using the bullet bounce-off-solids behavior for an object, but I would like to pause and play a short animation when the object collides with a wall before it bounces off (it's a little grip-the-wall-and-then-launch-off animation).

    I tried turning off the bounce off solids and using the bounce action after playing my animation, but it sends the object in an unexpected direction (instead of reflecting off the surface, it bounces back along the vector that it entered), perhaps because it no longer has the original vector?

    I was hoping to get the angle of reflection on the initial collision with the object, save that, then set the sprite's angle of motion to that value when the intermediary animation is finished.

    Can I get this value? Other suggestions for how to do this?

    Here's a quick isolated test case that's fairly representative of the issue (press mouse buttons to rotate the thing).

    http://storage.wertle.com/construct2/AngleProblems.capx

  • Yes, I do know what UIDs were. Okay, so I understand now that you are suggesting I do #1 on my list - manually entering UIDs as instance variables for all the buckets/gates. Communication resolved!

  • I think we're having a miscommunication here. I see what you mean about picking the relevant ID's of the bucket/gate.

    My question is. HOW do you know what ID to pick?

    So in this step

    Cond: Pick bucket by unique ID (ID of relevant bucket)

    How do I know (ID of relevant bucket)? Where is that previously set and how?

  • Well, yes, but the question is HOW do I associate the bucket with the gate. Do I take it you mean that options 1 and 4 in my solutions are the best ones?

  • But how do I pick which gate opens? There are multiple bucket gate pairs in the layout, so i need to be able to pick the gate that is associated with the bucket.

  • I don't think there's a way to duplicate layers across layouts, but there is a way to make global objects such that you can make a sort of global hud that's maintained in one spot.

    There's a tutorial about it here:

    https://www.scirra.com/tutorials/594/building-a-global-user-interface-ui

    The trickiest thing about this is having to maintain the same layer structure across all layouts.

  • So, I work in AAA and knew vaguely about the whole red cross thing, but I went and asked one of the CDs who used to be a project manager for more details about how we have to deal with this from the developer side.

    The console platforms have a very strict set of guidelines that a game must adhere to to pass cert (Sony calls this the Technical Requirements Checklist and Microsoft calls it Technical Certification Requirements - so if you can never remember if the abbreviation is TRC or TCR, don't worry, it's right somewhere!).

    The red cross thing falls under a requirement that's more or less "title does not use any trademarked content or any content protected legally by any body" (heavy paraphrase). Big publishers err on the conservative side because they'd rather avoid spending the time/money/effort defending themselves in court, even if they would surely win.

    Honestly the red cross thing would probably not hold up in court, but who wants to go to court? This is probably why you see the red cross in smaller games but games with the bigger publishers are more strict about it. I believe we used white crosses on red backgrounds for health in one game, which is fine.

    The other layer is that it is the responsibility of whoever owns the IP to vet for legal clearance. So if the developer owns it, it's on them, but if it's publisher-owned then it goes through there system. There's also often a branch of the legal division of publishers on the lookout for "potential cultural and/or political sensitivities" who are looking for things that may cause outrage (and thus damage the publisher name).

    So the summary for the console perspective on this:

    • Platform (Ms/Sony/Nintendo) makes it a technical cert requirement to not have any trademarked stuff in their games
    • IP holders (could be developer or publisher) is responsible for getting their game vetted by legal
    • Publishers often have divisions in legal looking for "stuff that would cause outcry"

    And lastly, the point is to avoid going to court altogether, even if the thing probably wouldn't hold up in court.

    Hope this helps!

  • I'm trying to figure out the best way to associate two instances of two different objects in the editor. Basically it's a lock-and-door situation, I have a gate and a bucket (put a certain number of things in the bucket to open the gate). I want to be able to easily get the associated bucket if I pick a gate and vice versa.

    Containers won't work for me for a number of reasons:

    • All gates have buckets but not necessarily all buckets have gates
    • I want to be able to associate the two objects from the editor since placements will vary and there are multiple bucket/gate instance pairs
    • both object types already have containers for other purposes and so can't be added to each other's containers anyway

    I have a number of ideas for solutions but would like opinions on what might be the best course (or ideas for solutions that I'm missing). Please let me know what you think!

    1. UIDs as instance variables (so the bucket object has a gateID and the gate object has a bucketID and I enter UIDs manually). The problem here is just the overhead of having to enter and potentially update UIDs, and the errors that might result if I clone a pair and forget to update their instance variables

    2. Use "Pick Nearest" to get the closest bucket to a gate. Works in theory as long as I always keep buckets next to their gates, but breaks down if there ever comes a case where this isn't true (or if two bucket/gate pairs happen to be near each other and might mess this up).

    3. Create a "linker" sprite that I drag over both bucket and gate, and use overlapping checks to see which objects are overlapping the same linker. Might be unwise to add unnecessary collision checks.

    4. A combination of 3 and 1, where I do one collision check at the beginning of the layout to set up the instance variables and then use UID picking elsewhere in the event sheets.

    If you have any thoughts on these or better ideas for ways to solve this, please let me know. Thanks!

  • For #1 I think the second one is best - having a function that handles the subtracting of health and the HUD stuff and calling that function when health should be subtracted. This way you aren't constantly polling a variable, but only checking it when you know it has changed.

    For #2 I'm actually not sure of the performance implications of the two different options, but would love to hear the answer :)

    For #3 I'm doing something similar with my HUD, using the "global HUD" tutorial. Seems like the easiest approach.

  • Your second Touch event is triggering after your first on the same touch - so you touch it, the variable changes to 1, then the next event in the line triggers and since Selected is now 1 it fires and destroys the other sprite immediately.

    Try only having one touch event and have sub events to check the instance variable, like so:

    http://storage.wertle.com/construct2/touchIssue1.PNG

    Edit: the Move to Top of Layer thing isn't necessary, I just had it in to make sure it wasn't spawning behind the first sprite (it wasn't)