work3's Forum Posts

  • dop2000

    Thanks for your help as always.. (check yr paypal!)

    Is this how you pictured it?

    https://imgur.com/a/KI2mlCV

    As I am not 100% sure if thats what you meant, currently it's not working as well any more.

    It is no longer checking for new enemies entering the screen when Ctrl_Lock=1

    it's also displaying enemies that have strength<25 as the wrong colour now.

    the original version constantly checked for new enemies, and changes in their strength, so if they were shot

    a few times when locked, the target would update reflecting their current strength.

    I PM'd you a private youtube video of how it was (almost) working if that helps. I'm at a point now where the amount of graphics and content is making the file a bit unsharable.

    in your suggestion for event 914, it has Ctrl_Lock=1 check, when mine had Ctrl_Lock=0, I guess that was an error?

    my apologies if I got something wrong in the edited code shot. I'm a designer / artist and my logic skills are a bit weak on the programming side. (can't be a master of everything!)

    And thanks again.

  • Hello all.

    (code screenshot attached at bottom)

    I have 4 lines of code, each contains a FOR EACH regarding the same family - can it be made more efficient /faster, or would it be OK as is? There is also an odd bug or something in there too.

    What it does, is it creates a target on each enemy on screen, when a button is held down, and kills all the targets when the button is released.

    If the object in the family has a low strength variable less than 25, it changes the colour by changing the animation frame of the target.

    The problem is, and what makes the bug odd, it works about 95% of the time.

    Some of the family objects do not get a target set to them at all, although some of the very SAME objects in the family are not ignored. And sometimes the colour setting is wrong.

    If I release the button which turns the CTRL_LOCK global to 0 and then hold the button down again which returns CTRL_LOCK global back to 1, the ignored family members are triggered correctly.

    This also off / on procedure also fixes the family members that have an incorrect target animation frame.

    To summarise my questions.

    1. Are these 4 lines of code efficient in their structure? is there a way of using less FOR EACH loops?

    2. Why would some family members get ignored or wrongly set by this code?

    image of code snippet

    https://imgur.com/a/YIrXQ

    Humble thanks as always.

  • I've seen some great tutorials how to create convincing snake effects using pin, but are there any examples of anything similar whereby the end of the tail is permanently fixed? like an tail or a tentacle?

    Thanks as always!

  • dop2000 And Boom! smooth as silk! Thankyou!

    (removing CAPX)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hopefully someone can kindly assist with this strangely inconsistent issue I have.

    I'm testing some code whereby I move some objects along a path using MOVETO to travel between image points.

    The background itself moves (currently testing using a sine movement for simplicity), not a camera, due numerous design limitations, but that's just a basic description so you know what I am doing.

    The issue lies in this very simple function, or at least I think it is..

    SetX to TiledBackground.X+tankpointer1.X-tankpointer1.startx

    SetY to TiledBackground.Y+tankpointer1.Y-tankpointer1.starty

    some of the objects look fine and stay positioned in a satisfactory manner to the moving tiled background, however some dont' and wobble more than others.

    I thought it may be the position of an image point, or the position of the tiled background being set to a half pixel, but it isnt.

    The really odd thing is that it's the always the 2nd triggered tank object that wobbles more than the others.. or at least it does on this computer..

  • dop2000 Thanks (yet again)- I will try that ASAP..

  • Hi all.

    I'm hoping someone can give me some clarification of what I am doing wrong or, not implementing to get my 3 objects that are in a container, behaving correctly.

    Within the container I have.

    1. The root object.This object moves the other 2 objects around via an "Every tick, set to position". That works just fine.

    2. An "Aiming object". This behaves like a turret, and rotates towards a single target.

    3. The actual sprite, this is a 40 frame animation, kind of like an RTS Sprite rounded to 9 decree increments, based on the angle of the "Aiming object" (number 2)

    Here's 2 issues I have been having, and I hope someone will be kind enough to give me some solutions and explanations, just so I don't repeat similar mistakes or misunderstandings.

    Q1 : The rotations of the aiming object were flickering intermittently to various angles, and the Z order of these objects was also behaving strangely, until I added a "for each root object" within the function that rotated them.

    I was under the assumption that each spawned container group could not interfere with another? What was causing this?

    Q2 : When these object reach a specific Y coordinate, I wanted them to fire a bullet based on the rounded angle of the Aiming object, however, if I use a "Trigger once while true" , it only affects the first container group, and none of the subsequent container groups fire anything. Can anyone explain why the "once while true" function only affects the 1st object spawned??

    Thanks, as always.

  • Hi all, Hope someone can help me out with my question..

    My game has a LOT of objects flying about - I want to make sure all the bullets are above everything else, then the player, then collectibles, then enemies etc...

    whats the best way of keeping all newly created objects organized in their respective order?? I worry if a set of sorting events set to "every tick" be heavier on CPU or GPU - what's the smartest / lightest way of keeping things in order?

    Thanks, as always!

  • Thankyou so much, you just saved me a long evening of correctly placing 80+ image points!

  • dop2000

    Thanks for your response!

    By rounded angle, I mean using the ROUND function to round the angle to the nearest 9 degree increment..

    That's a nice simple method but I have 40 frames in isometric - I guess if I can't get any more suggestions I will go with that, but it's a lot of work compared to code..

  • Hello.

    I have bullets being fired from a cannon, the cannon is a pre-drawn isometric sprite and its 40 animation frames are at 9 degree increments, the angle is set from a seperate rotating "pointer" sprite as such :

    set cannon animation frame to round(Pointer.Angle /9)

    I want to fire a bullet at the same 9 degree increment to match the cannon frame angle.

    setting the bullet angle to

    Pointer.Angle

    works OK, but the angle obviously isnt rounded.

    setting the bullet angle to

    round(Pointer.Angle /9)

    doesn't work..

    Can anyone tell me where I am going wrong?

    Thanks in advance..

  • Thanks, I assumed this would be the case..

  • Hi all, I hope someone is able / willing to help me out here..

    I have a spaceship object, it needs to have 2 cannons mounted on it , both of the same appearance. The cannon has a large animation frame count.

    The 2 cannons need to animate independently.

    If I put the spaceship and a single cannon in a container, is there any way to create a second instance of the same cannon, without creating a second object with the same frames?

  • Nexis717 I mean, that I want to maintain a scaled size, say 100% wide, 50% high while the object rotates, so it retains an oval shape at one angle constantly - there are effects that do it but each has weird glitches that prevent my use...

  • Hello, I hope someone can help out with my question.

    I want to scale a circular object so it looks like its rotating in perspective (like a record on a turntable) - Rotoscale has tiling, so as the object rotates, you can see tiled parts in the corners, and the scale plugin does not work with rotated layers - are there any more out there? or is this possible in code?

    Thanks as always!