nimos100's Forum Posts

  • If these are the only events that have something to do with path finding in your game, I think the problem might be with the "Chewie is not moving along path" as you stop it, this will trigger true, and it will find a path to a new point and then start moving again. So you need to add a variable to Chewie that also have to be true for it to start looking for a new path.

  • That's really good news, Thumbs up for all your hard work, very appreciated <img src="smileys/smiley20.gif" border="0" align="middle" />

  • As far as I know its not possible. In my experience when using the path finding behavior, you really have to take it into account when designing your game. Its current state is unfortunately very weak, and any concept that requires to much use of this behavior, can vey easily ruin the whole idea, simply because you get these "time stops" every time you have to update the obstacle map.

    Think your best solution is to make one yourself, which is probably not easy, or hope that they improve this behavior. Or simply redesign the concept of your project so you don't have to update the obstacles more than once, reduce number of enemies etc.

  • Its rather easy to do. And can be done several ways, so ill just comment on one of them here.

    If you make an event that triggers every X nr of ticks/Seconds depending on what you like.

    And in there you add.

    Object.X = random(WindowWidth)

    Object.Y = random(WindowHeight)

    Since you want it to jump faster and faster, you can add a global variable called "Speed = 15" which will simulate seconds in this example.

    In the event "Every X seconds" you set the value to this variable:

    Every <Speed> seconds

    ...make object jump

    Then in the end of this you just reduce "Speed" with whatever value you feel like.

    So the complete code would look something like this:

    Global Speed = 15

    Event:

    Every <Speed> seconds

    Object.X = random(WindowWidth)

    Object.Y = random(WindowHeight)

    Set Speed to Speed - 1 (Will reduce it by 1 second every time it jumps.)

  • Just want to start by saying im not here to offer to debug your code :D

    But what you could do, as I find very useful, when I run into stuff like you have here, and uncertain what is going on, is to make a list. That visually keep track of everything about the object causing problem.

    In my current project for instant I have objects with 76 variables, that are manually added, so something is bound to go wrong at some point. But having a list to where I can add those variables and keep track of those, that might cause problem is a really big help.

    In your case you could make it so it constantly keep track of the enemy.UID, Target.UID, etc.

    If you know that each enemy should keep track of its target. Then at some point. It might loose target and the target.UID might show something strange.

    Another way is to simply add a text object and simply set it to "Check" when the "code reader" gets to it. And then you just move it around to the places where you suspect things might go wrong.

    Anyway good luck finding the problem :D

  • You just have to reassign them again for the new layout.

    So if you have an object called "Plane" that is global and on layer "Game" on one layout

    Then when you load a new layout, you just add:

    Plane move to layer "Game"

    Was that what you meant?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Regarding containers you should read the manual about them, as its explained well there I think.

    scirra.com/manual/150/containers

    Regarding the Z-order then its only on the same layer. So I don't think it would do you any good, in what you are trying to do, as I understand it. As the blend effects are assigned to the layers.

    However you can add blend effects to objects as well. By simply selecting the object it self and do it there. But if you have a lot of objects, it will hurt performance quite a lot, but if you only have the one car, it shouldnt be a problem. If you do it like this you might be able to make your own GUI to control the effects, by simply manipulating the Z-order of each individual object.

    PS. Yeah the time out on the forum is really annoying, always do a copy/paste my self :)

  • You need to pin the objects together during runtime. You can either do this during the "Start of layout event".

    Pin object -> (The object it should be pinned to)

    Or if the object is something you create during the game, you can pin it after you have created it. Then you just add the "pin code" there instead.

    You should just choose which object you want to be the controller and pin the other objects to that. In your case I would assume its the object with the 8 direction behavior.

    Also if you want several objects to work as one while being on top of each other. They don't necessarily need to be on different layers. You can just change the Z-order. So if you have a tank, you just apply, a "Move to top of layer" for the turret. Otherwise you might end up with a lot of layers for no reason. Which will most likely make it very hard to keep track of things after a while.

    The way I use layers are like this:

    1. Hud

    (Keep all UI and HUD objects) parallax set to 0, so it always stay on the screen, even if you scroll.

    2. Marker

    If the game requires the player to be able to build something, this layer will hold any markers that the player can use to mark things.

    3. Effects

    Could be smoke, fire etc.

    4. Game top

    (You could use this if your game requires units to move on different heights, for instant planes, clouds or roofs if you wanted a game where the player can see through houses if they move the mouse over them)

    5. Game

    Hold the units that move around. And is considered ground level.

    6. Game bottom / Shadows

    If I want to use shadows I can put them here.

    7. Map / background

    Will hold the map or background of the game.

  • There are blend modes in C2, if you select a layer to the right, then there will be an Effect tab in the "properties" window to the left. However I don't think C2 can mimic what the Adobe and Autodesk tools can, as its purpose is not the same.

    Layouts in C2 should be seen more as an area of where you want to work.

    Like looking down on a skyscraper, some work on first floor and some 2nd floor etc.

    A stool placed on 2nd floor will stay on that floor unless you say it should be moved to the 1st floor. The floor on the 2nd floor blocks what is on the 1st floor.

    So in your case if you would want to drag a layout from one to another, what you actually do, is you say that all stuff on 2nd floor should be moved to 1st floor, but this you do manually in design mode, or during "running" the program and add code that do it for you. But I doubt that is what you are looking for.

    You can build your sprite object in design mode, and drag that around. However if you want these to move together when you run the program, you have to put them in a container or pin them together etc.

    You can dynamically scale sprites, but adding a value to there width and height settings.

  • I think you should use the angle of the object instead. So I would imagine that right before you change it to 8 direction behavior you can just save the angle of the player character and just do what you did already with that angle.

    Player: Set Angle -> Angle_as_Bullet

  • You can just add a pick nearest to the part that does the "hit check" and just "pick the nearest enemy to the arrow"

  • Maybe I misunderstood you, but then you can just ignore my post :D

    But if I understood you correct, you have several slots which each have a name of an animal attached.

    Some pictures of animals then needs to be match to the correct slot?

    If that's the case, I think the easiest would simply be to "hard code" the solution in C2, for the 3 objects.

    1. Textbox with the name of the animal

    2. Slot where the picture of the animal should be placed.

    3. Animal picture.

    For each of these objects you add a variable called "Animal_name" and you simply use this to make sure that they match.

    A way to do this could be like this:

    1. When the game starts you set the variable "Animal_name" for the textbox to a random animal name.

    2. Copy this animal_name to slot where the picture of the animal should be placed. So now both the textbox and the slot have the same "Animal_name"

    3. Since you already know what animal each picture shows, you can add the correct animal name to the picture in C2.

    4. When the player drag a picture of an animal over a slot. You just compare that the "Animal_name" is the same for the slot and the picture dragged.

    Anyway hope that answers you question :)

  • I just tested what you are actually trying to do as far as i can understand. And had the same problem as you had, unfortunately I weren't able to fix it either, as it seems to be hardcoded into how the pathfinding behavior works, so it seems to want to smooth the movement.

    In general the behavior need a bit of updating in my opinion, it seem to be in a state of "just" being useful, with all the feature that would make it very useful not being there, but hopefully they will update it soon.

    However depending on how you want to use it in your game, you might be able to use some of it.

    In the testing I did, I wanted a "unit" to move around like you would see it in a game like Dwarf fortress, so its not based on "over time" movement. but 32 pixel at the time. If that is what you are looking for. You can use the path finding to find the path for you, and manually move the unit yourself, using very simple "If statements".

    In my test i used a tilemap, which give you a grid from 0 - X, 0 - Y and you can transform a sprites(X,Y) to these tiles. So what you can do is to transform the nodes from the pathfinding into these tiles coordinates, and use these to know where to move the sprite.

    So if the pathfinding find 2 nodes to reach the destination, which converted to the tile coordinates are:

    (0,5) and (5,3)

    And your sprite is at 0,0 (tile coordinate)

    You can simply check if the sprite X value is the same as the first node X value, if that's the case you check the Y value, since the node Y value in this case is 5. You can add 1 to the sprites Y value, so now its at (0,1) and you just keep doing that until the sprites position is the same to where you want it to go.

    I guess you could add animation to it, if you wanted but i haven't tried that.

  • "@nimos100, and others, how many parameters do you typically use in your functions?"

    It varies a bit but normally not more than around 5-9, but are working on a game that are quite complex. And the items in it can have quite a few settings and different ones depending on which item it is. And therefore i original decided to just add all settings into a single item object. However due to the functions not being able to handle them all, i had to redesign the way it worked. This is not a huge problem, but was just the way i found out about the bug. So even though its not that big a deal, i thought i would just make them aware, so they could fix it if they feel like it.

    The renaming part of parameters i suggested because when you check parameters you might have several "Function.parametre(0,1,2,3,4,5,6) = 1 or 24 or whatever) But these doesnt tell exactly what ir is. And it would just be handy if it instead was "Function.Is_weapon(0) = 1" and so on. I do use globals in some cases especially if i use text for testing, as its easier to avoid mistypes that way. But having a lot of global variables can also be a bit annoying as the list when you need to use one can be quite long.

  • You should most likely post this in the How to section, then you have a better chance of getting help i think :)