aquadijoib's Recent Forum Activity

  • The tokenat expression is actually quite simple. It works like this: tokenat(text, index, seperator)

    The text ist just the input. The index is 0 based, so if you have a text like this "Hello World" and you use index 0 with whitespace as the seperator (you have to input " " for whitespace) you will get the word "Hello". Index 1 will return "World". This way I check the first 'word' in the input. If it is /pm the condition is true. The third event uses a number of system expressions to filter out the "/pm" and only return the text after it. Basically it uses the mid() expression to get the text from a specific starting point (index) to an end point. I set the starting point with a combination of len() and tokenat(). Len() returns the number of characters in a string so i put in the tokenat(textbox_in.text, 0, " ") to get the number of characters from the "/pm" command. This will be 3 everytime for "/pm" but this will make it more dynamic. After that I have to set the end point (index). This is just the length of the whole text ( len() expression again) minus the lenght of the "/pm" command (3 characters).

    That should be everything for this example

    I hope you can understand

    Feel free to ask anything!

  • Thanks for your answer Ashley,

    I installed the latest beta release r238 and exported my project with cordova. In the options I enabled "Use new Intel XDK project format".

    After I loaded the .xdk file in the Intel XDK, configured all my build settings and imported the icons and splash screens, I get the same error as before. The files that can't be found (icons and splash screens) are in the right folder though and I can even open them in the built in file explorer in the Intel XDK.

    I'm not sure if this still is a compatability issue between XDK and C2's new project format or something else.

    Thanks again!

    EDIT:

    I just tried disabling the "Use new Intel XDK format" option but I got the same error again when trying to build (It fails while uploading the project files).

    So it seems like it doesn't have anything to do with C2 I think. I'll probably have to wait until the next XDK release and see if it works then.

    Thanks!

  • I would do it like this:

    Button: On clicked

    -- TextBox_input: Text is NOT "" (case insensitive) <----- Check if the user has written something in the input textbox

    -- tokenat(TextBox_input.Text, 0, " ") = "/pm" <-----Check if the first token index (0) in the TextBox_input.Text is "/pm"

    -----> TextBox_output: Set text to mid(TextBox_in.Text, len(tokenat(TextBox_in.Text, 0, " ")), (len(TextBox_in.Text)-len(tokenat(TextBox_in.Text, 0, " "))))

    The action "TextBox_output: Set text..." just sets the text in the output to all characters that come after the "/pm".

    I hope this helps!

  • You can use the file chooser object to load a file and then you can load the image in a sprite with the returned data URI in the "Load image from URL" action.

    Here is the manual entry of the file chooser: https://www.scirra.com/manual/182/file-chooser

    I hope this helps! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • You can have random 'reload' and firing times by doing this:

    Add the Timer behavior to your villains (enemies)

    On start of Layout:

    ---> Enemy: Start Timer "fire" for random(1,3) (regular)

    On Timer "fire":

    ---> System: Create object "bullet" on layer 0 at (enemy.X, enemy.Y)

    This will make them shoot a bullet every 1 to 3 seconds.

    I hope this helps!

  • Ashley,

    I just found some beta releases of Construct 2 which are newer than my current version (Stable release r233).

    It seems like the beta releases contain many bug fixes and changes that have something to do with the Intel XDK. Do you know if my problem could be fixed by updating to a beta release?

    Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You use a global variable in your project to set the sprites rotating. That's the problem because if that one variable is true, all sprites start spinning. You need to test every single object and the way I would do that is use an instance variable for each object that is set to true if the mouse is overlapping it.

    Then if the instance variable of the object is true, the sprite will start spinning.

    i hope I could help!

  • I haven't done this myself as I would use arrays to make a level editor and loader but maybe you can use the save/load function to make a really simple editor.

    If you make an editor where the objects of your game have the same name as in the game itself, you should be able to place the objects anywhere on screen and use the SaveStateJSON expression after On save complete or On load complete to return a string with the contents of your room.

    You can save these strings in a project file which you can place in your game. There you can load that file and the layout will be built up just like it was in the editor (just be sure that every object has the same name as in the editor).

    As I said I'm not sure if this even works but it's an idea.

    I hope this helps!

  • You can use the distance() system expression. Just compare the distance from the player to the bullets with your range and if the distance is greater than the range destroy it.

    For example:

    Compare 2 values: distance(player.X, player.Y, bullet.X, bullet.Y) > 200 <--- Your range in pixels

    ----> bullet: Destroy

    You could also use the fade behavior to destroy the bullet after a certain amount of time.

    I hope this helps!

  • bump!

  • You could probably use the For each loop to check every checkpoint if it is touching the player. If that is true just set the animation frame of that checkpoint to 1 (active).

  • No, you have to add the Sprite Font object just as any other plugin like the Text object into your project first.

    Then you can either use the default font, which is loaded in the Sprite Font, or you can import a Sprite Font just like you import an image to the Sprite object (It is the same editor window). After that you have to set the right character width and height in the object's properties bar. You will get that information from the sprite font generator I found when you create your own sprite fonts.

    When you are finished with these steps you should be able to just write your text in the text property or use the "set Text" action just like you do it with the Text object.

    I hope this helps!

aquadijoib's avatar

aquadijoib

Member since 17 Jan, 2015

None one is following aquadijoib yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies