Tungstan's Forum Posts

  • Hi there,

    Thanks for the suggestion, will do :)

  • Hi there

    Thanks for the link, there are some really neat examples in there, I will take the time to study them.

    I have also sort of decided to put off working on "AI" for now, as it seems I need to learn more stuff in the meantime. I will concentrate on making the run&jump part of platforming and add more things incrementally, as I learn how to make them, like wall jumping, grappling hooks, effects, maybe some easy physics stuff. I'm a hands on kind of guy so the idea is that I can get comfortable with game logic, logic gates by following specific examples and then trying to tailor them to my needs/wishes. I am pretty set in making this little project, so not giving up so easily :P (plus I've just bought Spriter Pro as well, so I have to commit!)

    I will definitely ask for more help in the (near) future, so thanks for the offer! :)

  • Hey!

    The boolean "following" was made only so that I can disable the movement of the sprite when the attack was happening. I have not used a simple "platform disable" when "attack" animation is playing.

    I wanted to make it "convoluted" as I wanted to give myself options when setting conditions for different actions I was going to have the sprite do. I guess I'm not already there, I need to study logic gates more, as I don't think I've quite understood them.

    I am also learning pixel art in the meantime and also have a day job. I understand that this is going to take some time :)

    As a last request, would have any links to any construct 2/3 articles that deal specifically with game logic / AI setup ? I do not have a background in programming, so it's hard to wrap my head around some concepts or the way logic is used, etc. I have read the documentation provided, and followed a bunch of tutorials from start to finish, but the thing with these tutorials is that they all explain the same basic stuff, but none of the things are required to take this basic stuff a step further. For non-programmers like me is sort of a dead-end, because I cannot follow through when I don't know how I can follow through.

    For example there are loads of tutorials on how to make a sprite follow your character sprite. But I couldn't find any tutorials on how to handle what comes next, other than the rudimentary "overlapping object".

    Thanks again for all your insight!

  • Hey,

    Thanks for all the work you put into this! You didn't have to, I wasn't really bothered about it (again, all of this is just a test for now), unless you'll tell me that that was the reason for the animation fault! :)

    I was using the Line of Sight to detect the player first, but the thing I found out I was doing wrong was that I made it very complicated for the "AI" to attack by setting all these conditions, except the correct ones, so the "AI" was trying to do multiple things at the same time. Also, I think your way of detecting the range is way simpler and more efficient.

    A couple of points, however: your method is indeed simple and efficient, however, I don't see it being useful in the long run. At present, whenever the skeleton attacks, it just basically loops and also is still moving towards the player. By having a boolean called "following" I could control the movement states of the skeleton and stop it from moving when attacking. I also had the states created for the skeleton to deal with that. Do you have a better idea instead?

    My idea was to create a function (or a group) that would handle the attack routine by itself, and then call the function or enable the group when the skeleton is inside the melee range (your Reach variable works just as well). I was having the issue with the animation, because the conditions set for it to play were very confusing.

    Ultimately, I want the skeleton to be able to follow the player a certain range, to attack the player when inside a certain range, and when attacking, to be able to set other conditions as well (to deflect incoming attack, for example).

    Are there any tips or insights you may want to share as well? I have looked at tutorials, but for some reason, tutorials that cover melee combat are not that many, and usually are pretty basic.

    Thanks again for all the help so far!

  • Hi

    Thanks for the reply! first of all the art is not mine, I googled it, it;s free to use, just using it to test these things

    By all means, modify and correct away, I want to learn what I'm doing wrong.

    Cheers!

  • Hi guys,

    So I'm trying to ultimately create a melee system similar to prince of persia (the original). meaning that when an enemy is supposed to react to the player getting close to it (or the enemy getting close to the player) and then attack / deflect in according to some conditions I will set.

    I hit a very silly snag, however. I have an animation for attack that is supposed to play when the player is inside a certain range (I calculate the distance between player and the enemy). In the debug mode it's saying that all the triggers work perfectly, and also says the sprite has switched to the correct animation (attack), but the animations stops on frame 0 and I don't know why.

    I have attached the CAPX with the little test inside, if anyone is kind enough to have a look and tell me what am I missing?https://gofile.io/d/06xwz9. Here is a screenshot of the events as well. Note: the "skelletongStates" group only has the states defined for "idle", "left" and "right" in regards to the sprite moving. The image is here: gofile.io/d/YrmujO

    Thanks in advance for anybody willing to throw an idea around :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your solution worked like a charm, thanks very much! I have added the Pin behaviour to the health bar and added both monster and health bar in a container.

    I have tried to do the For Each loop, as I want to try to make a wave system for the monsters, so I thought this would work best when I spawn a number of different type of monsters in a wave.

    Your solution should work also because, as I understand this, I attach the health bar on creation of the sprite, so as long as they are in a container, doesn't matter how many I spawn, they will each have their own health bar.

    Thanks again!

  • Hi guys

    I'm trying to create health bars for enemies in this learning project, however, I'm encountering a problem.

    When the health bar reaches 0, the enemy should do its dying animation and get destroyed, however this is not happening, and I think I have narrowed the cause the the fact that somehow there are 3 health bars attached to the monster, instead of one. The issue is that I don't know why there are 3 health bars, I have attached a screenshot below for you guys to check, as I've wasted more than an hour myself trying to understand what is going on.

    On monster created, I have a sub event with a for each loop and a trigger once condition for creating the health bar above the monster sprite. As a separate event, I set the position of the health bar to the monster's position, and set its width as the HP variable from the monster. When the health bar reaches 0 (or below), it is destroyed.

    I have also set a state for the monster stops the platform behaviour, sets the "Explode" animation, upon its finish. the monster sprite is destroyed. This is then tied to a condition below where it is actioned when the monster HP is less or equal than 0 (as damage received can take the HP into the negative).

    As in the screenshot attached, I don't see where the other health bars are coming from. The all have the same position (I clicked on them in the debug page).

    https://i.imgur.com/myD1FsO.gif

    Can someone please explain what am I doing wrong here?

  • Thanks again :)

  • This is exactly what I needed! Thanks very much, I really appreciate it!

    I also want to make sure I understand this correctly:

    1. on click, variable cellX gets the value of Tilemap.PositionToTileX(Mouse.x) and celly respectively.

    so Tilemap.PositionToTileX(Mouse.X) = the coordinate of X of tile which is on the same X line as the mouse?

    2. I don't really understand the loop from cellY to celly +100 what it actually does (but indeed works!). can you please explain this part for me a bit, as well.

    I believe I understand the rest.

    Thank you very much again!

  • Hi guys

    I'm pretty new to Construct, (well, on and off, mostly off, but getting into Construct again recently) and just trying to get my head around a simple thing. I have looked for tutorials that tackle this, but so far have not found any solutions to my problem. It may something so trivial that no one had taken the time to explain, but I can't seem to make any progress on this.

    I have a placeholder at mouse.x, mouse.y. I want to click somewhere above the ground tilemap (game is platformer, side view) and I want to create another sprite where the mouse is, but on the ground, and destroy the placeholder. In other words, X to be still at mouse, but Y to be set wherever the ground tilemap is under the mouse cursor (hope this makes sense)

    Obviously x = Mouse.X, Y = Tilemap.Y has not produced the result I wanted, I have tried other things like Tilemap.X + (Mouse.X), (Tilemap.Y) + (Mouse.Y)

    Another version is to have "invisible" sprites spread out along the ground and then just spawn the turret at their coordinates, but this isn't something that I really want to do.

    Hope you guys understand what I am trying to achieve.

  • i know it's been a while but can this be used with a progress bar? (aka tiled background to show the progress of the cooldown)

  • Got you! I thought that events running after a function will be part of the function for some reason.. I'll look at the code again.

    Live and learn.

    Thanks again!

  • I know how to disable and activate Groups, but I thought doing it via functions would work just as well. I did not know that I can't use Every x seconds in a function, never came up in everything I read on functions so far...

    I also just realized that in the first function there is an "Every x seconds" event. Would that be why it triggers at start of layout in spite of the disabled action to call it?

    I'll have to get rid of all the functions for now until I learn them better. and work with groups instead, I guess.

    Btw, if you have any links to any tutorials / articles of what one CAN'T do within a function would be really appreciated, as this never was a topic in everything I've read so far, which lead me to believe that any piece of code within the function will work. Btw, if you haven't noticed already I don't have a background in programming so please have mercy on me

    Thanks again for the pointers!

  • I disabled all the functions except for a simple one. In the main even sheet, I also disabled the action of calling it, yet it still triggers.

    hopefully, this image can tell you more: ibb.co/eVnzSH