Welcome, Guest. Please login or register.

What openbor you prefer: Double dragon,battletoads or final fight !? by lirexpatrio
[December 07, 2012, 07:15:27 pm]


what are your favorite games OpenBOR?! by lirexpatrio
[December 07, 2012, 07:09:46 pm]


Post Some Awesome Videos by maxman
[December 07, 2012, 05:51:39 pm]


Can @cmd playmusic "aaaa" 1 also increse music sound ? by BeasTie
[December 07, 2012, 05:24:38 pm]


Streets of Rage: Silent Storm by mtrain
[December 07, 2012, 03:45:05 pm]


Site will be down for maintenance on 12/8/2012 thru 12/10/2012 by Damon Caskey
[December 07, 2012, 07:42:42 am]


Cancelled SOR 3d Remake by riccochet
[December 07, 2012, 03:58:33 am]


Dungeon Fighter: B.O.R. by msmalik681
[December 07, 2012, 03:24:27 am]


[TUTORIAL] How to create 4 Games of OpenBOR in 1 CD (650 MB) by magggas
[December 06, 2012, 09:46:25 pm]


custknife by Bloodbane
[December 06, 2012, 09:34:09 pm]


blockfx help by B.Kardi
[December 06, 2012, 04:09:14 pm]


street of age 4 hd by corradlo
[December 06, 2012, 01:41:36 pm]


ClaFan - Classic Fantasy ver 1.17 by soniczxblade
[December 06, 2012, 05:01:20 am]


Bug Archive by Bloodbane
[December 06, 2012, 02:00:44 am]


"Bio-Doom" and "Gears of Doom" by BulletBob
[December 05, 2012, 10:07:21 pm]


Contra Locked 'N' Loaded v2 by Bloodbane
[December 05, 2012, 09:39:43 pm]


Downloadable OpenBoR Manual by BeasTie
[December 05, 2012, 08:31:24 pm]


Having trouble testing changes by B.Kardi
[December 05, 2012, 03:05:53 pm]


DragonBall Absalon by msmalik681
[December 05, 2012, 02:52:13 pm]


[Hi-Res] Swamp by Vibrant
[December 05, 2012, 10:47:14 am]


  • Dot Guests: 71
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.



Author Topic: Script Access To Player Controls  (Read 291 times)

0 Members and 1 Guest are viewing this topic.

Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
Script Access To Player Controls
« on: February 02, 2012, 10:13:59 am »
Topic.

Two things that as far as I can tell are not really fesable at the moment are disabling player controls, and the classic "interface screw", as in reversing direction cotnrols, scrambling buttons, and so on. Both are common features of professional games.

The first can be sort of simulated with the noaicontrol flag, but that also disables physics control of the entity - which most of the time you still need. The second as far as I can tell isn't possible at all without scripting the entire control scheme from the ground up; way not worth the effort and I'm not even sure if it would work anyway.

What I thought might be to simply have variable for each input that can be set to override its default value (say, Direction UP becomes Direction RIGHT) or disable it outright with NULL or some such. Note I'm referring to the command input, not the actual button (IOW the UP key is still the UP key; you're only substituting what the engine does with it).

Thought of taking it on myself, but took a look at the control code and it promptly spun my head around. :laughing:

DC
« Last Edit: February 02, 2012, 10:22:58 am by Damon Caskey »
OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Script Access To Player Controls
« Reply #1 on: February 02, 2012, 09:05:40 pm »
I think you can change playkeys using changeplayerproperty in somewhere like update script,  thus the player control is also affected. But I never tried such stuff. Guess it may work in some way, but maybe something like freespeicial/run will not work as expected.

If you want to see how player controls are updated, you can check inputrefresh in openbor.c. But I made some change there a while back to buffer several steps of your inputs to simplify the freespecial and cancel logic, so it will be a bit more complex to fullly control them via a script now.
« Last Edit: February 02, 2012, 09:12:21 pm by utunnels »

Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
Re: Script Access To Player Controls
« Reply #2 on: February 03, 2012, 09:04:10 am »
I think you can change playkeys using changeplayerproperty in somewhere like update script,  thus the player control is also affected. But I never tried such stuff. Guess it may work in some way, but maybe something like freespeicial/run will not work as expected.

Tried this, it only works on press/release, which can be disabled with keyscripts anyway. It has no affect what so ever on holding the keys, meaning the player can still walk about and control midair motion.

DC
« Last Edit: February 03, 2012, 09:09:23 am by Damon Caskey »
OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Script Access To Player Controls
« Reply #3 on: February 03, 2012, 11:46:28 am »
I see.
So besides playkeys property, you probably need releasekeys, keys(those that are still being held) and newkeys(those newly registered).

But I've added some new properties, so things have become a bit more complex, they are inputtime, combostep and combokey. Inputtime and combokey are two arrays that store your recent inputs for freespecial.

And there are some related stuff such as bothkeys and bothnewkeys.

So instead of messing with getplayerproperty, a better solution is adding a new script function that only mimics the behavior of inputrefresh, let the engien handles the complex part and leave the user black-boxed.
« Last Edit: February 03, 2012, 11:48:35 am by utunnels »

 



 0%




SimplePortal 2.3.3 © 2008-2010, SimplePortal