LoobyLoo's Forum Posts

  • It works. Thank you alextro for your time. Appreciated. :)

  • Please help

  • Thanks for your response,

    So if you have 6 instances that start with iid 0 as first instance and iid 5 as last instance. In your case the iid is equal to loopindex due to loop condition "For each". Took an example from the iid or loopindex as an input to do modulo operation: 3%3 will return 0 as remainder and 5%3 will return 2 as remainder. So basically since I know they are equal pair for the object instances and want to assign them to the same instance variable value as input, I put modulo operation to quickly assign the value.

    Yes, I understand that, but I am a bit confused about how to make the code work for any number. SpriteX and SpriteX_Family can represent any number, and the current LoopIndex%3+10 logic only applies when SpriteX.a has values 10, 11, and 12. If the series is different, we need to adjust the LoopIndex%3+10 accordingly.

    For that, I used a Boolean variable. Based on the Boolean's value, the logic is structured as follows:

    // Naming The Text w.r.t. the Sprite Instance Variable based on its Boolean
    + System: Pick SpriteX by evaluating SpriteX.Draggable_Boolean=0
    -> Text: Set text to SpriteX_Family.A_Family_IV
    
    + System: Pick SpriteX by evaluating SpriteX.Draggable_Boolean=1
    -> Text: Set text to SpriteX.A_IV
    
    

    However, I am uncertain about the comparison logic that should be used in this context. :/

    // The Main Picking logic, where I have issue
    + SpriteX: Is overlapping SpriteX_Family
    + SpriteX: A_IV = SpriteX_Family.A_Family_IV
    + System: Pick SpriteX_Family where SpriteX_Family.A_Family_IV = SpriteX.A_IV
    -> SpriteX: Set position to (SpriteX_Family.X, SpriteX_Family.Y)
    
    

    (IV = Instance variable)

    Here is the revised c3p file with improved naming to avoid confusion.

    easyupload.io/06k95o

  • Thanks alextro, it works but has an issue

    Please check this video.

    easyupload.io/aouukz

    and I'm a little bit confused about the

    -> SpriteX: Set B to LoopIndex%3+10
    -> Text: Set text to LoopIndex%3+10
    

    The picking number here can be any number series, For example, I gave 10,11 & 12 for the example c3 but it can be any no series.

  • I have a sprite named SpriteX. When it overlaps with the same instance of SpriteX, I want to perform a certain action. In this case, I want to set its position to the first instance of the sprite where it overlapped.

    To achieve this, I have assigned a boolean variable to SpriteX, called Draggable_Boolean. Based on this variable, I have selected the desired sprite where I want to perform the action by adding an instance variable called "A" to it. Additionally, I've created a family called SpriteX_Family and assigned an instance variable called "B" to it.

    In the comparison logic, when A equals B and the sprites overlap, I intend to set the position of SpriteX to the SpriteX_Family. However, this approach is not giving the expected results. This is where I need assistance.

    Please take a look at the attached .c3p file for further details.

    easyupload.io/2f39z4

  • It sounds like the issue is with collision.

    You can use "Guess the Polygon Shape" or you can manually make the collision point. If you are new then I suggest you watch some tutorials, which make you comfortable with the engine.

    youtu.be/DrjblVRnal0

  • That's really strange 🙄

    Even after you make a screenshot it does not let you hit the share button... does it work for you?

    Just to confirm, the issue is coming when you just preview the project right?

  • It is perfectly working for me, Maybe there is some extension or setting on your Chrome that causes the problem, so I suggest you try with different Chromium-based browsers.

  • Apparently, there is nothing called Twitter anymore hence the old Twitter plugins are now deprecated.

    Construct 3 officially suggests using the share plugin instead (Till they officially bring the "X" plugins).

    Anyway here is the in-built c3 template that can help you with this.

    editor.construct.net

    Here check how this template use c3's inbuilt share plugins to share screenshot with the message. (It works not just on Twitter but any app)

    Edit:

    I've seen the "screenshots example" project in construct, but the share function doesn't work - it's always disabled.

    The template is written in such a way that the share button is only enabled when the screenshot is taken.

  • thanks, cesisco, also I managed to do it with JS so posting the answer for future users.

    const arrayInstance = runtime.objects.C3_Array.getFirstInstance();
    const columnIndex = 4; // Target column
    
    let indexOfEmptyCell = -1; // Initialize with a default value in case no empty cell is found
    
    for (let rowIndex = 0; rowIndex < arrayInstance.height; rowIndex++) {
     const cellValue = arrayInstance.getAt(columnIndex, rowIndex);
     if (cellValue === '') {
     indexOfEmptyCell = rowIndex;
     break;
     }
    }
    
    runtime.globalVars.IndexOf_Empty_Cell_GV = indexOfEmptyCell;
    
    // IndexOf_Empty_Cell_GV is a Global Variable of C3 event sheet where I put the output.
    
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I want to determine the index of the first empty cell in a particular column of an array (The column has multiple rows (cell) filled with data). Once I find the first empty cell, I'd like to perform an action based on its position. Basically, I want to fetch its position.

    Tagged:

  • You do not have permission to view this post

  • I'm in.

  • Should I only put on my repo the .c3p file or should I put everything?

    No, you have to save your project as a Project Folder, that's it. Then commit.

  • The non-behavior way is to compare the distance between each pair of objects and push them apart and update their velocities if they are two close. That doesn't scale well with such a large amount of objects, so we need to do some kind of spatial hash so we only need to check objects that are nearby. Unfortunately if doing it with events it's hard to get that much of an improvement so JavaScript is better.

    Here's one possible test of that. It handles one object type and treats them all as the same size. Disable the group to compare performance with the physics behavior.

    https://www.dropbox.com/scl/fi/ja4hfo7dv9sqq7phs1q25/spatialGridJS.c3p?rlkey=heo2ewlpffq6n6kwusnnefdk8&dl=1

    With 1400 objects:

    Custom push out: 60fps

    Physics: 10fps

    The example also does it's own physics, but you can just use the spatialGrid() function if you just want push out.

    🔥 This is legendary-level programming.