R0J0hound's Forum Posts

  • From the manual:

    https://www.scirra.com/manual/78/expressions

    he expression Self can be used as a short-cut to refer to the current object. For example, in an action for the Player object, Self.X refers to Player.X.

  • This works if there is only one object type in a family:

    For each 3DSprite

    for each Sprite

    do comparison...

    In this case 3DSprite and Sprite allow for two separate picked instance of sprite.

  • You could perhaps use this formula:

    speed * time = distance

    but solve for time:

    time = distance/speed

    distance is 100 since you create the tiledBgs with an x of -100

    so you get this:

    100/40 = 2.5

    100/50 = 2

    100/60 = 1.666

    The last number you had is closer to 50/60 = 0.8333 which also works since the tiledBg texture is 50 pixels wide, you just end up with more overlap.

    You can get the same effect without the warmup time by just positioning the tiledBg's in you layout and setting their speed. Then replace all your events with one every tick event:

    Every tick

    set x to self.x%50-50

    Change the 50s to whatever the texture width is.

  • When you export to exe check the enable python checkbox and select all the python files you want included in your exe. Alternatively you can copy the python files you use to the same folder as your exe.

  • Animmaniac

    It's not possible at the moment. The plugin uses the non webgl renderer even with webgl enabled. I need to re-write a good chunk of the plugin to use webgl to make it work, but I currently don't have an eta for that.

    bjadams

    I did a change to the plugin after I made the example. Try the capx again I fixed the events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's a bug that it goes to the second layout when loading. That's why it's a good idea to do your own save/load system. You can use my example for any layout, just include the events in each layouts event sheet and change the "on button clicked" events to "on loop" events so you can call the save/load event from anywhere with the "Start loop" action.

    When you go back to layout 1 reload with events so the changes from event 2 are discarded. The save files the save/load actions use have no extension.

  • Add the mouse object then use these actions under the appropriate conditions:

    Set angle toward Mouse.X, Mouse.Y

    and

    Move Forward 100*dt pixels.

  • You could use the choose(1,3) function.

  • When I click on the blue rectangle to take me back to Layout 1, it goes back to Layout 1 but the objects retain the positions made in Layout 2. The positions in Layout 2 were only supposed to be temporary.

    The objects are global so they keep the same position from layout to layout. You could try to reload when you go to layout 1.

    When I click on the black rectangle to load the save, it's supposed to start on Layout 1, but it jumps to Layout 2. The only thing that goes right is that it saves the correct positions, it's just that it puts them in the wrong layout! :-(

    This makes solution 1 not work, so I would say this would be a good situation to do your own save/load system.

    oes anyone know what the file type of the save file is? I'm on XP and the file type doesn't show, it just says "file" under file type.

    It's a Construct game state file, only readable by the game that made it.

    oes anyone know which plugins don't work with the Save & Load function? I haven't encountered any yet but I read that some plugins don't Save & Load.

    Only the sine behavior comes to mind.

    There are examples elsewhere on the forum of custom save and load, the S plugin can be helpful in this aspect.

    Here is a simple save/load that will work for your example:

    http://dl.dropbox.com/u/5426011/examples15/simple_save_load.cap

  • Cool effect Pode,

    I used Blender and your example to make this:

    http://dl.dropbox.com/u/5426011/examples15/marble_monkey.capx

    Here is the .blend file I used to make it:

    http://dl.dropbox.com/u/5426011/examples15/normal_map.blend

  • Use a global variable to store the list of files in the directory.

    Then set the array size to be the the same as the number of files.

    Then the only loop will be "for each element".

    Start of layout

    +set var to File.FileList("c:\matt\cap\images")

    +Array: set size to len(global('var')), 1, 1

    for each element

        Create Object Text on Layer 1 at (Array.CurrentX * 30 + 20), (50)

        Set text to global('var') at Array.CurrentX

    global('var') at Array.CurrentX

    is a valid expression since File.FileList() is an array data type.

  • Here is an example that filters through a Chinese menu, including some words and excluding others:

    http://dl.dropbox.com/u/5426011/examples15/find.capx

    If you want to use actual tags you could setup the array like this:

    Array.At(n,0) would be the sting

    Array.At(n,1) would be a comma separated list of the tags.

    The use find on the tags list instead of the sentence.

  • The main roadblock you will encounter is you can't add frames at runtime. But it's key to the design and is probably the first thing you should tackle. Here are 3 different methods to do it:

    Method #1

    You can use the tiledBackground object with power of two sized textures and the image offset action to display only a subset of the texture.

    Here is an example:

    http://www.scirra.com/forum/using-tiled-background-for-image-fonts_topic41196_post253858.html#253858

    The disadvantage of this method is vram usage will be very high if you load a different tileset texture. Loaded textures are unique for each tiled background, so the vram used would be vram_the_texture_uses*number_of_tile_objects.

    Method#2

    Another method would be to keep using sprites with one big frame with all the textures and select the sub-image of the texture with distort maps. When you load another texture all the tiles will be updated since they all reference the same texture.

    Here is an example:

    http://www.scirra.com/forum/rotating-sprites-from-a-spritesheet_topic56037_post349803.html#349803

    The pros of this method is only the vram of one texture is used.

    The con is you still have to deal with all the tiles on one image which could prove laborious to update a single tile.

    Method#3

    Use a different instance of a tiledBG object for each tile. Adding another tile at runtime is as simple as creating another instance and loading the texture.   Keeping the actual tiles as sprites you can select the texture by giving it the texture of one of the tiledBG instances using this plugin http://www.scirra.com/forum/plugin-texture-setter_topic43143.html.

    Here is an example:

    http://dl.dropbox.com/u/5426011/examples15/tiles_TextureSetter.zip

  • You can convert it to 0-360 like so:

    (Sprite.Bullet.AngleOfMotion + 360) % 360