SoldjahBoy's Forum Posts

  • I have a lot of instances of the same object in my current project. I assign an instance variable to the latest created - and a global variable to match the latest created object.

    When an instance of a particular object is created, I use an instance variable (called ActorID) that is set to the current "actor.count" as well as the global variable.

    Maybe something like this will help?

    Variables are awesome...

    ~Sol

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is your game tile based?

    You can easily "take water" from a tile (clear the tile to "air") then use a tile comparison (overlap at offset) to determine if the tile should be water gain shortly afterwards... or just make it so the water tile never actually disappears at all and just "take water" with whatever method you're using.

    ~Sol

  • You can fire a fake raycaster object - I do this with a few projects.

    You make a bullet object the fires *super fast* before your shot to measure targets and solids.

    It's basically an invisible bullet that fires at a hugely fast velocity - then use that data to return some info.

    ~Sol

  • Okay, turning your cell size UP to about 20, and the cell border DOWN to about 2 or 3 immediately made a massive improvement.

    With your previous setting, the ewnemy was looking basically for a gap of over 50 pixels to fit through which is why they were having some issues trying to walk around through your structure.

    After changing those setting just quickly - I got swarmed and died almost immediately from about 10 enemies running straight for me with little to almost zero "circle running" or hesitation.

    Hope this helps... but you can maybe tweak even further - 20 and 3 were the first settings I tried.

    ~Sol

  • You probably need to use instance variables (variables specific to the object) in order to make different "stats" for your weapons.

    You can then make ONE event that references the instance variables (which can be different per weapon). Global variables aren't as flexible for this type of thing, unless you have a tonne of them - instance variables are much easier to use on item specific stuff. You can easily have all sorts of instance variables, like "reload speed" and "accuracy" or even "weight" - things like that.

    Hope this helps.

    ~Sol

  • It could be that your path assessment is too short... every 0.5 seconds doesn't leave much time for them to execute the path before "stopping" to find another path.

    If you can post your capx file, then maybe I can have a look and see what the problem may be if increasing the time (make it like 5 seconds or more) between path calculations doesn't help.

    ~Sol

  • Using an invisible object for platform collision is a common practice, and often recommended since it will never change in shape or collision bounding box - it just makes life a little easier and consistent.

    ~Sol

  • Hey guys,

    I've come across an interesting issue, and wondering if anyone has any idea how to work around it - or if maybe I'm doing something wrong.

    I have several layers set up in my game, the newest one being my "sky" layer which I use to make day and night. It's a blank layer set to black background with opacity set lower than 90, and I'm using for lighting (sprites set to 'destination out').

    The problem I am having is - some layers are parallaxed and have objects that I'd like to give off light - while other objects are on my "non-parallaxed" layers which also need to give off light. Obviously this causes an issue when you start scrolling around the layout, since the light source for the parallaxed layers doesn't stay on the object where it should.

    I've tried creating more than one lighting layer (setting one to the parallax scroll rate and leaving the other one as default), but the effect of lighting is massively diminished by whichever lighting layer is below the other.

    Am I doing something wrong? Is there a better way?

    Hopefully I have explained my issue correctly.

    *EDIT*

    I managed to find an expression I've never seen or used before - Oh Construct 2 how do you still surprise me?!

    Just in case anyone else runs into this same problem I found the solution in this tutorial by Katala

    I'm using only the ONE lighting layer still, but tracking the coordinates of the parallaxed object(s) by using the above expression.

    ~Sol

  • Will they always be traveling to the right or will they also be going left sometimes as well?

    I have an idea how to make it work - and should even work with terrain that's moving up or down, but implementation will be a bit different depending which way the sprites are moving. If always to the right it will be a bit easier, but if they need to go both ways it will be a little more tricky.

    Basically you will need an instance variable for each sprite, let's call it "direction". You will then need to set this instance variable to either "up" "down" "left" or "right" (or 1,2,3 or 4) using conditions - then set the movement in the desired direction based on the variable value. You will need a second variable for which *general* direction it's heading (left or right) if the sprites can move both ways. This second variable will act as a secondary condition check.

    Pseudo code:

    ----------------------

    [condition]

    --- sub event

    --- sub event

    ----------------------

    (these vents would handle the "flat" sides of your sprite collision polygon)

    [sprite is overlapping terrain at offset.x +1] (or x-1 if moving left)

    --- Set Sprite.DirectionVariable to "up"

    [sprite is overlapping terrain at offset.y +1]

    --- Set Sprite.DirectionVariable to "right" (or left)

    [sprite is overlapping terrain at offset.x -1]

    --- Set Sprite.DirectionVariable to "down"

    (Diagonals would be a little trickier)

    [sprite is overlapping terrain at offset.x+1 AND offest.y+1] (upper left corner of your terrain object)

    --- Set Sprite.DirectionVariable to "right" (if moving RIGHT, or set to DOWN here if moving LEFT - this is what I meant by it being a bit trickier with multiple directions)

    [sprite is overlapping terrain at offset.x-1 AND offest.y+1] (upper right corner)

    --- Set Sprite.DirectionVariable to "down" (if moving RIGHT, or set to LEFT here if moving LEFT)

    (Then finally the movement itself)

    [sprite.DirectionVariable = "up"]

    --- Move sprite and angle 270 at speed X (bullet behaviour - customer movement - however you're moving them)

    [sprite.DirectionVariable = "right"]

    --- Move sprite and angle 0 at speed X

    [sprite.DirectionVariable = "down"]

    --- Move sprite and angle 90 at speed X

    [sprite.DirectionVariable = "left"]

    --- Move sprite and angle 180 at speed X

    I hope that made sense. I can't make an example right now - but hopefully that helps a little?

    ~Sol

  • Are you talking about an iframe INSIDE of your project (using the html elements pack plugin) or is this an iframe running from the html page on a website with your project inside of it?

    ~Sol

  • You can use sprite fonts if that helps... it renders faster than normal text object anyway and gives you full control over how your fonts look.

    ~Sol

  • That looks mad!

    Gigatron, king of madness

    ~Sol

    • I have fully added in the weather components (subject to change based on Gigatrons new fogfx he's working on)
    • Added in nice colouring for dusk and dawn during the day and night cycle change
    • Added a sun and moon in the sky
    • Added snap-building to the room construction (still needs full error checking to make sure you can't build rooms overlapping the entire structure)

    ~Sol

  • Here is an example capx file that I made - doing (I think) what you are wanting to do.

    I'm trying to teach you to "Fish" for yourself - so next time you get hungry, you can catch one yourself. If someone always feeds you a fish, you will one day starve without knowledge.

    I hope this helps you to learn what variables are and how you can use them.

    DOWNLOAD EXAMPLE

    ~Sol

  • It can't be any simpler than that...

    Variables are a basic and fundamental part of making virtually anything in any game. There is already loads of documentation, including but not limited to the CONSTRUCT 2 MANUAL ENTRY.

    My example "pseudo code" should be easy enough to follow - but if it's not, I'm afraid no amount of tutorials will prepare you for anything even considered slightly more difficult - however HERE IS A TUTORIAL about using variables. Here is ONE MORE using variables for "lives" in a game - which could easily be used for things like counting ammunition, health, or which character you've selected on another screen.

    Best of luck!

    ~Sol