Chris PlaysOldGames's Forum Posts

  • Construct 2 has a built in system save/load event.

    You can save and load by tags (file naming) allowing you to easily save at checkpoints and either overwrite old or have multiple.

  • You will probably find you will need to calculate it yourself using the speed=distance/time formula and transfer that to a variable to set bullet speed by.

  • Ahh, yes I see it now. You are right if the angle is close to the min-max when it sets the random 4,8 angle it will trigger again.

    Hmm.. maybe create an event that simply sets a variable "canFire" that is set to 1 every tick that the turret "could" be firing and then condition that variable in the onshoot event.. canFire=1. It would need to be set to 0 whenever turret shouldn't be firing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Edit your title to be more question specific to get the most views of people that may be able to help you.

    For your first issue you will need to track what frame your player is on by grabbing it when the button is no longer pressed. You will need to then set the new animation frame to that variable value (assuming they match) when the player changes direction and then play from current.

    As for the stopping, have you set the deceleration value really high? Set it to like 1000+ and see if it does what you want.

    You may end up having to make a custom movement or using an event that disables 8-way and then stops character before enabling again.

  • I don't have the answer, but if you will edit your post title to be more specific... ie: "Problem effects in webcam tutorial, help!" or some such you will be more likely to grab someones attention that knows the topic.

  • The delay is easy, just put wait =1 and isAiming=1 at bottom of the "on any touch end" event.

    I am terrible at calculating angle logic (and am minutes from heading to Disney World) but you will need to change the values in the "is in touch" event (angle(Touch.X, Touch.Y, CatapultBlock.X, CatapultBlock.Y)) to restrict the draw to your required angle... maybe someone with a better head for that can give you the correct values. You might want to ask just that part of of your question in the forums again "Correct logic to limit physic catapult to 0-20 degree firing angle".

    If you need to reset the camera back to the catapult after it scrolls to the shot pig you can use a subevent under the "Else" portion of the "Is aiming" event that uses event "Is Physics sleeping" with action scroll to catapult.

  • Logically it looks to be ok. I would think the cannon ball is being spawned twice during the on-shoot during certain instances due to the angle calcs.. try adding a "trigger once" system condition to the angle calculation sub-events if it will let you.

  • Like andreyin says, it is in your events not in the behavior itself. Go through your events line by line and also the properties panel for the turret behavior and you should spot where it is spawning two. If all else fails post your .capx or a screenshot of your events using mediafile or imgur and put spaces in the url if your rep isn't high enough w w w . f o rexample. c o m

  • I am not familiar with the "model physic catapult". Is this one of the templates that come with C2?

    If not can you provide an example?

  • What oosray is saying is to use a varible exactly like you might have used to solve the firing delay:

    Just make a variable to control when an arrow is allowed. Put an instance variable on bow called inFlight=0 and in your touch-shoot event add condition inFlight=0. At very top of shooting actions put set inFlight=1. Now at the bottom of your shoot event actions add a wait 0.5 followed by set inFlight=0.

    You could just use one variable for both of your problems if you only wanted an arrow to be loaded and fired every 0.5 seconds. You would simply need to condition out that variable in your firing event code.

  • On second look my example is more for narrated story and less randomized adventure. However, I would still follow that line for a randomized text adventure. I would just build more functions for my choices and results.

    Anything that occurs often (run, fight, encounters) would be built into functions that i would call as needed.

  • Since the complex (and maybe "correct") way has been explained I will cover the second part of your question.

    I hate math, I am terrible at mathematical formula in coding. This includes even things as simple as multidimensional arrays. This is why I was drawn to construct 2, with it I don't have to be good at complex programming logic to make some cool things. Now if I was planning on making a heavy loaded mobile game I might worry about efficient process but short of that I go with what works. I have learned a lot about the maths (and even array use) while doing so.

    If "I" was making the game you are describing as a Construct 2 owner. I would do it the long hand way because it would be easier for "me" to understand and debug. My game making time is limited so I would rather be making progress than figuring out the correct way or efficient way if it is not needed for this project... by doing this I find I learn a lot of the correct/proper/efficient along the way.

    I would make the three recyclable text boxes and a couple of variables for my holders and stats and I would then make a template (ie basically the first interaction with the 3 choices):

    Set text box1 "It was a dark and stormy night, do you wish to go outside?"

    Set text box2 "Yeah, sure why not? (Go outside)

    Call function setTemp

    Set text boxMessage to visible-Set text "Courage +&temp", "Dryness -&temp2"

    Wait 1 - Set boxMessage invisible

    Add temp1 Courage

    Subtract temp2 Dryness

    Set text box3 "Hells no!" (Quit game)

    Function setTemp()

    Set temp1 int(random(1-2))

    Set temp2 int(random(1-3))

    Set temp3 int(random(1-4))

    Set temp4 int(random(1-5))

    Now all I would need to do is copy, paste and change values for 500 events... would only take an hour or two.

    If you were worried about event sheet length on older mobile devices then you could break your events up over multiple sheets but I would not think that necessary for most adventures.

    As for the actual clicking process I would spawn invisible sprites under my text boxes that listened for clicks to determine what was the choice was. You could use long buttons as well that contain the text on them, but you would be limited to the Construct 2 ugly button.

  • Are you using the object spawn other object event? I am at work so can't download capx right now.

    The second part is easy fix. Just make a variable to control when a shot is allowed. Put an instance variable on bow called hasShot=0 and in your touch-shoot event add condition hasShot=0. At very top of shooting actions put set hasShot=1. Now at the bottom of your shoot event actions add your wait 0.5 followed by set hasShot=0.

  • https://www.scirra.com/tutorials/594/building-a-global-user-interface-ui

    Check out that global UI tutorial, it isn't exactly what you are looking for but it explains the parts you need to know.

  • I believe what you are saying is.. If the player delays at the start screen all the elements are already running once the game starts visually.

    This is a common issue and one I had to solve myself in my space shooter. It is not an easy thing to fix ironically. Common sense would say "start of level" means when the player can see it.. this is not true however with C2. You will have to take all of your elements that need to wait until the player is actually "in" the game and tell them when to start separately of on start event. The easiest way to do this is with a trigger. I put a start button on my intro/instruction screen. The start button being pressed changes a "Started" variable from 0 to 1 and my on start of layout conditions out Started=1. This way the layout junk won't load till the player actually starts the game. I then moved the order of the on start actions or put some after a wait=1 action to make sure the player had time to get in visually and not notice any behind the curtain shenanigans.

    In clicker wizard I simply put a "click or touch to start game" flashing text on splash screen. This text event carries the same trigger type var and will let level load only after player clicks/touches screen.