Recent Posts

Pages: [1] 2 3 ... 10
Media Section / Re: STEAM - Asset Creator
« Last post by Kitty Hello on Today at 06:08 AM »
I updated this to also create vertical capsules.
nice spotted and fixed (its was a renamed function using the old function name).

Im did not uses any costume and actuelly im did not need to uses it at all for that game anyway, because im used GameInput.GetNumberOfPlayers() instead (that wasent in the game from the start)...

Alternative example could been this, if you want to check whick type of controller (keyboard or touch). The GameInput does not check about that. Just a idea, if you using a touch/mouse interface as well.

Code: (glbasic) [Select]
IF GameInput.Left(i)+GameInput.LeftStick_Left(i)+GameInput.RightStick_Left(i)>0

type is not defined : TYPE 'GameInputs' has no member 'GetPlayerName$'

Possibly a custom function for your game?
btw autofire is something that could been implemenet in same style as a fpscounter.... this is something im actuelly cannot implement in this gameinput as the api does not get a call when a button is released. but should been easy to been implemented in a game, that want to checking that.

Also auto fire wasent fun in PowerUp Elevation, lol. That bird just keep jumping low and could not jump high at all. In a shooter game, well, im would property implement a such of a cool down feature anyway. Im think even Warhawk did that for the Speccy Next port.
auto fire and buffede controls was not the main scope of this code, not this time. the main scope was actuelly remapping on both keyboard and gamepad. None of my games would have a advancment of a auto fire at all anyway. You are fell free to add that of course if you want.

Also if you ask me, im would not care about it in a single player game.
Lookin good Spacefractal, I'll test it when I get back to my house, tomorrow night.  :good:
just updated, so remapping can been started from a mouse and then wait the mousebutton to been released before countine. This was done if a user should screw the remapping and cant remapping, they could been remapped by touch/clicking on the reamp and then start it again. A fail safe procudure.
Im have annonced with full source code:

Yep PS4 and xbox has some differents. also if you checking the sld list, some controllers has id all the place, which is why im chossen to have a better remap system as main focus rather than implement the database.

Except some standard configuration.
Just updated to beta 2. Various bug fix and the user has now possible to swap a and b buttons, which is used in some regions and controller (like Nintendo ones) and deadzone can been set. etc you want analoge output or not.
based from this thread:

Im have choosen to update and reimplement GameInput to v2.0 beta. In this version the remapping has been totally rewrote and is now supporting gamepads as well keyboards. The formatting of codes is now based on a sdl database, but also added to possible to remap keyboard as well.

to implement to your game, you can do something like this:

Code: (glbasic) [Select]
// top of the code should have those defines:


// start of the code somewhere under loading.
LOCAL SaveFile$=PLATFORMINFO$("DOCUMENTS")+"/Yourgame/Yourgame_AutoSave.ini" // should been APPDATA on other platforms.
IF STEAMDECK=1 // if you want to do that, howover users can quit remapping by mouse button now (you could get stuck).
GameInput.init(SaveController$, 1) // the first two devices should not been possible to been remapped on steamdeck.
GameInput.init(SaveController$, -1) // if you dont want possible to remap keyboard, set it to 0.

// Somewhere in the game input code.
// actuelley does nothing now on Windows, but only on Android.
LOCAL profilechanged=GameInput.update()

IF GameInput.Remap_IsRemapping()=1 // the function is doing remapping, dont do any game code
LOCAL result=GameInput.Remap_ScanCode() // return a sound/visual effect.
IF result=1 THEN SoundPlay("selectlevel")
IF result=2 THEN SoundPlay("confirmlevel")

// polling input from the api (incude keyboard) example. far from all games should do this.
IF ISPAUSE OR S_Status$<>"play"
GameInput.EnableKeyboard(FALSE) // in some cases, you dont want keyboard remapped ingame.

// This is something like that when you want to poll a joystick. In PowerUp Elevation, wbich
// im toke this snippet from, here all sticks controls the bird (include the right one).
LOCAL K1, K2, K3, K4, KJ
LOCAL Players=GameInput.GetNumberOfPlayers()

GameInput.SetDeadZone(0, 0.6) // analoge as digital with 0.6 as deadzone.
FOR i=0 TO Players-1
//IF GameInput.GetControllerName$(i)<>""
IF Players>0 // could been 0 on Android, but allways a least 1 on Windows throught as first player is on keyboard.

KL=KL+GameInput.Left(i)+GameInput.LeftStick_Left(i)+GameInput.RightStick_Left(i); IF KL>1 THEN KL=1
KR=KR+GameInput.Right(i)+GameInput.LeftStick_Right(i)+GameInput.RightStick_Right(i); IF KR>1 THEN KR=1
KU=KU+GameInput.Up(i)+GameInput.LeftStick_Up(i)+GameInput.RightStick_Up(i); IF KU>1 THEN KU=1
KD=KD+GameInput.Down(i)+GameInput.LeftStick_Down(i)+GameInput.RightStick_Down(i); IF KD=1 THEN KD=1

IF GameInput.ActionButton("A", i) OR GameInput.ActionButton("B", i) THEN KJ=1
IF GameInput.ActionButton("X", i) OR GameInput.ActionButton("Y", i) THEN KJ=1
IF GameInput.LeftTrigger(i) OR GameInput.ActionButton("RB", i) THEN KJ=1
IF GameInput.RightTrigger(i)=1 OR GameInput.ActionButton("LB", i) THEN TURNED=1

LOCAL SE=GameInput.ActionButton("select", i); // AB cab been swapped on some controllers
LOCAL PA=GameInput.ActionButton("parent", i); // AB cab been swapped on some controllers

// somewhere in the menu to start the remap
// First argument, is if you want keyboard remapped or not.
// this is a full remap for a game controller, but only required buttons for keyboard.
// if a game controller dont have all buttons, the user will escape.
// if you dont want a full remap for a controller, you can remove those you dont uses.
GameInput.Remap_Start(0,"back:back/pause|*,start:start|*,leftx:Left Stick|Movement,a:Face Bottom|Jump,b:Face Right|Turn,x:Face Left|*,y:Face Up|*,leftshoulder:Back Left Top|*,rightshoulder:Back Right Top|*,LeftTrigger:Back Left Bottom|*,RightTrigger:Back Right Bottom|*,dpdown:Dpad Down|*,dpright:Dpad Right|*,dpup:DPad Up|*,dpleft:DPad Left|*,rightx:Right Stick|*,leftstick:Left Stick|*,rightstick:Right Stick|*")

// somewhere to print, when under remapping (allways max 3 lines)
// also escape or back button will allways quit remapping with no save.
IF GameInput.Remap_IsRemapping()=1
LOCAL line$=GameInput.Remap_GetText$(1)
BMFont.DrawText(line$, 0, PY+PH+SCALING*70, SIN(FADING*90)*1, SIN(FADING*90)*0.5*2, 0, -1, -2)

IF line$<>"" THEN BMFont.DrawText(line$, 0, PY+PH+SCALING*75, SIN(FADING*90)*1, SIN(FADING*90)*0.5*2, 0, -1, -2)

IF line$<>"" THEN BMFont.DrawText(line$, 0, PY+PH+SCALING*80, SIN(FADING*90)*1, SIN(FADING*90)*0.5*2, 0, -1, -2)


this code is only tested on Windows, while the code for Android is there, im have nowhere tested it at all. Its might or might not work, or not compile at all. No idea. Im have still yet to update Android Studio, if im want to do that.

PS. PowerUp Elevation has been updated on steam, which uses this api (that game became test game).
Pages: [1] 2 3 ... 10