sgn15's Recent Forum Activity

  • Because the manual said to use a rectangle invisible object for platform behavior and pin the actual object (containing the animations) to the rectangle object

  • Ok thanks. I want to ask something about the "For Each" you previously mentioned.

    So with the fixing of the run events, I finished the system of my basic enemies. I used instance variables to make the enemy move, attack, take damage and die. So I thought I can create multiple instances already of my enemy in the layout and they will behave (independent from each other) using the same events. But they did not.

    I did not use a container (I have my own reasons why), but here is how I coded it:

    I use families except for object specific events.

    GoonBoxes (family name) - contains different goonbox objects, but I only have 1 object under this family at present

    Goons (family name) - different objects in this, but only 1 goon coded (the one corresponding to the only goonbox I have so far)

    +start of layout

    ->Goonbox (not the family) object spawns goon object (not the family)

    an instance var for AI is randomized every 3 secs to 1 or 2 (for walking left and right) and it will keep walking left and right until it sees the enemy (this is when it will run towards player and attack it and goes back to stance and can go to run and/or attack again if the player is near). Distance from player is being checked every tick.

    Attack animation uses object instead of family

    +Goon's animation "Attack" is playing

    +animation frame = 7

    +Goon colliding with Playerbox

    ->Set Player to Damage (this isn't the real event, it's too long to type but you get the idea)

    Then everything else is in instance variables.

    So because it doesn't work for multiple instances, I tried adding "For Each GoonBoxes (family) object" condition to each and every single event related to my enemies, but I get an error about loop like this: http://oi62.tinypic.com/oswjf8.jpg

    How do I fix this and make my enemies behave independently from each other using the same events?

    I really thought the essence of instance vars was for this situation but ugh.... help please.

  • so these WebGL only effects won't work if I export my capx into desktop?

  • what is "WebGL" ? It says the effects are "WebGL only"

  • Is it possible to select a color from a sprite object and change it to another color?

    Basically, I intend to make an alternate palette for my character (for those familiar with "palette")

  • oh, that actually solved the problem! thanks man.

    So, when can I appropriately use the "System - > Compare two values" condition?

    I would like to ask some questions.

    What is the difference between "Overlapping" and "Colliding"? Some objects doesn't have the "colliding with another object" condition?

    How do you make a "spawned" (or even those not spawned) object's sprite be always "over another object's sprite?

  • 7Soul

    Ok. but at this point, even if I am using instance variables and that system event, I only have 1 GoonBox and 1 Goon object in the layout though....

    Note:

    GoonBox - rectangle invisible object and acts as the enemy, contains all the variables

    Goon - contains the actual animations of goon/enemy, only purpose is animation

    So I run right when the value is "Left" and run left when the value is "Right".

    It still doesn't work. It still makes the enemy keep running right regardless of where I (player) am.

    It's either the first 3 events (in my previous post) are overriding the last 3 events OR the last 3 events just doesn't really work.

    Aside from the "for each" issue you brought up, are there any other mistakes I did in my events (in my previous post) ?

    Edit:

    I tried disabling the first 3 events, the enemy did not run left. So it's really about the last 3 events not working for some unknown reason.

  • First part (under comment) are 3 events for "Run Right", while the next 3 events below it are for "Run Left". Those are for the enemy's AI (chasing after player)

    The rule is for the enemy to run (right or left) towards player if:

    • player is 30 to 120 pixels horizontally away from enemy
    • player is less than 10 pixels vertically away from enemy

    The enemy is supposed to attack the player if they are within 30 pixels or less from each other, but that's not the problem.

    I think the condition encircled is not working. Enemy can run right, but can't run left (even if the player's x is less than enemy's x)

    X_DistanceFromPlayer - instance var that is always set to abs(Playerbox.x - Goonbox.x)

    Y_DistanceFromPlayer - instance var that is always set to abs(Playerbox.y - Goonbox.y)

    AI_Movement_Number = 3 means to run right

    AI_Movement_Number = 4 means to run left

    I would think my conditions are perfectly correct, but why is the enemy not running left when the intended conditions are met?

  • I'm trying to make a damage system (similar to fighting games) using my own idea.

    When I hit the enemy, I want the enemy to retrieve the player's 2 instance variables' values for attack velocity (X for horizontal and Y for vertical) while at the same time, I disable the gravity. This involves pushback, pulling the enemy towards the player, slamming down enemy and hitting up enemy (like an uppercut).

    Right now, I am trying first a simple pushback (enemy should move only horizontally, no vertical movement).

    Enemy has platform behavior of course.

    Notes:

    X velocity and Y velocity are instance variables of Player

    Facing is also an instance variable of Player. It is set to 1 if the player is facing right, and -1 when player is facing left.

    Now I did it by

    [quote:eb0bh0em]+Player's attack animation is playing

    +frame = 2

    -> set X velocity to 60

    -> set Y velocity to 0

    +Player is overlapping with enemy object

    ->Enemy: Set animation to Hurt

    ->Enemy: Set Vector X to Player.X Velocity*Player.facing (this means the attack should push in the direction the player is facing)

    ->Enemy: Set Vector Y to Player.Y Velocity

    ->Enemy: Set Gravity to 0

    The enemy moves (being pushed), but the problem is, even if I set the X Velocity to any number other than 60 (I tried a ridiculously high number like 5000000000), the enemy still moves the SAME DISTANCE. So that means, I don't know if this is actually working or not. I want the pushback velocity to be changeable (based on the X Velocity variable), since different attacks have different pushbacks.

    So should I use "Set max speed" or what?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am making a fighting game platformer/side scroller game.

    So I have player "char1' (more players to be added later on), and many different kinds of enemies.

    char1 has several attacks.

    I want to make any instance of the different enemy types that I hit:

    • go up if i hit them with attack 1, damage is 10, makes enemy fall
    • push them if i hit them with attack 2, damage is 20, doesn't make enemy fall
    • slam them down if i hit them with attack 3, damage is 30, makes enemy fall

    and so on

    and on the other side,

    When enemy1 hits char1 (and other player type chars i will add in the future):

    • using attack1, any player will be pushed back, damaged by 10, not fall
    • using attack2, any player will be pushed up, damaged by 10, will fall

    I also want my players and enemies to be hittable even while falling in air OR when they are hit upwards (while moving upwards in air, JUST BEFORE they fall down in air).

    How do I code that in a standardized way (for both players and enemies)? like not having to repeat the same events again and again ?

    Please someone explain to me as clearly as possible. I can't understand the example of Danuyos. It's too complex.

    I'm already using families and hitboxes (for attack) and playerbox (as the "hittable body" of player)

  • ok. tried it. did not worked.

    I noticed something. Right now, the PirateWithBomb is throwing the bomb at a stairway. If the bomb falls on a lower ground level AND the PIratewithbomb is already in frame = 2 AGAIN, the bomb binds back to Piratewithbomb (and not play OnGround)

  • also, another issue is when the PirateWithBomb is spawning the bomb at frame = 2, if I REMOVE the "Every X seconds" condition, the PirateWithBomb spawns like multiple bombs all at once.

    I just want a single bomb spawned at the first tick of the frame 2.

    Did I do it right?

sgn15's avatar

sgn15

Member since 20 Sep, 2013

None one is following sgn15 yet!

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Email Verified

Progress

14/44
How to earn trophies