Silent Cacophony's Forum Posts

  • Hi. The code is original, but the ideas are not. For instance, the 'scoring' system for room placement has surely been done before. I'm unsure if the way that I connect rooms has been done like I have done it. It's just what I came up with when I thought of how I'd do it with Construct, and was originally based upon Construct's easy random picking conditions that were used in the prototype.

    I did do quite a bit of research on roguelikes a few years ago, but never got around to starting one back then. Here are a couple of sites that I would recommend checking out:

    http://roguebasin.roguelikedevelopment. ... =Main_Page

    http://www.roguetemple.com/

    I haven't had time to look this one over much, but it looks quite promising:

    http://pcg.wikidot.com/

    And if you can do newsgroups while avoiding the ridiculous spam, I'd recommend the roguelike development one. Here's Google's version of it (horribly spammed):

    http://groups.google.com/group/rec.game ... ent/topics

    I'll be slowly working on mine and posting new examples as I go, but it seems that I'll never have the time I would like to work on it.

    Good luck!

  • Ach. Recursive functions make my head hurt a bit. Other than that, this is pretty cool

    It took me about 10 minutes of staring at that code to figure out how the imageFont object placement worked... And I had no idea about how SetImageOffset can be used like this. Nice.

    I did notice a problem, though. For some reason, 'imageFont: Destroy' does not seem to be working, and the debugger shows a couple thousand objects by the time the message is fully displayed, and the number keeps quickly rising beyond that.

  • Quite nice! I've got to look into ctypes. I really like the zipped dependencies, too.

    I will surely find use for this. Thanks for sharing.

  • Assuming basic platform behavior, I'd do it something like so:

    + MouseKeyboard: On key Control pressed
    -> Charakter: Spawn object Ammo on layer 1 (image point 1)
        + MouseKeyboard: Key Down arrow is down
        -> Ammo: Rotate 45 degrees toward (Charakter.X, Charakter.Y + 100)
        -> Ammo: Set angle to Charakter.Angle + (Charakter.Angle = 0? 45 : -45)
        + System: Else
        + MouseKeyboard: Key Up arrow is down
        -> Ammo: Rotate 45 degrees toward (Charakter.X, Charakter.Y - 100)
        -> Ammo: Set angle to Charakter.Angle + (Charakter.Angle = 0? -45 : 45)[/code:fcer37nn]
    
    I used two different methods to set the angle there, but one is toggled off. The first just rotates the bullet 45 degrees toward a point above or below the character, and the second uses a [url=http://sourceforge.net/apps/mediawiki/construct/index.php?title=Expressions]conditional expression[/url] to set the angle either + or - 45 degrees from the character's angle.
    
    Here's the simple .cap file (v0.99.96) if the above is not clear: 
    
    [url=http://dl.dropbox.com/u/5868916/angledshot.cap]http://dl.dropbox.com/u/5868916/angledshot.cap[/url]
    
    .
  • I also dislike subforums, in general. They have their place in certain circumstances, but should be used sparingly, I think.

    I think that Ashley's proposed organization sounds fine. The "Your Tutorials & Example files" might get a bit cluttered, but I don't think it would be too bad. It would tend to make a logical grouping for many of the posts in those forums.

  • File -> Preferences.

    It has options for auto-saving, and making auto-backups of normal saves.

    I'm not a big fan of auto-save features, but I'd recommend setting at least 3 auto-backups.

    I keep 5 auto-backups, and routinely increment the version number on the end of the file name when I make a significant addition or change. This results in a lot of backups, but can often come in handy. Even if it's not a corrupted file that screws you, imagine that you tried to make a significant change that doesn't work out well... You can always roll it back to undo your mistake.

  • Very nice! I had no idea about that font.

    It was quite horrible too look at without that font installed.

    Thanks for the info

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is a simple high score method:

    http://dl.dropbox.com/u/5868916/gbmscore.cap

    I just made some simple calculations on the position of the gbm every tick, using Sprite3.Top as ground coordinate, and offsetting for the centered hotspot of the gbm. It's not exact if the sprite is sideways, but it would likely be overkill to nitpick that.

    The black bars were adjusted to be centered 500 pixels from top of the ground sprite, and each other, and that represents 10m, hence the '/ 50' in the arithmetic.

    The highest point is determined by comparison between two variables. A fairly common method that one might employ in such a situation.

  • Glad you guys liked it. I'll likely be posting further examples and updates occasionally in this thread, as I continue my work on making a roguelike game.

    My next steps will probably be to make a Dungeon class to contain the levels, with a way to connect the levels to each other, and getting a character moving around within it. Not very difficult stuff, but my time is more limited than I'd like these days. Things like filling the dungeon with random stuff and creatures will follow, here.

    I'll also likely be cross-posting this project across different threads later, as I get to field-of-vision and line-of-sight examples, and other different topics that will crop up with it.

  • Steven solved the logic problem nicely with the check for being 'active', but on my machine, there is a different problem that remains:

    + Sprite2: On collision between Sprite2 and Sprite2

    That causes somewhat random crashes on my machine. Construct has no good way to differentiate between the two different instances of Sprite2 there, and it seems to cause problems.

    In the event that you've not had to deal with such a problem before, I'll discuss a common way to deal with it.

    The easy way to deal with needing to pick two different instances of the same object in the same event is to add that object into a family (let us use Blue family.) Here, if a Sprite2 is 'active' and has collided with any other Sprite2, the other Sprite2 is also set to 'active':

    + Sprite2: Value 'active' Equal to 1

    + Sprite2: On collision between Sprite2 and Blue

    -> Blue: Set 'active' to 1

    In this way, any actions performed upon Sprite2 within that event will only affect Sprite2 objects that have the 'active' var set and have collided with a Blue family member (which only contains Sprite2 objects here.) Any actions performed upon Blue in that event will only affect the Blue member that was collided with by the aforementioned Sprite2 object.

  • I can't think of a reasonable way to make an editbox accept only numbers, without using Python. So, here's a way with Python:

    EditBox: On text changed

    if len(EditBox.Text) > 0 and not EditBox.Text.isdigit():
    	EditBox.Undo()
    EditBox.ClearUndo()[/code:1au5r3n3]
    
    The python script would just be indented within the 'On text changed' condition. This makes use of, and basically takes away from the user, the ability to undo changes in the Editbox.
  • Well, it's quite a bit later than I expected, but I finally got some time to rewrite this thing in Python. It's a fairly straight conversion of the prototype version, with a simple slider-driven interface wrapped around it to demonstrate it's possible usage.

    The sliders were given private variables with reasonable ranges for the parameters, which can be changed in the layout editor if need be. The actual acceptable limits of the parameters are commented upon in the script, and are not checked by it. The user should handle making sure that the parameters are within range.

    I'm uploading two files. Each has the same script defining the classes, but each uses it in a slightly different way. The first one keeps things simple and uses a Text object to display the level, and the second one uses a method to copy the level data into a Construct Array, and uses a Canvas object to display the Array data.

    Requires Construct v0.99.95 or newer. Attachments are below:

  • [quote:32womvdf]you might be able to save sometime by using a dictionary

    That's probably a good idea. Could this be used to substitute for an array? I wouldn't be using it to save the game, but it would store values with 3 keys (ex. (x,y,z) or (1,2,1)).

    Though it's a bit irregular, a dictionary using tuples as keys can be used as a sort of multi-dimensional array. Also, a dict's get() and setdefault() methods can provide easy handling of cases where keys are not there yet. Here's a simple example:

    http://www.daniweb.com/code/snippet275835.html

    With that pointed out, I'd just use lists in most cases.

    [quote:32womvdf]Edit: Is there a limitation on how many lines of script you can have?

    I got up to 65 and nothing after line 65 gets executed.

    I've got a few scripts well longer than that, with no problems.

  • Some additional info:

    [quote:28x1cczu]I assume XAudio2 is the default name of the XAudio2 object when you first add it in, which can be renamed.

    This is true with any object in Construct. If you build expressions by point-and-click, the proper name will always be used, but you can also just type in expressions if you are familiar with the syntax, in which case you must type the proper name.

    Also, one of the pages that I find most useful in the wiki is on the System Object:

    http://sourceforge.net/apps/mediawiki/c ... tem_Object

    It can provide some insight on what Construct considers conditions, actions, and expressions to be, and how to use the many general purpose ones provided by the System Object.

    It should also be noted that you can access any condition, action, and expression through the mouse-driven interface, sometimes with minor editing of their arguments.

  • Regarding your first question, most any action that lets you set a given property of an object has an expression counterpart that lets you read the current value. In this case, you can simply increment or decrement the current value by a given amount.

    This would increase channel 1 volume and decrease the master volume:

    + On whatever triggers a volume change

    -> XAudio2: Set channel 1 volume to XAudio2.Volume(1) + 1 dB

    -> XAudio2: Set master volume to XAudio2.MasterVolume - 1

    I don't know about the second question.