dop2000's Forum Posts

  • Mikal's new Greengrinds addon has this condition. EDIT: and the official Greenworks plugin too!

  • Yeah, that's one way to do it. You can also use a binary value - see the documentation for setbit and getbit expressions.

    Another option is to use 4 variables: Fire, Earth, Water, Air. They can be boolean, but I prefer to use number variables with values 0 for false and 1 for true.

    Then when fire attack is placed in any slot, you set Fire variable to 1. When water attack is in any slot, set Water to 1.

    Then you can use them to build the name of the bullet template:

    Set TemplateName to BulletType
    
    If Fire=1 : Set TemplateName to (TemplateName&"_fire")
    If Earth=1 : Set TemplateName to (TemplateName&"_earth")
    If Water=1 : Set TemplateName to (TemplateName&"_water")
    If Air=1 : Set TemplateName to (TemplateName&"_air")
    

    Or a shorter method:

    Set TemplateName to BulletType & (Fire=1 ? "_fire" : "") & (Earth=1 "_earth": "") & (Water=1 "_water" : "") & (Air=1 : "_air": "")
    

    As a result you will have a string like "nova_fire_water", even if the water was added first in the first slot.

  • I was planning on doing most of my damage and modifier coding directly on each sprite.

    Actually, yes, you can do this instead of using the array. You can use a single Bullet sprite with multiple animations in it (bullet, bomb, nova). And add a bunch of instance variable to the sprite - "damage", "effect" etc.

    Then put 40 copies of this sprite on unused layout, set their animations, configure each copy for a specific attack, and set them as templates. For example, a bullet for fire+air attack may look like this:

    Then you can spawn a bullet from this template and it will be created with all the correct values and the correct animation. You will need a single action for all 40+ attacks!

  • First of all, it was a wise decision to ask for advice before starting to develop the game! I've seen too many examples where people did the opposite.

    While you can create 40+ boolean variables and code each of the attacks separately, this won't be a good solution. Such code will be difficult to manage and worst of all - it won't be expandable. Imagine if you decide to introduce two new elements later, when the game is almost ready!

    So my suggestion is to use some data object to store all attacks and their properties. Here is a example with an array:

    I chose an array because it's easy to edit in C3, but there are other options - JSON, CSV (Excel), XML etc. In fact, I would probably use the array for entering and editing data, but convert it internally to JSON in runtime.

    With all the values configured, you will only need 3 variables to start an attack and your code can look something like this:

  • Remove the silence at the beginning/end of the music track in any audio editor. I'm using GoldWave.

  • Desktop build of C3 has been retired. You can probably find and download an old version of it, but it may not work correctly.

  • I don't recommend applying state-machine approach for everything, this often results in incredibly entangled code. Instead of checking variables on every tick and using "trigger once" condition, it's much easier to create a function. Call the function from the event where the state changes (for example when the target is selected). This way you can be certain that it will be executed once only. You can add console logging to see if and when the event is executed.

    What is the correct way to use "Trigger Once"?

    I can tell you where you shouldn't use it - inside of loops, triggers, functions, and with objects that have multiple instances. It's often difficult to predict how it will work in these situations. For example, this code seems so convenient, but it will glitch if there is more than one enemy instance with HP=0

    Enemy HP=0
    Trigger once: Enemy play "death" animation
    
  • Awesome, we'll try these options, thanks!

  • It's difficult to tell from these screenshot and your project file is inaccessible. But I would change the way the whole thing is triggered. That "Else Trigger once" event probably won't work correctly because numberMagic is a local non-static variable, it gets reset at the end of every tick. (unless it's inside a function)

    Be very careful with Trigger Once condition, it can cause all kinds of problems when used incorrectly.

    Also instead of "waits" I suggest using Timer behavior - it gives you much better control, you can pause/cancel it, run different timers per each instance, and you can use "On timer" event to schedule the next action.

  • Sir LoLz Try different versions from recent comments in this post.

    For example:

    construct.net/en/forum/construct-2/addons-29/behavior-easystar-js-96215/page-12

  • There are several ways you can combine multiple objects in C3. The easiest is to create a hierarchy. They won't become a single object, but it will be easier to deal with them as a group - you can create/destroy all objects in the hierarchy with a single action, move/rotate/resize/fade them all at once etc.

    Also check out the templates feature:

    construct.net/en/make-games/manuals/construct-3/project-primitives/objects/templates

  • It turned out Steam does not allow to upload two separate Mac builds - one for Intel and another for Apple Silicon devices. We can only use one build and it must be Intel, because it's compatible with all macs.

    Will it be possible to create a universal "fat" build which includes both Intel+ARM NWjs exports? There is a discussion in this post (scroll to the end), but I don't see a solution.

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You do not have permission to view this post

  • You do not have permission to view this post

  • What I usually do is switch to Desktop mode on the deck, right-click on the executable, Add to Steam. Return to gaming mode, the game should be in the library under "Non-steam" tab.