just.a.test's Forum Posts

  • Oh ok. I hope your game works out.

  • Do you use the keyword "self" while writing expressions and events?

    I didn't use this at all! That makes so much more since to use instead calling the sprite!

    I'm not going to share my code because while experimenting with all these tips in this topic, I managed to fix all of my mistakes using "For each object" and "Pick". So it would kind of be a waste of time for you guys to go over it. Your replies really helped me a lot!

  • only the enemy with health above 50 would be included in the loop. If you put the foreach at the top them all instances would be picked regardless of their health, but only the enemy with health above 50 would be effected.

    yeah that was mostly my mistake: I've been doing it the opposite way. Ex:

    For each object:

    If health is < 0{

    }

    And I had like 700 of these objects. No wonder CPU usage was extremely high. Thx for that tip (I didn't know that conditions affect the for each object loop)!

  • anytime bro

  • Yeah it's kind of a pain: why can't conditions apply to all objects that it's valid for? For me, "Pick all" doesn't really act the same as "for each object" and it's difficult to tweak the code to make it act the same along with the benefit of lower CPU usage.

  • Could it be because of this: You have multiple "create object Pillar" actions on the same event. This makes it so that if you create another Pillar, both Pillars will follow the same action.

    What I mean is (in order):

    - you create one Pillar

    - you set that one Pillar's PillarNumber to 0

    - change its tween property "Position"

    - then you create another Pillar

    - then both pillars set their frame to 1

    - both pillars set the PillarNumber to 1

    - both pillars set their tween property "Scale"

    Is it because you are changing stuff to both pillars after you create the second object, it offsets it? Sorry for late reply btw

  • Yeah I assumed that would be the case. I was just wondering if there was a way to lighten the load on the cpu directly without altering my code.

    EDIT: I found the reason why the CPU was so high: I was using "for each (object)" every tick. I had 700 of said objects! Silly me.

  • Before you start the game make sure the object (It doesn't have to be initially created or on the layout) is under the family you want it to be. If you create any object using code, it should be under that family. In my image, kerosene and items are not on the layout itself yet when I create them using System or Spawn from object, they are still under the family. If your issue persists, the issue is not assignment from object to family but rather a condition that picks your object by itself.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I can really answer #1 because I never exported as NW.js but Mac does have a trailing "\Documents". In theory, the NWjs.UserFolder should point to a valid user's path on Mac because Mac file system is mostly identical to that of windows.

  • I'm having trouble understand your issue: could you post a picture of your code or explain your issue more in depth?

  • Notice that the GPU is basically 0% and the CPU is close to a 100%? Is it possible to make my game run utilizing more of my graphics card rather than my CPU?

  • Check out the new online multiplayer game I created!

    https://www.construct.net/en/free-online-games/tackle-tanks-43327/play

    or

    tackletanks.io

  • I wanted to achieve something similar to this also. The closest I got to this was making all objects do the additive blend mode.

    And then over the whole screen, I added a dark blue film with about 50-100 alpha (for transparency).

  • There might be an easier way to do this via the behavior plugin, but I would create a code with something like this:

    This is optional but you can add a brightness effect to the wall and then replace opacity with brightness.

  • ...i get it...