Wastrel's Forum Posts

  • SullyTheStrange: that's the very the reason I started working on this. :D

    rexrainbow: Are you saying to not have a condition, but to only have the "Start to scan key" as an action, then capture off of that? I was thinking having Capture key as a top level condition might be too restrictive.

    I must have missed your MP plug-ins before. Are they actually extending the existing plug-ins? I had wanted to do that with the Keyboard plug-in and just add the capture function. I will check them out.

    I will also take a look at moving the capture function down to the action level.

    Thanks!

  • <font color=red>This plug-in has been removed. It is no longer necessary, due to the addition of key code functionality to the built-in keyboard plug-in.

    If you require a copy of the plug-in to be able to open a project, PM me. Otherwise, please use the built-in keyboard plug-in.</font>

    <font size="4">Plug-in: KeyCode</font>

    Capture key from keyboard and return hardware scan code, Unicode code, and Unicode character.

    Installation

    • Extract the contents of the zip file into \Construct2\exporters\html5\plugins
    • Folder name: wastrel_keycode

    Features

    • Capture the hardware scan code and the Unicode code/character for a key from the keyboard

    Usage

    <font face="Courier New, Courier, mono">- <font color=red>(DEPRECATED) KeyCode -> Capture key : System -> Set value {variable} = KeyCode.Code</font>

    • KeyCode -> Capture key : System -> Set value {variable} = KeyCode.ScanCode
    • KeyCode -> Capture key : System -> Set value {variable} = KeyCode.UnicodeCode
    • KeyCode -> Capture key : System -> Set value {variable} = KeyCode.UnicodeChar
    • {Some/empty condition} : Start capture
    • {Some/empty condition} : End capture</font>

    Conditions

    • Capture key: Captures the next keystroke from the keyboard and places the hardware scan code into the ScanCode expression; the Unicode code into the UnicodeCode expression; and the Unicode character into the UnicodeChar expression. Use System -> Set value to set a variable to the key code value. The Capture key condition is enabled using the Start capture action, and is disabled with the End capture action.

    Actions

    • Start capture: Enables the Capture key condition to capture the next keystroke. Capture key will continue to capture keystrokes until End capture is called. Generally, Start capture will be called with a specific condition (e.g button press) to capture one keystroke (e.g. to set key mappings). Start capture can also be called using an event with an empty condition, for continuous key captures.
    • End capture: Disables the Capture key condition.

    Expressions

    • <font color=red>(DEPRECATED) Code: An integer value which contains the key scan code, set by the Capture key condition. Default = 0.</font>
    • ScanCode: An integer value which contains the key scan code, set by the Capture key condition. Default = 0.
    • UnicodeCode: An integer value which contains the Unicode code, set by the Capture key condition. Default = 0.
    • UnicodeChar: A string value which contains the Unicode character, set by the Capture key condition.

    Examples

  • Wastrel: 0 AND 0 is 0, not 1! Otherwise, good table :)

    Then my table is neither truthful NOR logical! <img src="smileys/smiley4.gif" border="0" align="middle" />

  • To expand upon newt's response, it is a logical operator, in the same vein as AND and OR. Here is a hastily constructed truth table:

    | p | q || p AND q | p OR q | p XOR q

    ------------------------------------

    | 0 | 0 ||    1    |    0   |    0

    | 0 | 1 ||    0    |    1   |    1

    | 1 | 0 ||    0    |    1   |    1

    | 1 | 1 ||    1    |    1   |    0

    Basically, XOR says if either p OR q is true, but not both, then the result is true, otherwise it's false.

    EDIT: newt already updated his post with a link, and i forgot the forum is displayed in non-fixed font, so blah

  • I agree with the idea of a market place for assets (sprites, animations, audio, etc.). I do, however, see a problem with a template market: support.

    Say I want a tower defense template, so I pay $10 and get the template. Now I want to make some changes because, being a generic template, it's not exactly what I need. Since I didn't code it, and it can be assumed I don't know how to code it since I had to buy it, will the developer provide the kind of support I need to add features, change logic, etc?

    I know many of the developers here offer free help now on the examples and plugins they've made, and I know a lot of them would feel compelled to offer support on something they've sold, but how much and for how long?

    If you look at it from the reverse point of view, I'm a developer who made a template that I am selling for $10. But now, since money has been exchanged, I am expected to support that template. Bug fixes are one thing, but what about modifications? How will I be able to work on my own games or create new templates if I am continually being asked to make modifications to my original template?

    This is just my opinion, but I can see how that might spiral quickly out of control.

  • I have been trying to capture a player-pressed key from the keyboard, for the purpose of allowing the player to select their desired key-mappings in a game. I tried searching the forums, but only found references in the CC sections.

    I imagine something working with the Keyboard plug-in, using the OnAnyKeyPressed condition, then setting a variable (global, local, or instance) to either the ASCII code or the keyboard scan code. I would imagine the scan code would be more useful, so that non-alpha keys could be mapped.

    Something like: On Keyboard.OnAnyKeypressed --> varKeyPressed = Keyboard.KeyPressed.

    Unless I am missing something, this functionality doesn't exist. I was wondering if this was intentional due to some technical reason, or if it just hasn't been addressed yet.

    Has anyone figured out a work-around, or created a plug-in for this?

    Thanks!

  • I agree, it doesn't seem like it should be that way. I just assumed it was that way for reason and never questioned it. <img src="smileys/smiley24.gif" border="0" align="middle" />

  • I might be misunderstanding what you are saying in your first post, but if you wrap the global or local variable with int(), then it accepts the value, i.e. unit.targettedby = int(value).

    As far as I know, it has always worked like this in C2. At least, that's how I have always had to do it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ize

    I would also like to see a capx.

    Cool game! I just wanted to point out that on your second opening screen, the word "Construct" is missing the "s". I really like that opening credit anyway! :D

  • It's working fine for me also, on older projects, and new ones.

    Windows 7 x64

  • Run's very smoothly on Windows 7, Chrome 14 (haven't updated yet).

    Nice, original concept. My only complaint (which has to do more with the web platform than your game) is that on the higher levels, when i was thrashing the mouse around to keep up, the cursor kept moving out of the game window. Maybe an option to go to full screen would help with that.

  • Magistross, do you have a quick example you could post showing how to use this plugin?

  • No crashes when saving or previewing.

    C2 r64, 64-bit

    Windows 7 Enterprise, 64-bit

    Chrome 14/15

    IE9, 32-bit and 64-bit

  • I was working on my entry, but a project at work hit a bad road-block and I had to spend all of my time working on that. :-< Very frustrating.

    All of the entries look great. Good luck everyone!

  • Nice job, Nickydude!