dop2000's Forum Posts

  • I may be wrong, but I think you can simply configure "Privacy Policy" and "Location to show user consent dialog" settings on the Mobile ADs plugin, and that's it. The dialog will be automatically shown to users from the EU, and if they don't give their consent, they will be served non-personalized ads.

  • Ok, forget about ternary operator. With the goalkeeper, 3-4-3 formation:

    For "n"=0 to 10
    
     If loopindex=0 : Array set "GK" at X=loopindex, Y=..
    
     Else If loopindex<4 : Array set "DF" at X=loopindex, Y=..
    
     Else If loopindex<8 : Array set "MD" at X=loopindex, Y=..
    
     Else : Array set "AT" at X=loopindex, Y=..
    
    
  • You are probably overwriting the name, check your code.

    3-4-3 is first 3 players are "DF", next 4 players are "MD", and next 3 players are "AT", right?

    So if you are looping from index 0 to 9, loopindex<3 are "DF". You can use a short version of if-then-else for this, it's called ternary operator:

    loopindex<3 ? "DF" : "something else"

    And then nest another ternary operator inside:

    (loopindex<3 ? "DF" : (loopindex<7 ? "MD" : "AT"))

  • Just change the expression. For 3-4-3 it will be (loopindex<3?"DF":loopindex<7?"MD":"AT")

    Or you can do it the long way with several sub-events:

    If loopindex<3 : Array set... "DF"
    Else If loopindex<7 : Array set... "MD"
    Else : Array set... "MD"
    
  • Check out the "Blend modes" template in C3. You can put the color wheel and the mask sprite on a separate layer, set "Force own texture=yes" and they will not affect other layers.

  • Ok, I tried it. But it doesn't sort the array of players, it simply assigns different positions to the first 11 players. So player #4 for example, can be DF in formation 5-3-2. But the same player #4 will become MD in formation 3-4-3. The remaining 7 players are not used at all.

    If this is what you want, then it's very easy. For formation 5-3-2:

    Repeat 10 times: 
    Array set (loopindex<5?"DF":loopindex<8?"MD":"AT") at x=loopindex, y=1
    
  • So you want to "toss a coin" and if it's "heads", then you run the function, correct?

    The easiest way is to use condition choose(0,1)=1

    If you need a 20% chance for example, then use random(100)<20

  • You should've given all these additional details from the beginning.. Yeah, my method will not work.

    So if there are 18 players in the array, and you want to make the formation 5-3-2, what should happen? First 5 DF players move to the top of the array, and the reserve DF players (if there are any) should stay in the end of the array? Or you need to remove all reserve players, only leaving 10 people in the array?

    I think it would be easier to copy records to another array.

    Or even easier if you had sprite instances instead of the array. 18 instances, you pick all DF, mark first 5 of them as selected for the game. Then pick all MD players, select 3 of them, then pick AT player, select 2 of them.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Are you sure that "On Path Found" is triggered? Add some visual indication to this event too. Run in the debug mode, check variables, check if pathfinding is enabled etc. If nothing helps, please post your project file.

  • Is it failing to find path? Or it finds the path, but doesn't move?

  • Move event number 10 to top level, it doesn't need to be nested under "Every tick".

    It's not possible to guess what the problem is by the screenshot. Add another event "On failed to find path -> Mira set opacity to 20". You will see if the pathfinding can't find the path, in this case try changing cell size/padding, check solid objects etc.

    You may also need to recalculate the obstacles map.

    Also, change Hunt_SalaT2 variable when the path is found, or add another condition to event #8 - "Mira is NOT moving along the path", otherwise it will be trying to finding a new path every tick.

  • This will be difficult to make with Car behavior. Have you considered using Physics? Or a combination of Car+Physics. It's not recommended mixing Physics with other behaviors, but when done correctly it may work.

    I have a small demo where I control a ball with explosions:

    dropbox.com/s/7k8w9mn8ngdu5q9/Concept5.capx

  • Or restart the layout, but don't reset the score in "On start of layout" event. Only reset the score when you need to do so, for example, when the character has died.

  • Do you want to delay the water effect, or increase its intensity gradually? If you want to delay, then disable it on start of layout, and enable only when needed.

    If you need to increase effect intensity, say from 1 to 10, use Tween behavior, "Tween Value" action. When this tween is running, set water effect parameter to Sprite.Tween("tag").value

    Or you can probably change effect parameter based on the sprite opacity, something like "set effect parameter 0 to (Self.opacity/10)"