dmakinde's Recent Forum Activity

  • You can't generate variable names dynamically. You could use an array or dictionary for your data.

    Ah I see, thanks

  • Thanks, but I think I phrased the question incorrectly. Let's say that object.variable1 = "apples" and object.variable2 = "oranges". I am trying to use a for loop to process through object.variable1-4 in a way that I could say object.variable&indexloop would reference the data inside each variable, so on the first loop it would handle "apples" and in the second loop it would handle "oranges" and so on and so forth.

  • Hey all,

    I am attempting to perform checks on a sequence of string variables, for argument's sake let's call them object.variable1 - 4.

    I am trying to check through these variables in a for loop where the loop index serves as the number next to the variable. Is there a way to accomplish this? I tried to do reference something along the lines of

    object.variable+(loopindex+1)[/code:12h13u1e] to get construct2 to print the data inside object.variable1, but as you can imagine, I was met with the error "'variable' is not an expression in object". 
    
    Is there a correct way to do this? 
    
    Cheers all
  • for your particular example, you will do:

    local static var sum = 0

    For

    >> from 0 to tokencount("1+2+4","+")

    >>>> Add to: sum: int(tokenat("1+2+4",loopindex,"+")

    Thank you! This worked perfectly

  • Hi all!

    Is it possible to have the contents of a string variable used as a calculation? For example if I had a string that read "1+3+4" is there any way that string could be processed to express "8"?

    My string is generated through a combination of RegexReplace and replace scripts (

    replace(RegexReplace(testObject.inputVarOne,"([[a-zA-Z][a-zA-Z0-9]*,?)","g",""),",","+")[/code:yvh8elm2]) eventually turning a string of values into something more akin to a mathematical formula like the one shown above. Is there a way to turn that outputted string value into a calculation that construct2 can read 8 instead of 1+3+4?
    
    ---- update
    
    Here is what I have attempted so far: 
    I have created a string variable and set it to the above formula, meaning the string value is literally "1+2+3" I created a second, number variable and set it to the test variable I just made, and unfortunately instead of outputting "6" as expected, it simply output "1".  Can anyone offer any insight?
  • Hi all!

    I am trying to write a script that loops through all the tiles across the x and y axis , attempting to find a particular tile, and I'm trying to make this script reusable for multiple tilemaps. The way I had approached it was by making a for loop where the start index is 0 and the end index is the width of the tilemap/32 (ending with a result that steps through each tile one by one), then creating a local variable that increments with each loop. While this works, I suppose it also means that when drawing the tile maps, I have to be very precise about the size, which is a bit of a tall order for the particular project I'm on as that would mean going back and tweaking the width and height of a lot of preexisting tilemaps. I was wondering if there was a simpler solution to do this involving some sort of attribute that already does this for me?

    Thanks all

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi all!

    I've currently got a game working with the main character moving 8 direction movement behaviour. Control wise it does everything I want it to, the only problem is the rate of acceleration and deceleration throws off the pacing of the game.

    Right now I've set the max speed to 400 and set both the acceleration and deceleration to a high number as I thought that would help it achieve max speed instantly, but there is still that slight speed up and slow down. Is there any way to fix this?

    Thanks for reading

  • Found the solution! I turned out to be caused by a massive tiled texture image I used as a placeholder. Deleting to from the project solved it

  • Hey Ashley, I did some more experimenting and after consulting Construct2s own guide on optimising games for mobiles I realised I made a rookie mistake: one of the placeholder art assets I was using was a massive background image that I implemented as a tiled texture until the artist I was working with could produce something for me. Deleting that image from the project caused the game to run perfectly I'm still confused as to why it worked when using the launcher from the cocoonjs zip but not on the APK but I guess that has something to do with the way things are loaded. Ah well haha lesson learned. Thanks for the assistance none the less!

  • Hey Pixel, it turns out that the root of the problem was indeed linked to the art assets. I predicted that the problem was most likely rooted in a rookie mistake on my part and that was certainly the case! I had a placeholder tiled background that was way too big. After deleting it from the project and recompiling the project ran without a hitch haha, it's always the complicated problems that seem to have simple solutions! Thanks

    I haven't tried recompiling it on crosswalk yet but it seems to be running just fine on cocoonjs so I won t worry about that for now

  • my mistake, I meant a signed APK rather than unsigned!

  • Hi Guys,

    I've been working on a project for a few weeks with the intention of releasing it for android with the CocoonJS wrapper, but I hit a brick wall with it and after not being able to find a solution (I'm sure you'll be able to find my previous posts around here) I've decided to give up and try using crosswalk. I would just like to know if there is a way to test out my apps without streaming them over wifi? I would like to see how the game would work as an APK.

    When a project is compiled on CocoonJS, you are supplied with both a signed and unsigned APK and I used the former to test the game on my device (that is also how I discovered my unfixable problem), does Crosswalk feature a similar function? Also while previewing my game over WiFi I noticed that the game's orientation wasn't locked. My game is designed for landscape screens, is there any way to achieve this on Crosswalk? Finally I noticed that there was a status bar at the top of the screen that interfered with the game's UI. Is there any way to get rid of that?

    Thanks guys

dmakinde's avatar

dmakinde

Member since 5 Feb, 2013

None one is following dmakinde yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies