Keyboard movement

  • #1, by GLindstenTuesday, 23. April 2013, 06:41 11 years ago
    Hey! Is it possible to control character movement with the keyboard?

    Newbie

    1 Posts


  • #2, by afrlmeTuesday, 23. April 2013, 13:43 11 years ago
    technically, I don't see why not.

    but having said that; currently it would be a lot of work & you wouldn't be able to control a character (the walk cycle animation would be stuck at the first frame, as the walk cycle currently resets when you click to a new position - which is what you would be constantly doing by holding down a key)

    you could use an object animation in a scene - but I wouldn't recommend that either as it won't pay any attention the way borders or paths etc.

    I would like to see actual keyboard input & gamepad input added myself as it would allow people to make games in same style as tell tale games - if they (really) wanted to. (I think it can be added as both keyboard & joystick/gamepad support are in the new sdl2 lib file - but I don't know if David or Alex would want to add this feature or not)

    Imperator

    7278 Posts

  • #3, by SimonSThursday, 25. April 2013, 16:27 11 years ago
    You can do that by doing something like (without getting stuck in the first frame, put this into the action called by pressing Cursor Left):

    if not started then //this is for not getting stuck in the first frame
    local point=getObject("Game.GameCurrentCharacter"):getPoint(VCharacterPosition)
    point.x=0
    getObject("Game.GameCurrentCharacter"):setValue(VCharacterDestination,point)
    started=true
    end
    


    And for Cursor Left Up, you need to stop the character by an action part:

    started=false
    


    This works incredibly good for most scenarios because the character is finding its way on its own and you don't need to do jump'n'run. You can do the other directions in the same way just by modifying point.x=0 (for up point.y=1080 or your screen height, for right point.x= your screen width, for down point.y=0). A bit tricky is moving down left or up left or something like this. In that case you need to remember the current direction and combine these like this point.x = 0 and point.y = 0 and it should work.

    Thread Captain

    1581 Posts

  • #4, by afrlmeThursday, 25. April 2013, 16:49 11 years ago
    ahh I see what you did there - took me a minute or two to visualize in my head, but quite obvious really. smile

    as for the diagonals .- you could use values & or conditions & some if else queries for checking which keys are pressed. (would be much easier if we could check with Lua (you can check values/conditions but key input hasn't been added to the data structure yet - will speak to David about it as it would be nice to add)

    P.S: you could create a function for the user to enter the max scene width & height (not all scenes may be created at game resolution size)

    Imperator

    7278 Posts

  • #5, by gustyThursday, 25. April 2013, 18:54 11 years ago
    Well, there is a thing - do we really need a keybord controls for adventure games? I mean it's cool if you have that option as a developer, but come on, it's called "point and click adventure game" and I of course played Grim Fandango and I enjoyed it. But anyway with today's tablets and stuff and finger-click controls things, - again - do we really need a keybord controls for adventure games?

    Forum Fan

    159 Posts

  • #6, by afrlmeThursday, 25. April 2013, 19:05 11 years ago
    er nope, but a gamepad would be nice for creating tell tale style games (when the 2.5D finally gets implemented - would also be nice if XBLA support was added as an optional export/build option - not that I see it happening any time soon - or at all for that matter)

    you could use keyboard movement as a mini-game maybe?

    Imperator

    7278 Posts

  • #7, by SimonSThursday, 25. April 2013, 19:52 11 years ago
    having some options on keyboard is always a nice addition. for example space for snoop animations and escape for skipping cutscene, but i agree that movement with arrows is not a high praised feature for this genre.

    XBLA support will not come, i'm really sure. it's a really closed-off platform, even more than iOS.

    Thread Captain

    1581 Posts

  • #8, by afrlmeThursday, 25. April 2013, 20:15 11 years ago
    having some options on keyboard is always a nice addition. for example space for snoop animations and escape for skipping cutscene, but i agree that movement with arrows is not a high praised feature for this genre.

    XBLA support will not come, i'm really sure. it's a really closed-off platform, even more than iOS.


    we've got an updated lib file for key input on the new builds, not sure what's being done with it though (David said should be possible to add true key input with it; typing in character names or for puzzles etc)

    in regards to XBLA - I know (shame)

    Imperator

    7278 Posts