Lazernaut's Recent Forum Activity

  • Thanks for pointing me in the right direction

  • Hey all. I'm working on a roguelike game. I want to use arrays to manage things like monster types, their health, attack values, defense, weapons, drops etc.

    Thinking about how I want to structure it I realized that if I built it all directly using arrays I would in effect be creating a manual relational database. I was thinking, for example, to have the class the player chooses represented by a global variable using a number. Then I'd want to make an array that had the information about the class' names and their data (attack etc.). The same would be true for items and monsters and such.

    Making that directly in Construct2's event sheet would be a hassle I think. My most preferred method of entering the data would be to just write out all the values manually in an Excel sheet and have the game import this. If that's not possible then maybe write out the data in text files and separate the values by commas.

    I'm interested to know what you guys think would be the best approach?

  • Alternatively you can use the tilemap feature as well. If you make the object itself the size of 1 tile/sprite you can change the image in the first tile according to what you want displayed.

  • if your global variable is a number then that is the reason I think. A number is a type called "number". The text object only takes data in the "text" format. If you want to use data of the type "number" in text you might need to surround the number with "str(...)" when you set the text. Like this:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
    • Green box = player
    • Orange dot = collision detector

    The black tiles are fog. These are supposed to turn invisible when you explore them. The red/green dots on the black tiles indicate whether a boolean has been set or not. Not sure that's relevant here.

    I hope that made sense, otherwise I'll try and explain it more

  • Maybe you can use the function object?

    on function "resetVariables"

    • set variable x to ??
    • set variable y to ??
    • set variable z to ??

    Then call the function each time you need to reset the variables.

  • Hello. I'm making some line of sight code for a roguelike game. I'm not sure what the best approach for such code is so for now I'm hardcoding it with the intention of optimizing it with loops and such after I figure out the best approach.

    If you look at my screenshot I've got a problem. If I nest the checks only the first one evaluates to true. This is a problem as I need the code branch to stop if a wall is encountered (the player shouldn't be able to see through walls of course). As you can see from the attachment the 4 code blocks only work if they're not nested.

    Can anyone tell me what I'm doing wrong, or how I can do it differently?

  • You should probably use Construct Classic. As far as I can tell Construct 2 is only for games. There's a seperate forum for questions regarding Construc Classic that you might have more luck on.

  • This might help. If you have 2 sprites just so 1 object can change the way it looks I recommend you use 1 sprite with 2 animations.

  • I'm sorry but I think there might be too little information to help you. Maybe you could try describing the problem in more details and explain what you've tried. It's also a possibility to attach the .capx file here in this thread so people can have a look at it

  • If you want an object to be placed in the middle of a layout you can do this (see picture).

    If 1 is too fast and 0.1 is too slow you might need to take a different approach than using "every tick".

    If you make a global variable called "timer" and then add 1 to it every tick you can use that to change how often the calculations are triggered. So basically:

    Every tick - Add 1 to "timer".

    If "timer" = x (try different numbers to see what works for you) then set "timer" to 0 and also trigger the calculations once.

    Hope that made sense.

  • Yeah - a lot of things have built in "while" functions unless you set a "Trigger once" condition

Lazernaut's avatar

Lazernaut

Member since 19 Feb, 2013

Twitter
Lazernaut has 2 followers

Connect with Lazernaut

Trophy Case

  • 11-Year Club
  • Entrepreneur Sold something in the asset store
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies