Jimzip's Forum Posts

  • Aw! You guys are amazing, thank you.

    blackhornet do you know why the time condition would have had that effect on everything? It seems to have made the timing of everything very erratic, I wouldn't have expected that.

    In any case, all fixed, I'm so glad it was that simple!

    Oh and dsminor, cheers, much appreciated! Here you go:

    X)

    Jimzip

  • For anyone who wants to take a crack at this, I knuckled down and made a .capx:

    https://www.dropbox.com/s/3gaqlp8ky5ycr ... .capx?dl=0

    Note that in the TEST_REGION layout, all of the enemies actually do start patrolling, but one after the other, and in a weird, delayed manner - while in the cavern level they do not. (There should only be a 1 second delay at each point). There's nothing special about the cavern, as you can check. Honestly, I'm about to give up!

    As I've stripped away almost the entire project (leaving one level so you can see it in context), and the problem remains - I honestly think this is a construct bug - and at this point I'd love to hear that my code is the problem!! Please take a look if you can (and sorry for all the junk in the capx, I just didn't have time today to strip it all totally clean).

    Jimzip <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

  • Hey dsminor thanks for the reply! Much appreciated. I've been hacking away at this since your post & still haven't found a solution (but I did remove the 'trigger once' you mentioned!).

    Collisions are indeed activated. What's more curious is that every few runs, the 4th enemy actually moves! He walks to the first point and stops there! It happens seemingly at random, I didn't change anything.

    A couple of interesting points:

    1) if I disable the 'for each enemies' at the start of the patrolling behaviour, they all move! (The problem here being that they all copy the first instance's movement). SO I've ruled out something being wrong with instances themselves.

    2) if I change 'For each enemy' to "for each enemy, pick by IID ascending" then the last 3 work, and the 1st stops working! It's bizarre.

    Again, any suggestions, help or thoughts on this would be much appreciated. I see no reason why the 4th shouldn't work. I've checked to see if there is interdependence or if something is interfering and so far I've come up with nada.

    Jimzip

  • Hi all!

    I'll keep this brief. I have a level in which enemy NPC units wander on a set course. They wander between pre-defined and positioned position-sprites.

    Everything is running just fine and dandy ... until I add more than 3 enemies. Then the 4th, 5th, 6th etc. simply get ignored by the Enemy wander script. I cannot get my head around this.

    Here is the code:

    And the map (the red points are the position markers):

    And finally, the Enemy properties:

    It's driving me a little nuts. 3 or less and everything's peachy, but subsequent enemies are ignored...

    From the debug view I can see that these extra enemies' bullet behaviour just stays on 'False' the whole time. If I force it on (with a key-press or whatnot) then they activate, but then they just walk off the screen, ignoring all collisions. Very annoying!

    Any help would be much appreciated!! I can try and bust out a custom .capx if necessary but it'll take a while so I'd rather avoid it!

    Jimzip

  • Hey all, thank you so much for the help & sorry I didn't reply (was away the last couple of days).

    Littlestain, I thought that as well, but no matter how I did it the problem remained the same X/ . I had the objects I was referencing pinned to one another in any case, so they moved together. Thank you for taking the time though. Much appreciated.

    Magistross, you hit it! This works like a charm. I had the logic in my head but I couldn't figure out how to do it. This works very nicely. For a visual, I've attached the final block:

    Thanks a heap peeps! This gave me many nights of annoyance! Rock on!

    Jimzip

  • Hey RamPackWobble,

    thanks kindly for making the examples! Unfortunately your solution won't work for this problem, as then the layer objects themselves are being shifted to the front/back of the layer. Rather, the player should be moving in between them.

    To see why your approach would be problematic, here's an example of a level:

    As you can see, there are a lot of overlapping objects, and having them shift up and down causes them to 'pop' behind and in front of each other (I tried this approach early on). So, the challenge is to get the player to move around them, and to have the layer objects stay in order in z-space. Sorry for not clarifying this in the original post (thought I had everything this time)!

    In any case, I assumed (as you did) that I could simply select all the objects in a range, and then move the player in front/behind them, but when there's two objects in the collision zone, there's some issue I just can't seem to resolve whereby construct picks the most recently 'hit' object and disregards the first, rather than applying the conditions to both (edit: it seems to happen if the original object is lower than the new one. If it's above, then things seem to work).

    Anyone else like to take a stab at this? It's trickier than it looks!

    If there was a way to directly edit the z-index of objects (rather than just 'move to top/bottom/another object') it would be very helpful, but I can't seem to find a way to do that.

    Many thanks in advance.

    Jimzip

  • Nobody? Is there something simple I'm missing about this? Any answer here would be really appreciated!

    Jimzip

  • Hi lovely people! I'll do my best to describe the problem here. The problem seems simple but I've attached a GIF for better understanding anyway.

    Problem:

    I have a character sprite, and a family of objects called Layer_Objects. What I'm trying to do is give some depth to the game, by having the character move behind or in front of these objects. So, on collision with Layer objects, I find the Y index of the player, and the layer object collided with, and move the player in front or behind the layer object depending on if the player's y-index is higher or lower than that of the collided object. Following me?

    The function itself actually works, all seems fine and dandy - until two objects are collided with. As you can see in the GIF, one object is no problem, but the second layer object will always override the first, and puts both objects in front or behind of the player. I've been trying to fix this for literally days and am now having Z-Index nightmares. Please help!

    Here's how it looks in action, you can see the problem at the end of the GIF when he collides with the chairs:

    Here's the code I've used thus far (which seems to work the best - ignore the shadow condition):

    I also tried a for loop, but this gave the same results:

    Something to note: on the start of the layout I sort all the Z-Indexes of the Layer_Objects by their Y-index (so the higher they are on the layout, the further back in space they are). That's all kosher. No problems there. It just seems to be this multiple object selection that's the problem.

    I've toyed with the idea of creating an array which stores all the Y-values of all the Layer_Objects, and simply checks the player's Y constantly to determine if he's 'above' or 'below' an object, but this seems like CPU overkill for a simple effect, and what I suspect might be a simple solution.

    Any help would be much appreciated! Thank you in advance.

    Jimzip

  • Thank you guys! StormHo you're right, and lannaert using your method it now works. I still have much to learn about arrays. I just set the depth to 1 and it functions. Now to figure out that duplicate entry...

    Jimzip

  • So I tried the above solution, but I still get nothing in the array.

    There must be another problem, because the logic here seems fine. I just can't figure out what that problem is! Driving me crazy, I'm sure it's something simple.

    Here's the current way I'm doing it. Like you suggested, first I'm pushing the info into the array.

    Then I find it and change the text to the quest description (which should be at 0,1).

    But ... there's nothing in the array.

    Any ideas?? It's ridiculous. The global test variables I made get the data just fine. The array just doesn't want to play along though.

    The weird thing is, it registers *something*. The space is created, but I get the 3 commas ',,,' instead of the data.

    Jimzip

  • Thanks a heap for the explanation lennaert! I'll try this out.

    Jimzip

  • Hey all.

    I'm sure I'm not going about this the right way, and it's doing my head in,. Thus I'm turning to you, my clever fellow constructers!

    Here's the situation: I'm building a quest system for the game I'm working on. I'd like objects to hold the quest info in their instance variables. On pickup, I want to transfer that data into an array.

    Here's how the object part looks:

    Here's where things are going pear-shaped.

    No matter how I change the method, I can't get this info into the array. I can store it in other variables, but the array part is just not working. Any help? Here's the 'pulling' part:

    The disabled ones are other versions of the same thing I tried ... no dice.

    Finally, here's the loop which sets the text when the quest ui is open:

    It's mainly the middle part. If I could just get the info into the array I'd be good, but for some reason it's just not working. Hjalp?

    Ideally I'd like the array to store all the info in rows. Eg: X0=Quest Number, Y0=Quest Name, and then access that later. (Please don't point me to the manual btw, I've read it until my head hurts)! X)

    Thank you kindly.

    Jimzip

  • Oook ok I feel really stupid now. I didn't realise that objects in a family inherited unique versions of the family variables. That was what I failed to understand (even though you consistently tried to tell me)! Thanks for your patience! I am going to bed now... X)

    I must have read that paragraph in the manual 10 times, and somehow still didn't get it.

  • Ah! That's clever (the frames solution), I never would have thought of that. Thanks a bunch! I'll rejig things and let you know how it goes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey Blackhornet. Yeah but that's the thing ... X) I can pick the collision object by UID fine, but it still doesn't work. I think I've been explaining this wrong, so let me use the magic of my super mad illustration skillz!

    Here's what I'm after, and what I currently have:

    [attachment=0:10lm8r2w][/attachment:10lm8r2w]

    Now this is the thing: Each object's 'Dialogue1, Dialogue2' etc contain different strings. (Otherwise this would be pointless X) . I named the variables the same in each object so that the function could access the picked object's Dialogue1 no matter if it were Object1, Object2 etc. That's the actual goal here.

    And the code:

    [attachment=1:10lm8r2w][/attachment:10lm8r2w]

    So as you can see, when I try to pick the object's variable 'Dialogue1' it complains that it's erroneous. I saw an 'out of scope' message at one point ... this means it's picking the object, but can't see that the object has variables, right?

    hehe yeah I know. But the aim of this is to get a variable from an object within a family without having to hardcode 'tell object1 to send it's variable to xxx'. The challenge is to pick Dialogue1 from no matter which object I collide with. Thanks though.

    If you've already understood and posted the answer, and I somehow just didn't get it, let me know. But I tried what you suggested and still nada. Thanks again! (And sorry for bringing you back here again!)