dop2000's Recent Forum Activity

  • So let's say "Spearman" and "Archer" are sprites, combined into a family "Unit". On this family you have an instance variable "team". You need to also create a copy of the family, let's call it "UnitAttacker".

    Then you can do something like this:

    variable currentTeam=1
    
    Every 1 second
    Unit team=currentTeam
    For each Unit
    	-> Function call "FindTarget" (Unit.UID)
    
    
    On Function "FindTarget"
     UnitAttacker pick by unique ID Function.param(0)
    	Unit team not equal currentTeam
    	UnitAttacker has Line of Sight to Unit
    	Unit pick nearest to UnitAttacker.x, UnitAttacker.y
    	 -> Function call "Attack" (parameters: UnitAttacker.UID, Unit.UID)
    
    

    In the "Attack" function you can pick both the attacker and the opponent instances by their UIDs.

    .

    So you can use two families to pick two separate units in the same event. However, only one family can have "team" instance variable, that's why I'm using "FindTarget" function here - to pick a member of UnitAttacker by UID.

  • I have nothing to add to this :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No problem! But just to clarify - combining objects into a container will not automatically fix those issues. You will still need to review and change some events.

  • Add the purple box and the mob sprite to the same container. Read about containers here:

    construct.net/en/make-games/manuals/construct-3/project-primitives/objects/containers

    Also, you can't use "Move along path" immediately after "Find path". Finding path takes time, it may not happen in the same tick. You need to wait for "On path found" event to trigger.

  • You can deactivate groups, or toggle active status, all depends on what you are using them for.

  • Player Set angle to anglelerp(self.angle, angle(self.x, self.y, target.x, target.y), dt*2)

  • Oh, so you want to send for example, "Object15, Object57, Object58, Object60...", and you want to increase counters for these objects in the table?

    I don't know how to lookup data in the table, but if all these 200 objects are in rows 1 through 200, you can send row numbers as url parameters:

    https://script.google.com/macros/s/...../exec?obj1=15&obj2=57&obj3=58&obj4=60...
    

    In the script you loop through 10 parameters, extract row numbers and increment the counters:

    var nextRow = 0;
     
    for (var i = 1; i <= 10; i++) {
     nextRow = Number(e.parameter["obj"+i]);
     sheet.getRange(nextRow, 2).setValue(Number(sheet.getSheetValues(nextRow, 2, 1, 1))+1);
    }
    
    
    
  • I think you should change it like this:

    sheet.getRange(nextRow, 1).setValue(e.parameter["number1"]+1);
    sheet.getRange(nextRow, 2).setValue(e.parameter["number2"]+1);
    sheet.getRange(nextRow, 3).setValue(e.parameter["number3"]+1);
    sheet.getRange(nextRow, 4).setValue(e.parameter["number4"]+1);
    and so on
    

    If this doesn't work, remove all "+1", and add 1 to variables in Construct event before sending the data.

  • With Local Storage each key is loaded in a separate thread, so you need to wait for both keys to load before you can compare them. So you can do something like this:

    It's easier to store multiple values in a single dictionary. See this demo:

    dropbox.com/s/1cz1k5x3teikbv5/DictionaryLocalStorage.capx

  • Here is an example:

  • The easiest way to do this is with MoveTo behavior:

    construct.net/en/forum/extending-construct-2/addons-29/behavior-moveto-40701

  • The best way to deal with this is to add Player and PlayerMask into a container. And same with the Enemy and EnemyMask.

    This way when you create an EnemyMask instance, its own Enemy instance will be created automatically. And they will be logically linked. So, for example, if you pick Enemy in an event, its EnemyMask will be picked as well. Read about containers, they can really help here.

    Also, it's not recommended mixing Physics with Platform or any other non-physics behavior. And I don't know much about Spriter, but I'm guessing it's not very compatible with physics either.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 279 followers

Connect with dop2000

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies