dop2000's Forum Posts

  • I'm not a big fan of arrays in C2. I repeat this almost in every post where arrays are mentioned <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    I'm convinced that many things can be done much easier with objects and instance variables instead of arrays.

    Anyway, here is a demo where cards are moved like you want. I used an example from your other post, modified and simplified it (by removing arrays <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> )

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

    You will need MoveTo addon to open it. It's a great behavior and I highly recommend installing it.

    If you change "order by" to spCard.cardFace in event 10, then cards in hand will be arranged by their suit and value.

  • Yes.

  • If you rotate 90 degrees, check LoS and rotate back (all in one event), this will not interfere with any other LoS checks.

  • Animations, many system events and behaviors are automatically adjusting their speed to fps, they are already using dt for this.

    Same animation on 60fps and 30fps PCs should take the same time (ideally), "Every 1 second" event should take 1 second, bullet with speed 1000 will cover 1000px etc.

    If your second PC is so slow and laggy that C2 engine can't compensate it, then you will not be able to do this with dt either.

    Normally you only need to use dt when you are controlling objects with events, like moving a sprite every x pixels every tick, or scaling/scrolling the view.

    Edit: I did some testing, looks like dt can't be bigger than 0.0333. So if fps is below 30, the dt will still be 0.0333 and the game will run slow. You can't fix this with dt, because the actual frame duration is longer than 0.033

    Maybe you can do this by getting system time with JS or some addon..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads

    I have a powerful ultrabook with Windows 10 which I'm only using for about a month.

    C2 was working fine at first, but seems like it's getting slower and slower with each day. It sometimes takes about a minute to load, all dialogs are opening 1-2 seconds, interface elements are redrawing painfully slowly. And I'm not talking about big projects, it works like that even with blank projects. I don't know if windows updates are causing this or something else, but it's pretty annoying...

    And, like many others mentioned, there are no such issues on my two older laptops running Windows 8 and Windows 7.

  • CMuskett

    This is most probably caused by collision polygons or origin points.

    Use a different invisible sprite with Platform behavior and pin your character to it. There was a similar post just 2 days ago:

  • You can simply rotate your object with LoS 90 or 180 degrees, check LoS, then rotate back, all in one tick.

  • So UID is in Y0?

    When you set value at axis X in 2D-array, you actually set it at 0 index on Y axis.

    So "Set value at (X=2) to 99" is the same as "Set value at (X=2, Y=0) to 99"

    Have you tried my demo capx? It does exactly what you want.

    And also consider doing this without the array. Since you are dealing with instances and UIDs, you should be able do all this easier if you use instance variables.

  • When speed=0, there is no motion, that's why "Set angle of motion" has no effect.

    You can wait till the object gain some speed, or add an action "Set bullet speed to 0.01" before setting angle of motion.

  • Oh, sorry, I didn't know they changed it in C3.

  • All Rex's addons are here:

    https://c2rexplugins.weebly.com/map.html

    And I think 'PlayLive' is this guy:

    https://www.scirra.com/users/nandynho

    You can ask him or search his posts.

  • [quote:1exxm20z]X axis indicates 'UID' of objects.

    So do you actually store UIDs in the array or do you use UID as an index for X axis?

    For example when you do Array Set At(5,0) to 99 - does it mean that UID of the 5th object's is 99, or does it mean that object with UID=5 has HP=99?

    If you use UID as X-index and don't actually store it in the array, then you can't sort it!

    If you do store UID in the array, you can swap columns 0 and 1 and sort, then swap them back.

    Here is a demo:

    https://www.dropbox.com/s/88wse8qyrr3ys ... .capx?dl=0

    For other methods, see this post:

    viewtopic.php?f=147&t=67745

    Also, why do you need this array anyway? In C2 many things you normally would do with arrays, can be done much easier without them!

    You can store all these values (HP, size etc) in instance variables. And then you can sort them any way you like using "System->For each (ordered)" and similar events.

  • So what exactly is your question? Do you need to identify which instance belongs to which group? You can do this with Object.Pin.PinnedUID expression, although it would be easier to use an instance variable like GroupID.

  • I googled this, looks like the biggest number in Construct is 9223372036854776000, which I think is less than 10^19, that's why last two events don't work.

    So you need to invent some other way to work with such big numbers.

    Maybe at some point in the game when the number of coins is already quite big (10^10 or so) and player doesn't care about hundreds and thousands, you can remove 6 last digits from the number and start counting in millions?