jwoods's Recent Forum Activity

  • Hi,

    I'm still messing about with the RTS template (in-case you've seen my other posts).

    I'm having trouble with my Friendlies when I set two or more to attack Enemies at the same time.

    Scenario: I select one Friendly and send it off to attack an Enemy. I then quickly clear selection, select a different friendly and send it off to attack the same or another (behaviour the same). Whichever one reaches an Enemy first will start attacking, the other will simply stop on it's path.

    From this point the first Friendly becomes 'dominant' and whenever it is given the same target as another Friendly the other friendly will not attack the enemy, even if it reaches the target first.

    capex

    Pulling my hair out here. can't seem to see what I've messed up.

    In debug I see the vars congaing the states seem fine, but event just don't fire.

    /Jamie

  • Thanks Katala, this worked great.

    /Jamie

  • Hi,

    I want to stop my sprite moving along a path when a specific distance from the end is reached (i.e. 300px from end point). Is this possible?

    /Jamie

  • Hello,

    I'm currently working from the "Template: Real Time Strategy (RTS)" template.

    I'm still trying to wrap my head around the event sheet block model.

    I want to implement the following sequence;

    1. User selects Friendly unit(s)

    2. User selects Enemy unit

    3. Friendly calculates path and moves along it

    4. Friendly stops at the expected end point

    5. Friendly begins to fire.

    Problem: I'm having trouble with item 5. I have a event to move the Friendly (this stops at the value set in the family varialbe "Range" as I want) However the combat event seems to get called to early and the Friendly doesn't attack when it reaches it's end point.

    I've tried moving the attack block as a sub-event to the move, but it still doesn't help.

    How would I have the Friendly move and then wait until it stops to begin attacking?

    capx

    Any help appreciated.

    /Jamie

  • Probably need to look at range in your turret behaviour. Set at 300 at the moment...

    Thanks again RamPackWobble.

    When I increase the range this resolves the issue, thank you. However, the Friendly start shooting while it's way too far from the Enemy who is out of actual range for damage.

    I think I might try to detect when I'm close to the enemy before I begin attacking.

    Thanks again for your help, this was really useful

  • Hello,

    I'm currently working from the "Template: Real Time Strategy (RTS)" template.

    I've modified the standard Event sheet to;

    * prevent Friendly and Enemy units from attacking each other (disabled both actions in event 2),

    * I've made it so that my (selected) Friendly units will only attack Enemy units I click on by using the "acquire target" action (see block 34 and 35 under Combat group).

    My problem: When I select an Enemy unit and my currently selected Friendly unit is more than around 250px from the Enemy, my Friendly just moves to the location but doesn't attack. If the Friendly is closer than 250px it will engage and attack.

    I can't find anything on the Event Sheet that would be causing this. Note: I'm a total newb.

    capx

    I've searched the FAQ's but nothing really helped me.

    Any help appreciated.

    /Jamie

  • Cheers Joskin and Guizmus.

  • hrm... I'm getting an error telling me;

    ---------------------------

    Unable to load project

    ---------------------------

    Could not open project because it is from a newer version of Construct 2. The project was saved in release 162 or newer. Your current release is 158.2. Try downloading the latest version of Construct 2 to open this project.

    ---------------------------

    OK   

    ---------------------------

    The version on the site is 158.2?

  • hrm... found a bug - even if my Friendly units aren't selected they will shoot at (not move) an enemy unit I click on.

    Behaviour should be only to engage an Enemy unit if the Friendly is selected.

    Investigating...

    EDIT

    Resolved this by adding another condition to my new event (described in original post) to make sure a Friendly is selected (using the already defined IsSelected var).

    EDIT 2

    Strike that, 1/2 resolved. If nothing is selected then there is no action. Sweet!

    When I have 1 Friendly unit selected and attack a close by Enemy unit, all friendly units attack but any unselected don't move.

    I think it's still my 'new' event, which is;

    On Left button Clicked on EnemyBases AND FriendlyBases is IsSelected

    {

    EnemyBases: Set IsTargeted to True

    FriendlyTurrets: Turret acquire target EnemyBases

    }

    Pretty sure "FriendlyTurrets: Turret acquire target EnemyBases" tells ALL FriendlyTurrets to acquire the Enemy... not just the selected instance.

    EDIT 3

    3/4 Resolved. I disabled the suspect action and added a sub-event to pick a specific instance of a FriendlyTurret based on the TurretUID stored as a var in the FriendlyBase.

    It worked!

    On Left button Clicked on EnemyBases AND FriendlyBases is IsSelected

    {

    EnemyBases: Set IsTargeted to True

    Pick instance with UID FriendlyBases.TurretUID

    {

        FriendlyTurrets: Turret acquire target EnemyBases

    }

    }

    Side-effect: if I select multiple FriendlyBase only the first selected will shoot... think I need to set a new var and throw an ELSE and/or FOR in somewhere

    Investigating...

  • Try Construct 3

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

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

    First time poster, first time Construct 2 users, basically a newb.

    I'm currently working with the "Template: Real Time Strategy (RTS)" template. It's excellent for learning from.

    I've modified the Event sheet to prevent Friendly and Enemy units from attacking each other (disabled both actions in event 2) and I've made it so that my (selected) Friendly units will only attack Enemy units I click on (inserted a new event under 16 that on mouse left click of an enemy a Friendly target will 'acquire' the enemy). This all works well, and being my first attempt I was surprised at how simple it was <img src="smileys/smiley1.gif" border="0" align="middle" />

    My problem: I want the Enemy I'm attacking to engage the first Friendly it received fire from - returning fire.

    I've tried a number of things but I just can't get my head around how to get the enemy to acquire the specific Friendly object that shot it first.

    I've read a number of FAQ's on Picking/selecting instances, nothing really helped me.

    Any help appreciated.

    /Jamie

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