jobel's Forum Posts

  • There was a good post about AI in Castle Story developers' blog

    cool, thanks for this..

  • hey that's a neat idea to make the trails.. thanks for that! it really helps seeing the movement pattern.

    I've done the figure 8 pattern before, but I was wondering if I could get the figure 8 pattern to rotate... as the player moves around.

    it doesn't seem possible using normal sine behavior.

  • hi,

    Is there a way to get the sine behavior to rotate? I'm aware of the Forwards/Backwards movement which stays true to the sprite's rotation, but I need my sine going the other way (Left/Right). I could just turn the direction of the sprite itself, but I don't want to that because then all the directional stuff will be messed up.

    I have a turret behavior that keeps the enemy facing the player, but I always want the enemy moving side-to-side.

    Actually what I really want is a figure 8 pattern using 2 sines (1 vertical and 1 horizontal) and I'd like to be able to rotate that movement as the enemy rotates.

    is it possible?

    capx

  • check the "how do I FAQ" there are examples of it there. The example use the platform behavior, but the logic is the same for the custom movement behavior.

    wow, just found this FAQ... VERY useful.. thanks!

  • Sorry if this has been asked before, I searched the forums but couldn't find what I was looking for.

    I want to get the X,Y of the current target.

    I am having my turret fire a rocket at the target. I want to do "course corrections" to the rocket up until it's half the distance to the target so the player has a chance of dodging it.

    However, the Turret has more than one object that it targets. So I need to know which object is targeted, and if it's the player.

    I can save the UID at the time of Targeting, but I need to know the X,Y at the time of firing the Rocket...

    please help...

  • awesome! thanks..

  • Are you using Turret Behavior?

    I believe you can AquireNewTarget as long as it's within the Range.

    You could set a variable:

    set RandomAItarget to random(0,1)

    if RandomAItarget = 1 then AquireNewTarget etc...

    otherwise do nothing (keep attacking the current target)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thanks, I checked that out... cool..

    I had to download new drivers for the MadCatz controller at

    microsoft.com/hardware/en-us/d/xbox-360-controller-for-windows

    The Madcatz site doesn't seem to support their own Gamepad, so don't bother looking there.

    but after the driver update, all was easy..

  • I figured it out incase anyone else wants to know.

    I found the anglediff function which successfully compares 2 angles even if one angle is 0-360 and the other one is 0-180 (and negative numbers)

    So I compare:

    anglediff(floor(Player.CustomMovement.MovingAngle),floor(Player.Angle))

  • Hi,

    A quick question about angles...

    How come CustomMovement.MovingAngle has negative and positive numbers and Object.Angle is all positive numbers?

    I can't compare the two without some sort of conversion.

    The only time it would work is if the player is going straight down.. both variables are 90.. but going up one is 270 and the other is -90.

    When my player reaches a certain speed I want to stop the acceleration, unless they change direction. So I want to add:

    IF CustomMovement.MovingAngle != Player.Angle

    I'm trying to emulate no gravity type physics. So you can only go a certain max speed in one direction, however in the opposite direction, increasing acceleration would slow your speed.

    I feel like there's an easier way to do this that I am overlooking...

    thanks..

  • Chrome support is default... it will work, you don't have to do anything.

    As far as in-game support.. either use 'Simulate' or use the Gamepad events themselves.

    start with this..

    create a textbox..

    add an event for the Gamepad.

    use Gamepad 0 any button pressed

    for the action use set text to "button pressed:" & Gamepad.LastButton(0)

    0 is your first controller

    1 is your second controller etc...

    this will give you the value of what each of your button presses produce..

    the analog sticks also have an axis parameter which you can check as well..

  • I'm also trying to get 360 controller support for my game..it currently only uses the keyboard... I thought I found a forum post somewhere that discussed a quick way of adding controller support.. after a quick search i did not find it... so I'm not sure how well it works..

  • I also want to stretch a sprite and it seems the Stretch Fx doesn't have any parameters??

    what did you end up going with?

  • I would do it something like this.

    If distance(prototypeX, prototypeY, player.x, player.y) <= turret.range

    ahh using the 'distance' function.. I haven't used that before, cool thanks..

    but about your: "If, else if, else"

    I wasn't aware you could do "else ifs" and then another nested "else" from the same event.. I actually tried, but maybe I am doing something wrong? I thought it was a limitation of C2...

  • If not redo the placement calculations on the prototype variables until you have acceptable values.

    thanks for the reply..

    so you are saying to create a loop and keep checking until you have acceptable parameters?

    but what about the calculation?

    player.x + turret.range + random(layout.width)

    player.y + turret.range + random(layout.height)

    say my layout is 800x800

    and range is 300

    and the player is at 700,750

    the generated values would have to be approx between 0-400,0-450

    if the player is at pos 20,100 then of course the regular calculation would work...

    I probably have to do a bunch of checking I guess...like:

    if player x is > (layout.width - range) then subtract range instead of adding range etc...

    just wondering if there's an easier way to do it.