dop2000's Forum Posts

  • That's probably because of this event:

    + System: On start of layout
    -> System: Wait 1.0 seconds
    -> gun: Set position to (slot1.X, slot1.Y)
    -> System: Wait 1.0 seconds
    

    If you need to move guns to their corresponding slots, you need to pick the correct slot instance for each gun instance.

    For each Gun
    Slot compare slotID=Gun.slot : Gun Set position to (slot1.X, slot1.Y)
    
  • Look at the instance properties on the left panel - you need to fill in the values for slotID and slot instance variables. 1 for the first slot, 2 for the second etc. And the same for weapons.

    You can do this manually in the editor, or you can do this with events, for example, when a new weapon is picked up, find an empty slot and assign the weapon to that slotID

  • Did you set the correct values in slotID and slot variables for all sprites?

    If this doesn't help, please share your project file.

  • I think the easiest fix would be Mode: Exclude and Mode: Include

    -> Sprite: Set solid collision filter to Include "tag"

    -> Sprite: Set solid collision filter to Exclude "another_tag"

  • Yes, a sub-event without a condition. You can selected the parent event and press B. Or create any event and remove its condition.

  • It's easier with families and instance variables.

    dropbox.com/scl/fi/npuiuyccucqb6ul0hra6m/SwapGunsInSlots.c3p

    If you are using C2, open the project in free version of C3 to see how it's made.

  • 1pt font size is extremely small, I'm sure that's why it's not working correctly.

    Try setting negative values for the line height, like -5

  • Check line height in text properties - maybe it's set to a very high value.

    Actually, I see on your screenshot that line height is 0. But it also shows font size as 1 - is it really that small, only 1pt?

  • I was hoping there was a dynamic method

    You can paste your text on a drawing canvas - it also supports meshes.

  • I think it would be easier to save the timestamp for 0:00 on the most recent Monday in Local Storage. Then, each time the game runs, check if more than 7 full days have passed since that timestamp (7×24×60×60 seconds). If so, reset the tasks and save a new timestamp — again, rounded to 0:00 on Monday.

    ChatGPT gave this formula:

    const MILLIS_IN_WEEK = 7 * 86400000;
    const MONDAY_OFFSET = 4 * 86400000;
    const mondayMidnight = Date.now() - ((Date.now() - MONDAY_OFFSET) % MILLIS_IN_WEEK);
    
    
    Date.now() - 345600000 shifts the epoch so that Monday 00:00 aligns with multiples of 604800000.
    Taking modulo % 604800000 gives the time since the last Monday midnight.
    Subtracting that gives the timestamp of the most recent Monday at 00:00, cleanly.
    

    But I think it would be for GST, you'll need to adjust it to local time zone.

  • I made this a few years ago:

    dropbox.com/scl/fi/8e36p0902dxolxfgu6bzm/StarWarsText.c3p

  • Here is an example:

    Chemic pick children Molek
    For each Molek
    ... Dictionary add key Molek.dx & "," & Molek.dy
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • With all this in mind, where would you suggest the overhaul begin?

    I don't know.. Perhaps you could build the dictionary when needed from the hierarchy.

    I'm not saying that your current approach is bad. But sometimes it's worth the effort to step back and replace a system that's overly complex or hard to maintain with something more manageable in the long run.

    One other thing to consider about the hierarchy system: it doesn't support loops. So if you need looped chains, like in the image below - you’ll have to connect all Moleks directly to Chemic.

    In that case, when any Molek is removed, you'll need to check which Moleks are still connected to Chemic and rebuild the hierarchy accordingly.

  • I sort of get your idea, but I think it's overly complicated and hard to troubleshoot. You're destroying and recreating all markers and repopulating the dictionary on every tick, which makes it even more confusing.

    I’d strongly suggest using the hierarchy feature instead, it will be A LOT easier. Attach Moleks to Chemic as children - this way, they’ll automatically move together and stay logically connected. You won’t need dictionaries or extra variables at all. You can find parent or child object at any time with "Pick parent/child" condition.

    There are two ways to build the hierarchy: either attach all Moleks directly to the parent Chemic, or create a chain. I’m guessing the chain would be more suitable in your game. If a middle (blue) Molek in the chain is removed, it will automatically break into two smaller chains. Or you can detach pink molek from yellow as well.

  • I don't understand what you're calling a chain then. I don't see any physical connection between objects in your screenshots — so what exactly is the chain, and what do you need to do to break it? What are the markers used for?

    The very first event in your screenshot probably creates hundreds of markers every second, because it runs on every tick. So that’s definitely wrong — unless the third event immediately destroys them? Have you tried running the game in Debug Mode? Run the debugger, create a chain, hit pause, and check all objects, their instance variables, the dictionary content, and so on.

    Your code is confusing, and I’m afraid you might be the only person who fully understands it...