R0J0hound's Recent Forum Activity

  • Sorry, I don't login too much and I miss many posts.

    For the first Q you're talking about an object casting shadow and being visible when lit, right? One idea that comes to mind would be to only cast edges facing away from a source. Although it wouldn't work great for concave objects.

    For a texture underneath you could reduce the opacity of the gradient sprites. I don't entirely recall what the example does so I'd have to tinker with it. Another idea would be to reduce the opacity of the color fill.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'd just use the uid instead of iid and uid. Here's a way to rework event 190 to stop creation of duplicates. The else is run only when there are no arrows paired with a pickup.

    +circleBounds: on collision with BoxPickups

    +For each BoxPickups

    ---+ArrGd: ThnUd = BoxPickups.uid

    ------ //nothing

    ---+Else

    ------- //your creation actions

  • Hello,

    For this:

    for(i=0;i<10;i++)

    {

    printf(i);

    }

    The equivalent in C2 would be this:

    for "" from 0 to 9    

    ----Textbox set text to loopindex

    Or if you want a named loop variable:

    for "i" from 0 to 9    

    ----Textbox set text to loopindex("i")

    Lastly your initial event setup in your first post would look like this in c:

    int i;

    for(int loopindex=i; loopindex<=10; ++loopindex)

    {

    ++i;

    break;

    }

    -cheers

  • The action equivilent of the script is a combo select, so in python you would use a integer index. 0 for the first resource, 1 for the second and so on. To use a filename you'll have to use "play from file" and have the files alongside your exe.

    You could alternatively use the resource plugin to avoid integers.

  • Since C2 has a visual editor I'd recommend putting a barkeep at each bar and making them all invisible except for one at a time. That way it's easier to tweak the barkeeps position rather than adjusting numbers manually. For the bar top/start/end you could again just use the editor to position the bars and use expressions. Another way would be to store the bar info in instance variables for each barkeep, if you prefer numbers.

    Oddly enough the C2 events will be practically the same as C.

    Here's a wip capx to pick apart:

    https://dl.dropboxusercontent.com/u/5426011/examples18/tapper_ex.capx

    It uses a container so each barkeep will be picked with it's respective bar. It also uses the bullet behavior to handle the mug motion, although you could do it straight with events if you wanted.

  • What i did is when creating the list of possible moves i stored the direction back to the previous move position. My capx kind of obscures the idea so here's a general idea of what I did.

    Here's some ascii art to show the map and perhaps what values could be in the array. Note: i didn't use these values in my capx.

    key:

    . is empty

    # is a wall

    p is a player

    .....
    .##..
    ..#p.
    .....
    

    So that's the map.

    Next I marked the moves. The numbers show the distance away from the starting location.

    .4323
    .##12
    .4#01
    43212
    

    I think you already solved this one but here's my pseudo code for how i generated this.

    mark the players position as 0
    for i from 0 to 3
       loop though all positions marked with i
          for the four positions around each
             if it doesn't have a value and it's not a wall then
                set it's value to i+1
                set it's dir to the direction from the position with value i.
    

    So here is what the dirs could look like. There can be multiple paths with the same distance, but only one will be arbitrarily chosen.

    .<<^>
    .##^>
    .v#p>
    <<<vv
    

    In my code I used 0-3 instead so I could just multiply it by 90 and get an actual direction.

    The backtracking is then just a matter of:

    1 Starting a the destination

    2 look up the direction at the current position.

    3 save direction to a list.

    4 follow direction backward one spot

    5 If current position isn't the starting position then repeat at 2

    Hope that helps a bit to show what I was doing... It may just be noise though.

  • delgado

    The only thing that stands out would be event 11. Change the "repeat 5" condition to the dimension of your letter grid. Ex. 6x6 use "repeat 6", 10x10 use "repeat 10".

  • Events are faster than python. Mainly because of the interpreter warmup and overhead to call actions and expressions from python. The difference only matters if it's done every frame. One time stuff like this is fine and you get the benefit of easy code reuse for other caps.

    Here's a reason why your code isn't working.

    Create and spawn actions take a string for the object name. So instead of:

    Cell1.SpawnObject(WallUp, 6, 0)

    use

    Cell1.SpawnObject('WallUp', 6, 0)

  • You can access the last created instance with:

    SOL.txt_option[0]

    But this won't help if you create multiple instances at once.

    You could make a function like this to return a reference to a newly created object, then you could store the references in a list or something.

    def my_create(name, layer, x, y):
        System.Create(name,layer,x,y)
        return eval("SOL."+name+"[0]")
  • ghost

    This plugin is faster when using webgl. With canvas2d it's the same speed as the canvas plugin.

  • Paster 0.5

    Here's a new plugin that is like the canvas plugin in that you can draw (or paste) other objects onto it's texture. It's simpler though and doesn't have any additional drawing features. The big difference is this plugin cleanly uses webgl and allows pasting objects with effects.

    Actions:

    • Paste object
    • Set resolution
    • clear with color
    • Draw Quad

    Key features:

    • Works fast with canvas2d and webgl, without the slowdown the canvas plugin had.
    • Paste objects with webgl effects applied.

    As a side note it's labeled as alpha since the effect rendering isn't complete yet so there are cases where effects aren't drawn right. Also the eventual plan is to merge the webgl fixes back to the canvas plugin, but I'll need to come up with ways to replicate all it's features in just webgl.

    Download:

    https://app.box.com/s/rqwa6kjgttz777wyl7fxvmrv5tiozsj8

  • I made some progress with using webgl in plugins today. For instance here is a progressive blur.

    <img src="https://dl.dropboxusercontent.com/u/5426011/export/blur/images/screen.jpg" border="0">

    https://dl.dropboxusercontent.com/u/5426011/export/blur/index.html

    It's a start but it's not usable yet.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound