jwoods's Recent Forum Activity

  • Hello,

    I've added individual health bars to my units on the RTS template. This is working great, however when I spawn a new unit the health bar is't positioned correctly.

    Can someone suggest an approach to do this correctly, currently I am just;

    Spawn FriendlyBase on layer 0 (image point 0)

  • This looks really cool!

    I had some trouble scrolling up with my mouse (Chrome 33 on Win8.1) - but was able to use keyboard.

    Is there a tutorial on building isometric RTS? I'm currently playing with the RTS template which is top down.

    What did you use to create your building and character sprites?

    Anyway - this is super cool, keep it up

  • Thanks again Katala.

    I wasn't aware of the line of sight behaviour. Enabled it for my turret family and set the range. One simple event and I have the exact behaviour I was looking for, thanks.

  • Katala, thanks for the reply. Is line of sight a built in function? Is this a Turret characteristic?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello again,

    I need to calculate the line-of-sight distance between two objects (I think).

    Background

    I'm currently hacking up the RTS template to learn more about events with C2.

    I currently have Enemy tanks only returning fire once fired upon by a friendly tank. I now want to add some extra Enemy AI which will allow an Enemy tank to detect any Friendly within it's shooting range, who is also shooting, and then engage.

    See image below;

    In this example there are two Enemy (red) tanks within range (for simplicity I've highlighted the range of the Friendly tank - but in reality this is Enemy centric). What I want to accomplish is these two tanks detecting that the Friendly in their range is shooting, and to begin engaging it.

    My thought for achieving this is;

    For each enemy unit that isn't firing

    • find closest friendly unit
    • Calc distance to unit (line-of-sight)
    • if distance <= range AND friendly is firing then ATTACK!!

    This only gets me the one closest Friendly to the enemy - there could be more friendly in range attacking, but since i can only attack one at a time, this is good enough.

    Problem

    How do I get that distance figure, and how do I ensure it is line-of-sight and not including a random path route distance?

    Any thought appreciated.

  • thanks for the explanation blackhornet

  • I've created a button which is pinned to a sprite (to create a context menu).

    In the layout I make the button width 165 and the grey sprite is 175 in width;

    however when I run the game up the button is now wider than the sprite;

    Any ideas on what I've done wrong?

  • Are you sure your health bars are also in the same container with your tank bases and turrets? (Just putting health bars in a separate container will not work, the container must have tank base, tank turret, and two health bars)

    That's a really good point, so I add my health bar components to the same group as the turret and base;

    It's working now - but It appears that the assignment of a health bar is pretty random.

    Do I need to delete and recreate each tank to bring the UID's closer together?

    UPDATE

    Deleting all the tanks and recreating them from (copy in memory) has done the trick, thanks for your help Windwalker.

  • Hello again C2 community.

    Every time I think I'm getting the hag of the event system I try something out and POW, back to square one.

    I'm using the RTS template, and am currently trying to create health bars for my individual units.

    I'm trying to follow the same method used in the template to tie health bars to bases as is used to tie tank turrets to bases;

    So I create my health bar from 2 sprites, put it in a container and use the same technique (initially with just one health bar), and it works great;

    However all health bars seem to just stick to the one tank base. I don't understand why the technique works fine for tank and turret but not for me new health bar.

    Sorry, I can't include urls (to capx) due to my low cred. But I hope the images will show.

  • Thanks Zetar, I wasn't really expecting it to work like that so I hadn't looked in objects.

    Thanks blackhornet, yes as Zetar points out it is standard now.

  • jwoods can only post plain text URLS when they have 300 rep. 1 URLS removed. Why?

    Hi,

    I've read in the manual it's possible to add functions to reduce the repetition of actions within events.

    I'm probably going to feel pretty stupid when someone tells em the answer, as I'm sure it's simple, but I can't for the life of me figure out how to add them. In the event viewer I assume they are a type of event, Can't find them under System or anywhere else when adding an event?

    Any help appreciated.

  • Thanks again Guizmus. This makes complete sense, thanks for taking time to help and explain the fix.

jwoods's avatar

jwoods

Member since 18 Feb, 2014

None one is following jwoods yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies