ClocksTNW's Forum Posts

  • For clarification, if I could name a text variable "1" or "2" etc. and save text to it:

    Set Textbox = 1.Text

    Set Textbox = 2.Text

    Set Textbox = RandomInteger.Text

    Is there any way to set the current key in a dictionary to a random integer? So it generates "17" and it reads the 17th key of the dictionary?

  • Hey all,

    I want to generate a number between 1 and 20, and set a textbox to a value based on what number is generated.

    In a hypothetical pseudo code world, I would want:

    Integer= int(random(1,20))

    Set Text1 = Text.Integer

    I might not be going about this in the correct way. Is there any way I can put 20 values into the textbox as instance variables and count from 1 - 20?

    Thanks,

    -John

  • Quick somewhat related question! Why does Construkt 2 default on 640, 480? Also, if I am designing an application for iphone, android, and a website with Construkt, is there any conceivable quick way of resizing it, or do I have to manually change the resolution and positions of objects each time?

  • I had animation speed set to 0 - I finally figured out the problem... the "Touching object" event is broken - you need to couple it with "At any Touch end"

    Event:

    Touching Object

    Condition:

    At any touch end

    Action: x

    The animation frame math from Geometrix was on point as well.. thanks all

  • Thanks for your response Geometrix, it certainly simplifies the code. However, I am still having trouble... it still reacts the same way- unpredictably and broken. 50% of the time it works perfectly, the other 50% it just blinks 5 times and stays on the same frame.

  • Hey all,

    I'm having some trouble toggling an animation. The first time you click on something, I want it to go to frame 1. The second time, I would like it to go back to frame 0. The third, back to frame 1. This is the way I have it and its not correct.

    Touching - Object        - Wait 1 second

    Animation Frame = 0       - Set animation Frame to 1

    Else

    Touching - Object        - Wait 1 second

    Animation Frame = 1       - Set animation Frame to 0

    Unfortunately, the "else" does not stop the program from carrying out those actions. I will click the object once and it does not appear to animate.

  • Hi all,

    Thanks a lot for the help, although I don't think my problem is solved. I might not have been clear in my issue. I now understand the way Construct 2 reads events/actions, but I'm still at a loss for a solution.

    The FIRST time I click "okay" I want X things to happen. The SECOND time I click "okay" I want Y things to happen. I tried to solve this by creating an integer value (or an instance variable) that would keep track of the # of times the button was clicked. I tried to say "The first time its clicked, do this, add 1 to #times clicked." Then I wanted to have a code that waits until the second time the button is clicked. I tried to do this by creating a separate event "Button on-click" and adding the condition "#timesclicked = 1." I'm beginning to think I need to make a new button that also says, "okay" just so this program can differentiate between them... that way I can say when "Okay1" is clicked do Y.

    I'm definitely not having problems adding or setting integers...

    Thanks!

    Edit: I also don't see a Wait for Condition option... otherwise I could wait until someone touches the button?

  • I want the conditions on Event 4 to be true, but I want it to wait until I hit "okay" a second time. What's the point in having a button "on-click" event otherwise? Right now, in Event 4, "on-clicked" plays absolutely no role in the code!

  • Also, when I add the event "Button on clicked" and then look at it again, it immediately treats it like a condition... what program changes events to conditions and gets away with it?!?!?!?!

  • Okay, this is incredibly frustrating and there's no way my code or conditions are wrong so I'm beginning to think Construct 2 is bugged.

    Here is a screenshot of part of my code.

    <img src="http://i44.tinypic.com/27ymh5.jpg" border="0" />

    The FIRST time a button is clicked, it adds +1 to the integer value in the dictionary.

    The SECOND time its clicked, its supposed to run actions at the bottom (which I've deleted out to save time and space.)

    Unfortunately, the first time the button is clicked, it runs all of those actions, completely disregarding the condition that ButtonClick MUST = 1.

    In other words, ButtonOkClick becomes 2 with just one click of the button, which is not what I coded, and not what I see on the screen. Solutions?

    Thanks in advance!

  • Here's my new code... pretty pumped about it

    <img src="http://i42.tinypic.com/sfiayu.jpg" border="0" />

    Basically, every time one of the buttons is clicked it becomes highlighted, and the other ones appear to deselect. I still haven't found a way to select every button that's NOT selected, but shouldn't be too hard to figure out. The real version of Construct 2 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> free

  • Hahaha wow! That makes a lot more sense... Thanks for the link to r134, I couldn't find it anywhere. I'm pretty excited to be able to use object families, after fiddling with the program forever... As you can see, I have been messing around with animations/setting animation speeds to 0.

    Thanks again

  • Also the background moving thing... I'll figure that out... that's definitely not right the way it is though

  • Hi Nimtrix,

    Thanks for responding, I haven't bought Construct 2 yet, so I have the r132 version. I know how to use variables, I'll try to be more clear.

    <img src="http://i39.tinypic.com/2jam835.jpg" border="0" />

    I'm wondering if I can combine the events to

    "Generic sprite is touched"

    If sprite = Button(x) then set variable =(x)

    Actions

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • "My God, this guy is still posting?!"

    Is there a way to disable and enable triggers? For example, if I wanted to ask a person if they are SURE they want to buy something, and I have a "Yes" button, is there a way to start out with all of the triggers responding to a "Yes" button click disabled, and then when the time comes, enable one of them to respond to the action appropriately? So if one of my questions is "Do you wanna see a movie?" and the next is "do you think I'm good looking?" is there a way to have the same button respond differently?