Vati-nyan's Recent Forum Activity

  • Is there any way to change or replace references to families during runtime?

    For example I have two families of sprites. During the whole of the code, it is set up so the player controls 1 of the families, with events like these:

    Click "Family1" -> stuff happens.

    But then I want to change it around so all these interactions can happen with "Family2" instead, depending on player choice while the game is running. Is there a somewhat easy way to do that, maybe by have it changing according to a global variable that says player is either "family1" or "family2"?

    So far it seems there is no way to either exchange family names, or even change the contents of a family, while the game is running. So is there some other workaround?

    So far all I can think of is making an identical set of code for each family, but that would be huge and complicated, not to speak of making sure they are always the same whenever I got to change something in one of them.

  • That is a wonderfully simple idea compared to what I was thinking and confusing myself with. I'll try just that! Thanks

  • Has anyone done a turnbased game where there are more than two players, and how do you keep track of it, going through the turns and handling their states?

    So far in my game everything works fine with just two players - human player and pc opponent, each kept check off with their units in two families called "Player" and "Enemy", with many of their stats taken care of in family variables. So the whole combat code works pretty much on "clicked Enemy family yes/no", "your turn yes/no", "Player gold/Enemy gold" etc. But there is planned to hopefully be a total of four "factions" in the game.

    Including more than one family of units and having the game switch between player 1-4 in turns, with the changes between who are now player/enemy/ally, seems to complicate things a bit. So before I throw myself into confused spaghetti code...

    Any tips from anyone who tried to do this, on how to approach it? All the examples I find are just with two very simple players. Maybe something with arrays?

  • I think I understand what you mean, I need to use the X/Y numbers of the actual tile to put it on? Instead pf pixel positions.

    I still don't entirely grasp how to do it in practice though, and how to make it move on to the next tile if the first one is occupied. Could you give a clearer example?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Those are the positions of the square that I either what the chess placed, or next to. It's like a base that produces these chess.

  • Hello! I return to bother you once more with questions!

    I have a square on the board, a so-called "settlement", that I want to be able to use to create more units in the game. When asked to add another unit/chess I want it to place it either on the square itself, or next to it, if the square is already occupied. So far I am able to place the chess on the square, but when it is occupied I get the error when a space already has a chess in place - I can't make it go on to place it on the next tile instead.

    Here is my code that I've experimented with so far, and which doesn't seem to work:

    Basically I want it to check if tile is empty? If so: place chess. If not: check if next tile in row is empty and place chess.

  • Any graphical program that can export transparent files (png).

    As for size, that's hard to say. Depending on the style/project it's generally better to make the art larger, then resize it to 16x16, 64x64 or whatever you need the final sprite to be.

  • Hello! I'm using some of these plugins as well, and when you figure your way around them they can be really useful.

    You should take a look at this thread, with a collection of his plugins that work really well together to do what you need: viewtopic.php?t=69647&start=0

    As well as his demonstrations here: https://onedrive.live.com/?cid=07497fd5 ... fA3BYVEKYk

    As for how far each chess can move and what types they are, it is also possible to use private variables for that. Just give each chess piece a different variable number for amount of moves it can make, and names for its type.

  • Hmm strange, since it seems to now pick all the objects of the same type in the family. Maybe I messed something up elsewhere, will have to make another pass through.

    Edit: Found what I did wrong... one little piece that I had forgotten to switch out. Thanks for the quick reply though, it always helps to be able to rule things out

  • I imagine that you would make an event on start of layout, select the sprite in question and "set angle". In that case the sprite should already be facing upwards when the bullet behaviour triggers and sends it flying.

  • Time for a more simple question (I hope).

    In my game I want to be able to select objects by clicking on them with the mouse. All these objects are part of a family that share some traits, but I'd like to get the UID of the particular object that was clicked.

    So far I have "On family clicked -> options appear." Like this:

    This code worked while the game was using just one object type instead of a family. But obviously not anymore, since it's just using the family UID instead...

    Any tips for what I need to add in there?

  • Programming

Vati-nyan's avatar

Vati-nyan

Member since 17 Nov, 2010

None one is following Vati-nyan yet!

Connect with Vati-nyan

Trophy Case

  • 14-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Email Verified

Progress

16/44
How to earn trophies