Phealin's Recent Forum Activity

  • jojoe Thanks, I will take a look at that and no it's mostly gonna be used by me and two other friends so we can quickly make coded messages for each other rather than have to sit for a few hours to make them coded then another few hours to uncode them but it could be a cool thing to have in a game at some point if I make some sort of spy game or something!

    R0J0hound

    You make it sound so simple... It probably is and I'm just intimidated by the thought of arrays as I've never fully managed to wrap my head around them except for the very basics, I will try this out though thanks

    Also love that picture XD

  • Hello!

    I was going to write a simple little program for me and a friend to make secret coded messages and I have an idea in my head but I'm not sure how to execute it.

    To make it simple I have a number code: 1 0 5 1 9 8 6

    The idea is when you write the code you take the letters and push them forward acording to the numbers and when you reach the end of the number you loop around back to the start same thing with the alphabet if you use a letter to far forward in the alphabet and it goes past Z it should loop back to A, to me this sound like a for loop and an array thing where I make 7 cells in the array one for each number then when I type in a message into the tex box object and press enter I want the letters to be run through the array before finally printed out in the text below but changed.

    Example:

    "Hello" would translate into "Ieqmx"

    My thought process is this and I'm not sure if it's possible or if I'm overcomplicating it.

    While the selection box Normal to Code is sellected when the text box message is typed, you hit enter in this case we say "Hello" again, the text is then boiled down to variables for each letter A being 1, B being 2 etc, turning the word into "8,5,12,12,15" those variables is then put into the array adding the numbers from each cell onto the numbers making it into "9,5,17,13,24" then written out through variable into the text below as "Ieqmx" as those would be the corisponding letters to the variables.

    Then do the whole thing in reverse when I chose the "Code to Normal" option in the slection box where you subtract the number in the cells of the Array.

    Do you guys think it's possible and how should I proceed to make it actually work, it sounds easy in my head (And it probably is and I'm just a dumb xD) but when it comes to executing it I'm not sure.

  • So I've managed to make the tilemap behave as I want it to but I cant for the life of me figure out how I'm meant to make it so that when I erase a tile it give me the resource I just mined... As far as I can tell there is no way to check what ID the thing I just erased had and use that to trigger an adding of 1 dirt / stone

  • Thanks for your help man, I've been trying to do this all day and I can get the loop and array in order but I just cant figure out how to make the tilemap spawn the tiles at the right place atall...

    The Array states is right as I have it X is 5 and Y is 10, I set the loop to go Y 0-3 = 0 (Air), 4-6 = 1 (Dirt) and 7-9 = 2 (Stone) and the debug mode for the Array says 1-5 and they all have 0,0,0,0,1,1,1,2,2,2 so the arrays are correct.

    I have tried everything I can think of (obviously not the right things XD) to try to make the tilemap set the right tiles in the apropriate locations but all I get is the air tile with 16 16x16 blocks space apart from each other both on the X and the Y axis.

    My code for spawning blocks atm looks like

    Event: Array Current Value 0

    Action: Tilemap Set Tile (Array.CurX*16, Array.CurY*16) to tile 0 (normal)

    The same for dirt and stone but replacing the 0 with 1 and 2 respectivly.

    It work with just the one sprite called Blocks and just set one animation frame for each type of material but not the tilemap.

    Sorry for the super slow response, I never got a email that I got a reply on this and only just saw it the other day when I got in on the site by accident.

    Edit 5 minutes after post... I realized I'm a stupid... The CurX*16 and CurY*16 would only be for the sprite wouldnt it? Cus when I removed the *16 from them it all came together... xD

  • Hey! It's me again, been a while since I toyed around with Construct 2, or any game creating engine to be honest, I was looking through some of my projects and found on Game Maker my attempt at a Terraria type game and thought "This could be done so much easier in Construct 2!" so I'm converting my entire project to Construct 2 and I was looking around at the best way to do the terrain generation and found Arrays to be the most efficent way (Of course) and I started toying around with it.

    It's kinda working, as in everytime I launch it / refresh the page I get a new randomly placed jumble of air, dirt and stone blocks.

    But of course this is not exactly how I want it to work, I was wondering how do I make it so that say between the top of the layout till about... For argument sake say 32 pixels down it will only generate air blocks and then between 32 and say 64 only dirt blocks, between 64 and 80 it can mix stone and dirt and anything below that is stone.

    I have tried making a variable called worldheight which gets it's number from the layout height and then try to read inside that but I just can't get it to work.

    I'm assuming I'm gonna have to find some sort of perlin noise plugin to actually generate the terrain to make hills but to begin with I just want to be able to generate a flat surface as a starting point.

    I have a few other questions that pops into my mind as these will come up later I'd rather ask them now than later, better to keep them all in one place right?

    1. Should I be using Arrays to create trees or should I create a preset loadout of trees that is randomly picked everytime a tree is spawned / grown from a seed or is there a better way to randomize trees with leaves and all?

    2. Ore deposits, how would I create this the most efficent way without making it too much or too little? Also I assume I could use this same techinque to make underground cave systems by just replacing the ore spawned with air blocks to make air pockets?

    3. Is there a way to make so that everything outside the screen for the player is not loaded but the information is there so it loads up as the player gets there? This would reduce lag due to the lower RAM usage I imagine as this was an issue I had in my project in Game Maker or will this not be an issue as I will have set world sizes by making it so that they only fit inside the layout size which will have multiple different size settings when creating the world?

    4. Anyone know any good inventory / hotbar tutorials I can take a look at? I got a basic one up and runing but it only makes it so dirt can only be in one specific slot and stone in another specific slot so it's not very effective as I want the player to be able to move the items around as they please.

    5. Also, crafting, how hard would this be to make? I was thinking a fairly simple crafting system like Terraria where if I have the required materials in my backpack it appears in my list as craftable items and I click it and it gets made, it shouldnt be too difficult. Come to think of it I could probably figure this one out myself but I just wanna check if my thoughts on it work.

    Wouldnt it just be a set of variables? A variable check that checks for say 2 wood and 3 stones and a button appears in my crafting list that says "Stone Pickaxe" I press it, the variables are pulled off my total amount, a stone pickaxe is added in my inventory and if my total material amount goes below the requirements the button vanishes/gets greyed out from the list. Is this the correct way to go?

    Another question that is not related to this project is I've noticed when I try to testrun my game either with or without debug mode sometimes it just don't load / takes up to 5 minutes to load, usually I have to save my project and restart the program before it starts up instantly when I press play.

    This is not on big projects, I could literally place down a 32x64 platform with solid behavior and a little 16x16 character with the platform movement behavior and it'd still take so long sometimes and sometimes it's instant.

    I'm sorry for asking so much but I find it's better to ask everything at once instead of asking it separate, I have looked at many capx files for terrain people have posted and some have been fairly nice but I havent been able to figure out what makes them tick and most have not been what I'm looking for.

    Thanks in advance for anyone who can help me with either of these questions or point me in the direction I need to look in order to start tackling this.

  • It works though, it works on every place except the ones who are too far right of the "base" but I guess I'll just add a "on path found" and it should work?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi! It's me again!

    This time I've been toying around with possibility of doing a RTS and I got some of the base mechanics down when it comes to movement and harvesting which are working with some weird exceptions and I wondered if anyone can help me figure this out

    My code is as following:

    and this is the exact same except switching out the food parts to gold, stone and wood

    and it works and don't work as the image below shows:

    The weird part is it's not a error in the code as you might think, the problem lies in the positioning of the blocks it seems because if I put the gold and stone (the two on the right) where the wood and food (the two on the left) are they work but the wood and food don't.

    Can anyone help me figure this out? I've tried placing the blocks further away from the "base", to no affect so it's not that they are too close.

    If you need to have a look at my capx to get a closer look let me know and I'll PM you with a link for it.

    Edit: Forgot to mention during the debugging on the ones that don't work the game finds a path to the destination but it don't start moving along the path.

    Edit 2: I've noticed this only happens to resources that are to the right of the main base, if that helps anyone understand what the problem could be.

    Maybe pathfinding cant go into -x or something? It just confuses me more than I am now personally...

    Edit 3: I tried moving the base to the right of all the resource nodes and then it works just fine and then if I move it to the left of the nodes none of them work, so it seems like if the position I wanna go to from the node is in - X from the original position it don't work.

  • I agree with bjadams I love the artstyle, I wish I could help out but I'm too new to this.

    Good luck and I look forward to trying this out when it's done

  • I had another idea from your example, another thing that should have come natural to me but I was just being impatient and was looking for a much more advanced answer than was needed. Instead of having the player look for a collision (which causes the player to get stuck everywhere whenever there's a object next to it) I have collision detectors following around me so again thanks! Now I can finally proceed

  • Minor It looks different but I suppose the idea behind it is the same, they do sound alike.

    Also I do not have player as solid nor do I have the wall as solid and they still collide, I'm not sure why atall.. Maybe it has something to do with the offset being wrong on the wall object but I cant see how it can be..

    Also I've noticed another problem, if I collide with the wall on the X axis I sometimes lose the ability to move on the Y axis and same the other way around but not every time, it's all very strange.

    I probably forgot something really important, gonna have a look at that capx and hopefully I can spot it!

    Update: After looking at 's file I realized the "loop while" thing was not there and upon removing them I can now move

  • I sortof get it but at the same time I dont. I know how you mean I just seem to have issues executing it

    This is how I understood how I make it:

    First I check if the players "buffer_x = 0" and "buffer_y = 0" then I add a "Sub-Event" that have a "Loop While" and "Right arrow is down" with the action "Add 32 to buffer_x" and do the same for the down, left and up key except the left and up keys "Subtracts 32 from Buffer_x" and Buffer_y all in their own sub-events under the first event.

    Then a sepparate event checking if "buffer_x > 0" with the action "Set buffer_x to player.buffer_x -2" and "Set Player.X to Player.X +2"

    If that was just too messy (Probably was XD) here's a link to a screenshot on how I made it <img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz">

    http://imageshack.com/a/img843/267/75sm.png

    When I press left, right, up or down it do not change my buffer_x / buffer_y variable, I probably screwed it up but hopefully you can point out how

  • For some reason my reply is gone...

    Anyway thanks for the advices, I will look at them all.

    The roguelikemovement-slide key down posted by Minor is the closest to what I want but when I adapt it into my own game it still dont work I still cant get into the 32x32 gap between my wall objects, it is really strange..

    Any thoughts on what could be causing this?

    I have tried setting the origin point of all objects at both 16, 16 (aka center) and at 0,0 (aka top left) and both wall and player are 32x32 solid squares with collision boxes at 32,32 on both so it shouldnt cause problems right?

Phealin's avatar

Phealin

Member since 26 Jan, 2013

None one is following Phealin yet!

Connect with Phealin

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies