00Rez's Forum Posts

  • For some reason when I change the radius, nothing happens. Any ideas why?

    Oh, and I got it working with your last posts :)

    How and what are you setting the radius to?

  • Can you upload ready example for download?

    I've uploaded this as a behavior in the plugin section for c2 it includes the plugin and example file:

    Grid based sight behavior

  • You can use the Sight behavior expression Tilesize to get the Sight's tilesize which you can also set in the behavior properties. You can use this for cell based calculations e.g.:

    round(Mouse.X/Player.Sight.Tilesize) * Player.Sight.Tilesize

    Grid expressions:

    Sight: Grid

    O Height: Get the height in cells of the field of view grid.

    O Offset: (used but not useful I think)

    O Radius: Get the sight radius.

    O Tilesize: Get the grids tilesize.

    O Width: Get the width in cells of the field of view grid.

  • Actually, in the actual program, the dirt is 32x32. About the destination out, in the demo project, its set to XOR. Your talking about the LightCell, right?

    Anyways, I fixed what you told me to fix, and it still doesn't work...

    Problem, Again

    Ok sorry about that must have been zoomed out or something. Anyway I forgot to mention you need to set the for loop to seen rather than hidden this will sort out the opacity issue. Using hidden is inverted, so the cells' opacity are full or invisible, which is why it shows nothing. Before changing anything Toggle disable the opacity setter and preview this will show the LightCells that are created so you will get a better idea of how it works! One last thing is due to the whole grid based approach it's best to have everything snapped to the grid of whatever tilesize you are using in your case 32 pixels. This can be set in the properties of the Sight behavior and set with the snap to feature in construct!

    I hope this helps Bowiz <img src="smileys/smiley2.gif" border="0" align="middle">

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • great example. Thanks for posting it

    Thanks! I did this in the general forum for someone so I thought I'd stick it in here to show everyone. Seems like a more logical place to be... <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Hi,

    Just thought I'd stick this in here for everyone. Name says it all.

    Nearest instance example <img src="smileys/smiley1.gif" border="0" align="middle">

  • >

    > > Hey 00Rez. I've been playing with behaviour, but I can't quite get it to work. Could you have a look at where I could have been going wrong?

    > >

    > > dl.dropbox.com/u/1378330/gridProblem.capx

    > >

    > > The pertinent events are in the "Terrain" and "Player" event sheets I believe.

    >

    > I'm getting a check failure when I try to open I'm using the latest [r61]

    Hey 00Rez. Reuploaded.

    Fixed to what you need (I think.) I've noticed a rounding problem my end which I'll have to fix. Anyways, when you have a for loop for the sight you *must* use the CurPixelX/Y or CurGridX/Y on both sides to pull and place the correct values! Hope this makes sense! Another thing is this is grid based therefore all objects must be in divisions/multiples of whatever the tilesize is which is 32 in your case. I noticed you had an offset of 300 which placed the generated tiles wrong. I set this to 320 and this fixed it. When you check sight and choose "in pixels" all this means is the plugin works out the grid position for you.

    Hope this helps Cowtrix! Nice demo by the way!

    Fixed version

  • Hey 00Rez. I've been playing with behaviour, but I can't quite get it to work. Could you have a look at where I could have been going wrong?

    http://dl.dropbox.com/u/1378330/gridProblem.capx

    The pertinent events are in the "Terrain" and "Player" event sheets I believe.

    I'm getting a check failure when I try to open I'm using the latest [r61]

  • I also have a problem Rez, no light is appearing at all!

    My Problem

    Changing the lightcell to XOR doesn't make a difference.

    It seems you got x,x instead of x,y. I'll let you figure that one out and the shadow object effect needs to be set to "destination out."

    One last thing if you select an object with the Sight behavior attached make sure you look at the properties on the left hand side because you set the tile size, the default is 32 pixels which means usually to keep all objects at no more than 32x32 pixels or whatever (just a recommendation). I noticed your dirt object is 16x16 which would probably look weird.

  • I know the question is aimed at Rez, but I was a bit in the same situation. I didn't know much about JS (but I knew other languages: VB, notions of C/C++, PHP, Lua/python) and found JS quite straight forward to get into.

    Especially in the goal of plugin developpement for C2, Ashley made an awesome SDK with links to JS guides and references and from there it was almost like "follow the guide".

    In the end, I found it pretty easy and fun to developp plugin or behavior for C2 even if sometimes you will encounter your fair share of headaches, but that's what dev is about in my experience <img src="smileys/smiley1.gif" border="0" align="middle">

    Thanks for answering for me Kyatric, appreciate it!

    On another subject I'm currently incorporating pathfinding into my behavior. You had any luck with a method of smooth movement? I can have it move easily with 'set position' but thats a bit crap looking. I've made it so you can find or move to the previous, current and next position in the path list by using a position counter which as a behavior works perfectly.

    Finally, does anyone here play Dark Souls!?

  • Rez, that is really cool. I haven't played with it yet, so this may be obvious, but can the LightCell be any shape and color, or does it need to be a black square.

    Also, please develop a game using DrunkGuy. I would play that game! :D

    Seeing all of these new behaviors is really giving me the itch to start making my own plug-ins. I do know some JavaScript, although it's mostly been for one-off admin tasks at work. Did you find it easy to figure out?

    Haha yeah the lightcell can be anything its just a way of showing a "seen" cell. The basics of javascript are easy I've come from C#/Python/LUA/GameMaker/a few other programming side of things. I'm not massively great at programming although I love it. The plugin system Ashley has designed is really good, just use the latest Firefox with the Firebug add-on. This will help alot. If you get stuck I create an alert, assert2 (as Ashley does) or even an expression so you can return a value you want to check out. When I design a plugin such as a "container" or inventory behavior I found I could use parts of the storage plugin to save the contents of the container/inventory. Can't wait for Families then I can make a fully functional item system...

    Believe you me it does click eventually!

    Anyway thanks for the feedback Wastrel.

  • Thank you! This looks AWESOME! Will be very helpful in creating nice games =)))

    Thanks! Looking forward to a dedicated section for plugins/behaviors, not good in here because it falls behind and no one sees it... <img src="smileys/smiley5.gif" border="0" align="middle" />

  • Just realized when using the "for each cell" actions and then checking each of these cells using the check cell condition you MUST use the expressions which have "Cur" at the start to get the correct coordinates. If you look at the example it shows the expressions to use. I think this might confuse people to how it works because it actually confused me at one point!

    Anyway, I'm currently in the process of incorporating pathfinding into this plugin! Demo soon. The pathfinding keeps track of the position in a path to which you can access the current, previous or next position and also move to the previous or next position. This seems to make showing/keeping track of the movement easier.

    Currently I'm having issues with enemies overlapping each other, if anyone has any ideas to stop this I'd be very welcome to hear them!

    • Rez
  • How strange.. what browser do you use? I have a feeling this has something to do with the strict mode.

    Firefox 6.0.2

  • Download my plugin here.

    Extract the behavior to the normal folder.

    Run my example project (this isn't some self promotion!).

    Select a tree.

    Add the Physics behavior and set the immovable property to true.

    In the project pane on the right select the tree so it selects all trees.

    Set the Physics immovable to true.

    Now, select the drunk guy and add Physics to his behaviors.

    Run project.

    Clicking ignore works. It ignores a few times then runs the project.

    Is this something to do with my behavior? Hope this helps! <img src="smileys/smiley5.gif" border="0" align="middle">