tarek2's Forum Posts

  • Yeah I agree, I explained the same issue in the comments here:

    construct3-21h2.ideas.aha.io/ideas/C321H2-I-297

    Will be nice if the Hierarchy supports any type of object so we don't have to use the Pin for dragging objects as it has that issue that it updates one tick behind.

    Maybe we should open a new Feature request as dop2000 request it was just for the TileMaps though.

  • Sorry for the triple post but Disabling solid on 'player' has fixed the issue. No idea why this would make a difference but there you go.

    Honestly is very confusing on C2 they followed one system for years and on C3 they changed it so:

    On C3 if you have solid on the object it will not trigger the LOS

    On C2 however, if you have solid on the object it will trigger the LOS

    Here is an example:

    Using the last C2 Version

    https://www.dropbox.com/s/bofqrbm7lc7kyfk/LOS.capx?dl=0

    -If you open on C2 you will see that it triggers the LOS by setting the Opacity for the black sprite

    -But if you open it on C3 it will not trigger, not sure why they don't follow one system

    The same thing they did with the Load from As.JSON they changed how the system works and they broke all the projects that use C3 R288 and lower unnecessary making people wasting time hours of work redoing all the events, not sure why they keep doing this as it's not professional at all.

    Here is the Link:

    https://github.com/Scirra/Construct-3-bugs/issues/5964

  • The Picture shows that you are looping through a 2D Array using the "For Each XY" but in the Conditions, you are just checking the First Raw (Y = 0)

    You will need to change both conditions:

    Value at (Self.CurX, Self.CurY) = fem_code
    Else: Value at (Self.CurX, Self.CurY) = mal_code
    

    Though you say you need to know the "Raw" but to get the Raw you need to target the "Y" not the "X"

    Basically I am looking for 2 values one is "mal_code" and the other "fem_code" in the first column

    The same thing I explained above if you need to check just the First Column you need to target (X = 0)

    Value at (0, Self.CurY) = fem_code
    Else: Value at (0, Self.CurY) = mal_code
    

    That will target just the first column though instead of looping the whole Array just to check the first column unnecessary you can just use the "For" Loop and check directly the first column. If you have a small Array then is ok you can still use your method if it's easier but if it's big then I recommend you to use the "For" Loop.

    Example:

    For "Y"
    
    From 0 To Array.Height-1
    
    Value at (0, LoopIndex("Y") = fem_code --------- Set fem_code = LoopIndex("Y")
    Else: Value at (0, LoopIndex("Y")) = mal_code ------ Set mal_code = LoopIndex("Y")
    

    This will check just the First Column

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > > I'm making a game in which the ball will bounce continuously or forever. How can I make it?

    >

    >

    > The simplest way is to add to the Ball the Bullet Behaviour and set "Bounce Off Solids" True

    >

    > And don't forget to add the "Solid" behaviour to the walls or the objects that the ball will bounce from

    but at some point the ball stops bouncing

    No, unless you stop the bullet

    Here is an example:

    https://www.dropbox.com/s/sqcx3g40uelys2k/Ball%20Bounce.c3p?dl=0

  • Thanks for the reply! Let me be a bit more specific:

    I have a dictionary containing in-game currencies. I'd like to use a text object to show these currencies.

    When adding a new currency to the dictionary, I'd like to add its CurrentKey and CurrentValue to the text object.

    If the text object already has such key, I'd like it to only add its CurrentValue.

    I hope this makes sense, I'm pretty stuck at this and it might be a suboptimal approach. If you have a better method I'm all ears.

    Thanks again.

    Instead of checking the Txt object if has the key you need to keep track of the Printed (Keys & Values), for this, I will just check if the Key exists will be much easier:

    Example:

    On Currency Check:

    --------- Dictionary has Key?

    -----------------If Yes: add the value to the existing value in the dictionary and then clear the Txt to Print all currency (Key & Values) again

    ----------------- Else Key Doesn't Exist: add the new (Key and Value) to the dictionary then Update the Txt object with a new line and print the new (Key & Value)

    This is so to avoid updating every tick the Txt object

  • I'm making a game in which the ball will bounce continuously or forever. How can I make it?

    The simplest way is to add to the Ball the Bullet Behaviour and set "Bounce Off Solids" True

    And don't forget to add the "Solid" behaviour to the walls or the objects that the ball will bounce from

  • There is nothing wrong with your events that will stop the Enemy in that state forever, it should work.

    I will check first:

    -If all the enemies have (LOS = 32) because if they have a big LOS then that will prevent them from switching to no Attacking

    Also, check on the Debugger:

    -If the MoveTo is enabled as you may have another event setting the MoveTo disable

    -You can check to swell the enemy State if it switches to No Attacking so you know there is something wrong with the LOS

  • For the first loop, you need to divide the TileMap.Width by Tile Size and the same for the Height

    Example:

    We have a Tilemap that has (Tile size =32)

    For "Y" From 0 To floor(Tilemap.Height/32) -1
    ------For "X" From 0 To floor(Tilemap.Width/32) -1
    
    + Tile.At(loopindex("X"), loopindex("Y")) # -1
    
    
    -> System: [Create object coin on layer "Tile" at
    
    Tilemap.TileToPositionX(Loopindex("X"))
    Tilemap.TileToPositionY(Loopindex("Y"))
    
    
    
  • can you help me in this thread if you parse it like this i want to prevent duplicate entries from being created

    Quite difficult to help as it has:

    -Many parts in a different language

    -We don't know what Data is coming from Photon?

    -We don't know what you exactly target on the tokenat? I know you are targeting "_" but what is your expected result? for anyone to be able to tell you if there are any mistakes.

    Can you provide an example of:

    -A line of Data received from Photon (if possible make the line contain a duplicate from the List) true so we know what you expect to not include on the List

    -And explain what you exactly expect from this line of Photon

  • > Doesn't support that feature at the moment so you will need to do it yourself by looping through the existing List and removing all the duplicates.

    >

    > Here is one way of doing it:

    >

    >

    >

    > https://www.dropbox.com/s/ogpzayc4j0cdd75/Remove%20List%20Duplicates.c3p?dl=0

    Can I have the same example on Construct 2, I still can’t enter Construct 3

    You should have been able to replicate it easy in Constrcut2 as is the exact same code.

    Here is the C2 version:

    https://www.dropbox.com/s/aapubb5rbm61j8w/Remove%20List%20Duplicates.capx?dl=0

  • I'm not of much help as I don't use the scripting though I think you will get better support if you post it in Scripting Section:

    https://www.construct.net/en/forum/construct-3/scripting-51

  • Not sure if I understood correctly but it looks like you want to encrypt the "a" and then decrypt back the "a"

    Maybe something like this?

    https://www.dropbox.com/s/xa9isi26qrs29z6/1-Encrypt.c3p?dl=0

  • Does it matter that you wrote positionToTile"X" twice in your code? Is the second one is supposed to be positionToTile"Y"?

    Yep definitely it should be positionToTile"Y" good spot

    "Not sure if that will fix your issue though" for:

    So everywhere I read that you can use PositionToTileX function... yet this function is not accessible in my code... it says:

  • That I cannot reproduce. After switching the worker mode on it works as crisp as it gets with the debugger open, which is in my case 144 fps with no hiccups.

    I'll put it in the tracker.

    https://github.com/Scirra/Construct-3-bugs/issues/5926

    Yep that's the best thing we can do start with the Bug that we can all reproduce like the (Worker ON/OFF) and then see what's going on with the other one. Though they may fix the first one and that fixes the other if somehow they are related.