ConraKojiro's Recent Forum Activity

  • This is exactly what i'm looking for, cheer for the quick response!

  • Hello!

    I'm trying to make an oldschool dungeon crawler like ROGUE, I'm wondering how it's possible to achieve turn based pathfinding using arrays or tilemaps. I'll give a quick run-down of how my project works:

    I've got a procedural generation dungeon created in a 50x30 cell Array. 0 being a wall, 1 being floor. To which I do a 'For Each X&Y Element' condition to render each cell to it's counterpart on the tilemap. It all works nice.

    However the problem comes with enemies, Construct 2 has built in path-finding. However it uses actual collision checks with objects to which i'm not using objects for my walls. I figured since the map is procedural generated for each tile that's not equal to 1 i'll create an invisible wall object the size of each tile. So that the pathfinding will work. But the problem lies that my game's map is 50x30 tiles per floor. And some floors will only have about 200 of the tiles as walk-able flooring so you can imagine how intensive that'll be to run having over a thousand invisible objects on run time?

    And factoring in the problem of i'm using turn based movement instead of Construct 2's pathfinding movement. I figured I would call a 'FindPath' action and then use the 'Pathfinding.NodeX' and 'Pathfinding.NodeY' expressions to determine which tile to move to. Every turn it would recall the 'FindPath Action'to update. But this is only achievable if I can find a way for the PathFinding behavior to work with either a tilemap/array.

    Does anyone have any suggestions?

    Thank you, Pixel.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How did I never see this before? Thank you very much.

  • https://imgur.com/a/tXbkT

    To summarize, I have made a board game where dependant on what tile you land on you draw a card, obviously items cards you'll keep in your hand. However if you use them, i'm struggling of a way to remove them.

    The way I have it implemented the array is X = Card Name and Y = is how many of the type of card you have in your hand. (aka, 5 potions or whatever).

    I have tried to make it so the game detects when you have 0 cards left of a certain type, it removes it. However you can only pop the front or back, (which honestly sucks since it'd be nice to pop specific values.) so i'm trying to switch it with the card below until the one that needs to be deleted has reached the back of the array where it will then be deleted. I'm obviously not doing something right here and after playing around with it for 2 hours i'm at a loss on what to try next. Any help or other possible easier solutions would be greatly appreciated.

    Note:

    • I typo'd remember which is why the variable is 'ramamber' and I found it funny so I didn't change it.
    • 'p1handfilter' no longer exists but I didn't delete the line since it doesn't do anything so I forgot about it.
  • This fixed it, thank you very much sir.

  • Title is self explanatory, I'm using an array for a Final Fantasy style combat system. At the beginning of the turn it maps who's alive and stamina they have, depending on the stamina stat the array orders it into who attacks. After the unit attacks, the array shifts down until everyone has attacked.

    However if a unit dies before it has had it's turn I want it to be removed from the array since y'know it can't attack anymore. I know the event to search the array for index containing the value i'm looking for. But when I go to set the index how do I reference the index that has been located in the conditions? I want to to use the "Set X" action.

    Any help would be appreciated.

    Link to a visual example of my problem here:

    http://imgur.com/a/845C9

  • blackhornet

    Don't worry, I sorted it by setting it to instead of finding 0,0. It finds 6,0.

    But I've encountered something new.

    I've added in players 2 and 3 now, so there's 4 units in all. The only problem is it's re-ordering the Y (stamina) but because the x and y (0,0 and 0,1 for example) aren't tied together it's not actually changing the battle order. It's just assigning the quickest stamina to enemy 1 so it'll always go first. Is there a way to group them together so when I move enemy1's stamina, enemy1's position in the que moves with it?

  • Upon playing It's not quite what i'm going for, the turn variable was for testing so I could see in de-bug mode what was currently being done. I'm testing 1v1 but I want it to be changeable so it could be 3v3. However the way you've mapped the Array is that it destroys itself when I want the game to keep going until someone has died. I haven't implemented that since this is just a turn based test, I wanted to just get an infinite battle system which every time you launch the game the stamina stat in different. so sometimes the enemy will outpace you, other times it won't. Once that's working i'll implement more enemies so it's proper.

    The way I've mapped it is that X contains the enemy type (1 = player1 , 2 = player2, 3 = player3, 4 = enemy1, 5 = enemy2, 6 = enemy3). And Y contains the enemies stamina of the player/enemy. The reason I'm using Arrays is because it saves me makes 10 million variables and it has a nice sort feature. So I can sort by the y which is the stamina stat. But my question is, if I sort the Y will it move the X too? because otherwise player 1 will end up with someone else's stamina.

    Thank you for replying.

  • blackhornet

    Thank you for the response and yes, I wanted to make it work like that, so it only checks the 0,0 and after every action is completed it will shift everything up, so 1,0 is moved to 0,0. 2,0 is moved to 1,0 and so forth. Will that work or will I have to check 0,0 then once the move is executed shift to 1,0 manually? So rather than replacing 0,0 with 1,0 , I just check 1,0 then 2,0 in order are separate events? I'd prefer to do the 0,0 method since it'll use less events but if that doesn't work i'll change method.

    I thought that the moment you enabled the group the "Trigger Once" would trigger it the moment the group is activated once. Guess not.

    Thank you for the help. It's very much appreciated.

  • I'll keep it brief. I'm trying to create a battle system using an array, groups and functions.

    I have an array to set the order of actions determined by the players stamina stat (speed).

    Once an action is completed it updates the list. But after the first action the games stops. But when I run in de-bug mode, I can see it's not mapping WHO should attack. Just how much stamina they have. Which brings up the question of how does the first turn play out if it's not mapping who should go next in the first place? I don't understand this at all. I just want make a game. If anyone could nudge me in the right direction it would be greatly appreciated.

    .capx link

    https://mega.nz/#F!9ZNkiCbQ!UP76ob_Y_IW0gGPw3afFBQ

  • I've recently been using the local storage for saving and it works fine. I can save what weapon the player has and all the stats. But in the past week it has stopped working without me tampering with the events. Specifically, weapons now no longer load. All your other stats load fine. So I check my weapon events for loading and saving to see if I accidently tampered with it. I hadn't it was still exactly the same. So I deleted all my events for saving and loading and re-did them. Weapons are working again. But as I implement loading regular stats EVERYTHING has stopped loading? I've even made a test project that allowed me to randomize 3 stats, save and load them and it works perfectly. Can LocalStorage just not handle loading 35 variables at once or something?

    I'm not posting game capx

    Thanks.

    • Conra

    I've recently been using the local storage for saving and it works fine. I can save what weapon the player has and all the stats. But in the past week it has stopped working without me tampering with the events. Specifically, weapons now no longer load. All your other stats load fine. So I check my weapon events for loading and saving to see if I accidently tampered with it. I hadn't it was still exactly the same. So I deleted all my events for saving and loading and re-did them. Weapons are working again. But as I implement loading regular stats EVERYTHING has stopped working? I've even made a test project that allowed me to randomize 3 stats, save and load them and it works perfectly. Can LocalStorage just not handle loading 35 variables at once or something?

    Thanks.

    • Conra
ConraKojiro's avatar

ConraKojiro

Member since 20 May, 2015

None one is following ConraKojiro yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies