kiko2015's Forum Posts

  • Hi, here I am again asking for help with variables.

    What I need is to save the width of a sprite and then after a transition to another Layout System will recreate this very sprite but set its width to what it was last.

    Thank you.

    http://www.geocities.ws/kikoriogames/GetWidthCurrentValue.capx

  • use variable

    PickRandom2Line.capx

    Thank you so much, Korbaach. It works perfectly.

    In the end it was so much more simple than what I had been trying. But I guess it takes cleverness and clarity of thought to achieve a good result like you did. I am getting there.

    Thank you a lot!!!!!!!!!!

  • Hi.

    I have a project with AJAX/DICTIONARY calling random lines from a text document and now, depending on which line is displaying I would like to be able to select another line from another document and display, THIS PART I KNOW, I am having a hard time figuring out how to detect the random line displaying. Can anyone help?

    http://www.geocities.ws/kikoriogames/Pi ... mLine.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I couldn't open your capx cause I use the stable version of construct but I have a simple solution.

    You use every X seconds, all you have to do is using a variable as X.

    For example, if X=(yearsVariable/10) then every (10/10) 1 seconds

    when he is 20 years old ---------- every (20/10) 2 seconds

    If it's too quick, create timespeedVariable and use it as X.

    Every timespeedVariable seconds

    You change timespeedVariable when he is 20 years old.

    Alright, man!!! I did it!!! Thanks for the great explanation!!! Thanks everybody here!!!!!!!!!!!!!!

  • I couldn't open your capx cause I use the stable version of construct but I have a simple solution.

    You use every X seconds, all you have to do is using a variable as X.

    For example, if X=(yearsVariable/10) then every (10/10) 1 seconds

    when he is 20 years old ---------- every (20/10) 2 seconds

    If it's too quick, create timespeedVariable and use it as X.

    Every timespeedVariable seconds

    You change timespeedVariable when he is 20 years old.

    So when I create this variable which value should I assign to it?

    Thank you a lot!

  • You would just use some if-then logic. You could have an event that runs every second with two subevents that change the day and year variables differently based on the value of the years variable.

    Every 1 second

    add 1 to yearsVariable

    add 0.5 to yearsVariable

    (Does my shorthand make sense?)

    Yes. It makes sense but I am a newbie so I think I could't get it right. Thank you, though.

    I am still learning a lot of thinks thanks to people like you. What I am trying to achieve is to slow time down when player is 10 years old, for example. I tried all your suggestions but I think my limited knowledge was a deterrent. So I created a quick, clean project just to show you what I am trying to do.

    I really appreciate all your help.

    http://www.geocities.ws/kikoriogames/SlowTime.capx

  • You could fool around with timescale and delta time... but why not simply make the every x seconds for day change be just more seconds so the day is longer... hard to say more not knowing exactly what your game entails.

    I am still learning a lot of thinks thanks to people like you. What I am trying to achieve is to slow time down when player is 10 years old, for example. I tried all your suggestions but I think my limited knowledge was a deterrent. So I created a quick, clean project just to show you what I am trying to do.

    I really appreciate all your help.

    http://www.geocities.ws/kikoriogames/SlowTime.capx

  • I am making a game with its own time frame, in other words time in the game runs faster than in real life. What I am trying to achieve is this. Player starts at the age of 10 but when she turns 20 for example I want time to run slower. Right now I have time running like this:

    I have 2 global variables (daysVariable and yearsVariable) and EVERY X SECONDS days go by and so do the years but when player turns 20, system is checking yearsVariable EVERY second, I would like to slow down time. How could I achieve that?

    Thank you.

  • I'm not sure where are you going with this but you could create a temp variable that takes the random number and compare it later. Also the random function will generate decimals so you have to use int, floor or ceil to round it.

    For instance:

    Set varrandom to floor(random(0,300))

    Set whatever to trim(tokenat(Dictionary.Get("ReadData"),varrandom,";"))

    Since you've set the varrandom to a random number, you can compare this number so you can tell which line it got.

    I am making this game basically with questions and answers and instead of creating several documents, which would be excrutiating, I want to have it in one document so that when the player chooses a certain answer to a question there will be a reply to that answer, this reply has to match the answer he chose. A little consfusing but your insight will work fine for me. I am going to try it.

    Thank you a lot!!

  • I have Ajax request a text file --- trim(tokenat(Dictionary.Get("ReadData"),random(0,300),";")) --- as you can see it's randomized so any of the 301 lines could be displayed upon System Create Object Text and Text display one of these lines.

    I needed to check which line is being displayed so that I could create another event based on which line is displayed.

    Hope I made myself clear. thanks and help if you can.

  • Thanks EVERYONE for the help. Thank you a lottttttt!!!!!!!!!!!!!!

  • Oh right I thought you meant multiple in one click. You can just use a variable as a condition like this : https://dl.dropboxusercontent.com/u/495 ... htext.capx

    Thank you a whole lot, PLINKIE. I really appreciate it! It worked great for me. Thanks for the help!!!!!

  • You could just add a condition to your touch event checking that Object.Count = 0

    That would be with a variable, wouldn't it? I am looking into that. I am still getting around with variables.

    Can you shine a light?

    Thanks.

  • > Oh right I thought you meant multiple in one click. You can just use a variable as a condition like this : https://dl.dropboxusercontent.com/u/495 ... htext.capx

    >

    Got an error!

    http://www.geocities.ws/kikoriogames/error.png

    If you can maybe tell me If I am doing something wrong. Thank you.

    Downloading newer version. Sorry. My bad!

  • Oh right I thought you meant multiple in one click. You can just use a variable as a condition like this : https://dl.dropboxusercontent.com/u/495 ... htext.capx

    Got an error!

    http://www.geocities.ws/kikoriogames/error.png

    If you can maybe tell me If I am doing something wrong. Thank you.