Sargas's Forum Posts

  • <object.compare instance variable = your var, do something

    <else, do something else.

  • an easy work around is turn the trigger into global event

    so make the trigger change a variable

    and when variable is changed, then destroy object.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm trying to make a system that spreads a player's control over the terrain. The terrain is pre-made of hexagons.

    Each hexagon has a cost (like the one used in pathing). so when the player places a base in an hexagon with no owner, control spreads from the base out.

    The base has "power" to determine how far can it's control reach in every direction.

    example image 1

    example image 2

    CAPX V.1

    I tried to use a function to make each owned hexagon spread to every non-owned hexagon around it using the base "power". However I don't know how the make construct differentiate between instances in functions when every object is actually the same.

    Any ideas?

    EDIT: I played around A LOT with it, and at least I got it to spread now... however it DOES NOT behave like i want it to =( CAPX v.2

  • functions are triggers....

    an "every X seconds" needs to be allowed every tick.

  • If what SgtConti says is true. Then C2 just got a lot more intersting!

  • you'll need to show us the capx, i'm 100% sure you made a mistake somewhere.

  • Wertle actually you sorta can.

    A

    or

    B

    else

    A

    B

    else

    C.

    The first block must be an or block. "else" is a system condition.

    also, 2 conditions in the same block work as an "and".

    my example says, when A or B, or when A and B, or when C.

  • 7Soul 79% en the 4th year probably...

  • It's really simple. Just type "knock back" on the forum's search tool and replicate one of the many examples already provided by the community.

  • This is a very important question!

    I'd like to know too :3

  • ok, I figured it out... i just had to add a +180 on the calculation....

    -180+180 = 0

    180 + 180 = 360

    and there i go.

    stupid angle expression.

    "round((angle(unit.X,unit.Y,Enemy.X,Enemy.Y))/45)"

    I also had something else wrong.

    This is the correct form:

    "round(angle(Enemy.X,Enemy.Y,unit.X,unit.Y)+180)/45"

    or the result is inverted =(

  • hi there :D!

    I'm having trouble figuring this out.

    I'm making a RTS type game. And my sprites have several frames to show which angle they're looking at using the "MovingAngle" expression of the pathfinding behavior.

    For example this: "round((unit.Pathfinding.MovingAngle+45)/45)"

    That particular unit has 9 frames (frame 0 is empty). And it works fine :D

    However, they also have the turret behavior, so they use their pathfinding.MovingAngle when they don't have targets, but for when they do have targets, I don't know what to do. The "angle(x1,y1,x2,y2) expresion only give me negative numbers from 0 to -180, unlike MovingAngle that returns 0 to 360. So I can only use half the angles when in range.

    The idea is that when they have targets they look at them when they move.

    I hoped something like this: "round((angle(unit_Builder.X,unit_Builder.Y,F_Enemy.X,F_Enemy.Y))/45)" might have worked. but it doesn't =(

    Any suggestions? Am I missing something? D:

    (just in case, i AM using the pick target by UID)

  • It's constantly shifting between 2 and 3 gold badges... did I earned them or not? xD how can one lose a gold badge? D:

  • It's exactly as LittleStain said, if you want a layer to move with the screen, you need to set it to paralax 0.0 and place all interface objects in that layer inside the screen.

  • the best way to place the walls is just to put them on a parallax 0 layer =)