Silent Cacophony's Forum Posts

  • Look for the Common Dialog object. For a quick test:

    • Start a new project
    • insert a CommonDialog and an EditBox into the layout
    • make two events in the event sheet like so:
    + System: Start of layout
    -> CommonDialog: Show open dialog
    + CommonDialog: File dialog: OK
    -> EditBox: Set text to CommonDialog.FirstSelectedFile[/code:8irsnubz]
    
    Note that you can do this without typing anything, if you haven't learned the finer points of Construct's interface. You can also do quite a bit more with this object.
    
    Anyway, the result is a string, and can be used in any other way as such.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [Edit]At last it's working, but I need to know something. Is there any Wildcard option (*) in Construct?

    I don't think that Construct has any regular expression support, but you can probably do make an acceptable function in Construct using the text processing functions shown here:

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

  • Hello.

    I don't have the registry key that you mention:

    "/HKEY_CURRENT_USER/Control Panel/Desktop/MuiCached/MachinePreferredUILanguages"

    The bold part is as far as I could go on that path.

    I do, however, have "\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Nls\Language\Default", mentioned earlier, which correctly has value 0409 for English.

    Also, I found "HKEY_CURRENT_USER\Control Panel\International", which had an item "sLanguage" with value "ENU" for U.S. English. I don't know if one can count on that being there for other machines.

    EDIT - I got a bit more curious about this, and tried it in Construct 0.99.84. I Created a new .cap, dropped a Registry and a Text object in it, and it works. Here is the one event that I used 'copied as text' using Construct:

    + System: Start of layout
    -> Registry: Open key "SYSTEM\\ControlSet001\\Control\\Nls\\Language" under root HKEY_LOCAL_MAHCINE
    -> Text: Set text to "Language code is " & Registry.ReadString("Default")[/code:2s6rxsh0]
    
    This displays 0409 for me (US English.)
    
    Note that the backslashes were 'escaped' using double backslashes, and the 'MAHCINE' is a typo in Construct.
  • Hi. The Else event should be on the same indentation level as the event that it's paired with. Yours is the first sub-event to 62 with that setup. You can drag it to the correct spot, directly lined up with 62, which can be a bit tricky at first if you don't do it often.

  • Hi. There is a simple error in your testing of the global variable:

    + orange_pistol_enemy2: Value 'Hit Count' Less or equal 0

    -> orange_pistol_enemy2: Destroy

    -> System: Set global variable 'enemy_choice' to random(2)

    -> player: Add 1 to 'Score'

    ...

    + System: global('enemy_choice') Equal to 1

    -> System: Create object orange_pistol_enemy2 on layer 1 at (random(3000), random(3000))

    + System: global('enemy_choice') Lower or equal 1

    -> System: Create object green_shotgun_enemy on layer 1 at (random (3000), random(3000))

    -> green_shotgun_enemy: Set speed to 200

    Random(2) will result in either zero or one. If it's zero, you'll get a shotgun enemy. if it's one, you'll get both enemies, because both are true on one.

    So, Lower or equal 1 should be Equal to 0, or possibly Lower than 1. In this case, I'd favor direct equality testing with Equal to 0.

  • Interesting info, R0J0hound. Thanks.

    I just taught my self python last week but as of yet not tried it with Construct. Objects rock in python.

    Can you do an example with the Python array in construct as a Cap file so I can see you you added them together?

    Well, I'm still learning, myself, so sorry if I got a bit scattered with my example... Here's an example of some ways to integrate Python into something like the original example:

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

    It just shows different ways to access objects using a combination of Construct events and Python scripting. The example also lets you modify the values on the fly by editing the EditBox widgets in the upper left. It can get a bit complicated in some cases, especially when picking is involved. Best to stick with Construct actions when you need to pick.

    It should be noted that all objects in the layout have corresponding objects accessible through Python as well. I made a recent thread with a little utility that lets you mess around with objects interactively through Python, here:

    You can drop an object in the layout, and run it, then interact with it.

  • Oooh, Python integration...

    There are numerous other ways to do such a thing, as well. For example, you can use a python list as an array. Here is a variation of the above, which will automatically set the Construct Array size, if you add or remove elements in x:

    + System: Start of layout

    x = [5, 3, 3, 1, "No", "Yes"]
    Array.SetSize(len(x), 1, 1)
    for index, value in enumerate(x):
       Array.SetAtX(index + 1, value)[/code:26ee4b3r]
    
    + System: Always (every tick)
    -> Text: Set text to Array (1)
    
    No real error checking, though...
  • Works fine for me in 0.99.84.

    That's pretty cool.

  • Sounds like an odd problem. The only thing I thought of to add is that I'd try deleting any and all .persist files in the folder those projects are in. Sometimes they make Construct a bit wonky.

  • Hi. The reason that 1 is being constantly added to one variable is that you have the Random Var group of events executing every tick, instead of as a sub-event of the TreasureChest group. If you drag the Random Var group up to the bottom of the shaded area under event 47, it should indent the group to the right a bit, making it a sub-group. Then it will only execute when a chest is touched.

    Also, it should be noted that the global variables are being incremented each time that group is executed, so the Var Gold event and the other 3 like it will not work properly after the first time that their respective variables are incremented, because they are checking for a value of one.

    One way to remedy that is to set the global variables to 1, instead of adding to them, but you'd still have to set them back to zero after the action is taken on them, or you'd end up with the same problem as you have now, basically.

    From what i can see of the event sheet, it looks to me like you may not need the global variables at all. you could just move the actions taken in event 52 to the actions for event 48, and so on for the rest.

  • While using an expression would be nice if you have a large number of variables to work with, I'm not able to get Construct to allow me to do that...

    Anyway, simple conditional statements would be fine in most cases. Here's a quick .cap with an example (made with v0.99.84): Random Global

    Also, here is a good page of the wiki to know of, if you don't:

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

    It explains things like the Random() function.

  • My understanding of the GPL is a bit murky, but I think that as long as the cost is reasonable, and the source code is included or made easily available, it's legal do distribute works for a fee. That said, I don't know about auctioning. And it seems that the source code is not included...

    I take issue with the renaming of the program, which is certainly questionable in my book. It's probably the only modification made, but certainly is a modification, and makes it subject to Copyleft. All of the screen shots show 'Game Creator' in the titlebar instead of 'Construct'.

    It's certainly shitty in my book as well.

  • EDIT:

    5/01/10 - Updated the screen shot and attachment with an improved version.

    5/02/10 - Updated again with a few minor bug fixes and features. See my next posts for details.

    Hello. I've been messing a bit with Construct for the past few weeks, and I was happy to see that Construct supported Python scripting. I've always wanted to learn Python, but never had a compelling reason to do so until now, so I've spent the last couple of weeks learning Python.

    I must say, I really like this language. It's been ages since I've programmed anything, and I've never used object-oriented programming, but I've found it quite easy to learn Python and OOP so far. My previous programming experience is quite dusty (from Commodore Amiga era) in ASM, Basic, C, and ARexx.

    I've had a hard time figuring out how to use Construct objects from Python scripts, so I had an idea for getting some info on them. I created a simple interactive shell from which I could query object attributes and methods, and also interact with Construct objects step-by-step. It's also o.k. for just messing around with Python interactively, but not quite as nicely as Python's own IDLE shell.

    Anyway, I thought I'd post this in the event that it may be helpful to one of the other Python users some time. Here's a screen shot that shows a sample of usage:

    http://dl.dropbox.com/u/5868916/PyShell.jpg

    I've found the dir() and help() commands quite helpful, and if you re-size/move things a bit, you can plop Construct objects in there and play with them through Python, too. It's not as useful as it could be as a plugin of some sort, maybe, but it's helpful as a simple tool. Usage is pretty straightforward, I think.

    Cap is attached for download.

  • I don't have a problem with them in theory, but in practice I'm finding them all over the place. Places that I don't and haven't had .caps, even... like root level on the drive.

    Anyway, I've found that all of mine are identical, so I don't really see a benefit for me.

    I suppose either the ability to turn them off or to specify where to put all of them would be preferable, though.

  • Hi. I took a look at that cap. I can't think of a better way to do what you are trying to do, but I do know how to make it work.

    I noticed that if I take the while out of the Start of Layout it runs fine but I do not want this using up resources.

    Actually, it will only run once if you take the while out, so sometimes it would be placed incorrectly.

    Anyway, I've noticed before that While doesn't act as I would expect. If you replace While with Repeat 1000 times it will work. It does not hurt to specify so many iterations, because once the overlapping condition is done, Construct will move on and not see that event again...

    + System: Start of layout
      + System: Repeat 1000 times
      + TreasureSprite: TreasureSprite overlaps BoundtySprite
        -> TreasureSprite: Set position to Random(640), Random(480)[/code:1jbp0dm5]
    
    [b]EDIT -[/b] I might add, if the island in your main cap presents a small target for the random number generator, you should probably specify a significantly larger Repeat number in order to make sure to hit it.