Calfuso's Forum Posts

  • What do you mean by code?

    These are events on the event sheet?

    And what do you mean when you say construct2 doesn't have coding possibilities?

    all you have to do is add the events and the action to your own event-sheet..

    The jump example is a bunch of random letters and numbers. How am i supposed to be able to get help from it unless o could get in the text as a event which i don't know how to.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It shouldn't be hard..

    Your code should work..

    Jump example

    Can i use that code somehow? Construct 2 doesn't have coding possibilities so it shouldn't, but it may.

  • I made a stretching arm once..

    You could use Timer behaviour

    to have things happen on timer..

    One way would be to set a variable when you want the stretch to happen,

    set the width of your sprite to : sprite.width+1 as long as the variable is set

    and unset the variable after one second on timer.

    I did that and it do stretch out it's arm smoothly like it should but it didn't do it when it should. It is supposed to begin stretching out it's arm when it sees the player. It's line of sigth is short so it should only be able to see the player when the player is close to it. When it has seen the player it should stretch out the arm in one second. What really happens is that it stretches out it's arm several seconds after the platyer has came close to it and drags it in and out when the player go to random locations. I hope you understood the problem by all the complexity this reply this answer had. The timer behaviors seem a bit messy. Is there any other thing you can use?

  • Could it be the collision polygon of your sprite is overlapping a solid?

    If so the jumping won't work...

    No it doesn't It stands on a solid object but the collison polygon is on the solid object. I guess making a enemy jump is impossible for me how hard i an try. How sad....

  • This is expected behavior..

    If you would use the default controls and keep the key for jumping pushed it would also jump only one time..

    It seems your event is working correctly..

    So now the question arises when do you want your enemy to jump and add events and conditions for that..

    great! atleast we are making progress! I made the event like this.

    Every 1,0 seconds

    action=

    "jump" Simulate control pressing Jump

    The enemy doesn't jump

    Then i skipped the action=

    "jump"

    Didn't work.

    Then i made

    Has Line of Sigth of Sprite

    action=

    "jump" simulate control pressing jump

    That didn't make the enemy jump but it did make the enemy glitchy enough move to the rigth until it hit a wall when the game started. It doesn't have any events that make it move left and rigth so that is special. So how should i set up the events if i want to choose when the enemy is going to jump?

  • Body pin to body would work if you are trying to pin the body to itself..

    If you want an example of the pin behaviour choose new project inside Construct2 and open the pin-behaviour example..

    It's one of the many examples of behaviours and other possibilities of Construct2 shipped with the program..

    I did open the pin behavior example and i changed the cog to the body sprite and one of the sheilds to the arm sprite and they finally pin together. It must have been something wrong whit whit the first body and arm. Now i need help whit the stretching part which i not think is documented anywhere. The arm should strtch little by little and reach full width after one second. If you just set in line of sigth and set width to the final width it makes the arm go to it's final width immediatly in one choppy movement. It's supposed to stretch out graudually. You could do this by making it width 70 after 0,15 seconds and width 80 after 30 seconds and so on. The problem is that i don't know how to find a timer that only make a event happen once. X seconds makes a event happen every x seconds but not just one time. Even if i make it all work i don't know how to adjust the appaerance of the arm when it's stretches. The arm should just be wider, not any shorter and the hand shouldn't get wider. How can i make it look good.

  • Again i would want a event sheet of how this would work.

  • Could it be that when you check if action4 is jump, you are checking if action2 is something else and that condition is also true

    Why use action4=jump and not just action=jump?

    The reason why i named it action4 was becuase i have anothger enemy whit a instance variable nmed action and i thaugth both couldn't share that name. I changed the name to action and it still was okay so now the name is just action. It still didn't make the enemy jump though. My other instance variable is the enemys health counter in case you were curious. The enemy do jum exactly when the game starts for some reason but not after that. I tried adding every tick and then jumping event but no success.

  • If you could share your events and/or capx it would be easier to answer..

    I don't think there is any bug or something wrong with (your) Construct2

    Right now, reading your question, I'd have to guess you have multiple events cancelling out eachother..

    Multiple events/conditions that are true at the same time and because construct2 reads events from top to bottom, probably only the last event is acted upon.

    But like I said, without seeing the way you've set up your events this is only a guess..

    Too bad i can't post links to images until i have 300 in reputation. I would send links to my event sheet in every question i asked if i now could. No of my events cancel jumping so i it would not matter how far up the event is.

    I try to show the event sheet i have here as good as possible.

    action4 = jump Simulate Platform pressing Jump

  • Only one of the objects needs to have the pin behaviour..

    From the Manual entry about the pin behaviour:

    Simply adding the Pin behavior to an object does not do anything. You must use the Pin action to pin the object to another object.

    So you would need something like this:

    on start of layout

    > pin arm to body

    The manual says something about mode bar. Where can i see that? The pin behavior has no properties. i did make body pin to body at the start of layout. The body still moves whitout the arm and the arm falls to the ground. Again i need to see a succesfull event sheet.

  • It seems like you are setting the bullet direction every tick, while you only want to set it once..

    You could either use a bullet on created event or set the direction in the spawn event itself..

    Just asking, because these are pretty basic events/actions, did you follow any of the beginners tutorials and read the manual to get you acquainted with how Construct2 works?

    This site provides great documentation.

    While this may seem easy for you it isn't as easy for me. I know that tutorials help you and i have read some. It's just that it's hard to find the answer how to do specific things by just readinbg tutorials. Asking in these forums is easier whit that. the stretching arm out thing fro example i consider a complex thing and i doubt i easily would find a tutorial that covered that. And if you fifn it annoying to answer all my questions then don't. You seem to be the only one answering today so i could migth aswell get help from sombody else. Call me a uber noob but i still can't make the shoot in two directions work. If you still want to bother you could please post a url of a succesfull event sheet of shoot in two directions.

  • >

    > > Setting the bullet direction after spawn?

    > >

    > > If it's only shooting right, your bullet's angle of motion is probably 0..

    > > To shoot to the left you should set the angle of motion to 180..

    > >

    >

    > I want to be able to shoot one bullet rigth when i am facing rigth and shooting one bullet left when i am facing left. I don't want to shoot to the left and rigth at the same time.

    >

    Yeah, so if you are facing right you should set the bullet angle of motion to 180 and if you are facing left set the angle to 0..

    It works but if i shoot a bullet when i am facing rigth and then face left the bullet change direction to left after i have shot it. The bullet i just shot should keep the direction it had when i shot it. It changing the direction when i do will be troublesome if i shoot much and need to move much at the same time.

  • Stretching would be setting the width of the sprite..

    So put the origin of the sprite on the left.

    Pin the sprite to the player using pin-behaviour.

    Give the enemy line-of sight

    Stretch (set the width of) the arm when the enemy has line of sight..

    If you want the arm to point in the direction of the player, you should set it's angle to something like angle(arm.x,arm.y,player.x,player.y)

    If you want it to be better looking, you could change frames of the arm sprite depending on it's width ofcourse..

    Thanks for the help. I unfortunaley got stuck on the pin part. I have given both the body and the arm the pin behavior. Then whit the arm i made the event is pinned and after that the action is pinned to body. IThen whit the body i made the event is pinned to and after that the action is pinned to arm. The body moves left and rigth so when i turn on the game the body moves like usual but the arm who was supposed to be pinned to body doesn't follow the body and get's stuck in place. I thaugth that the arm also needed to move left and rigth for it to follow the body. So then i made it do that. The arm still doesn't follow the body. I want the arm to always be at one position in contrast to thye body how much the body an moves. Now it doesn't even follow the body and just falls down the ground and stops moving. How don you make the pin behavior work?

  • The question is to vague to answer..

    When is the collision supposed to take place? "When a certain sprite collides whit the object. On touch rather said.

    When is the collision not supposed to take place? When any other sprite rather then that sprite collides whit the object.

    If you disable collisions of an object, how is it supposed to detect a collision?" It's supposed to be disabled to all sprites except one. How i do that is what i ask for.

  • Setting the bullet direction after spawn?

    If it's only shooting right, your bullet's angle of motion is probably 0..

    To shoot to the left you should set the angle of motion to 180..

    I want to be able to shoot one bullet rigth when i am facing rigth and shooting one bullet left when i am facing left. I don't want to shoot to the left and rigth at the same time.