dop2000's Recent Forum Activity

  • Use a calculator:

    (mouse coordinates-tilemap position)/tile size

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, I have the same error when using the latest NWjs version 82.

    The remote preview works fine with NWjs 75

  • 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

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 257 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies