Controller Support/Mods?

General discussion about anything related to Transcendence.
Post Reply
joeman137
Anarchist
Anarchist
Posts: 7
Joined: Tue Mar 03, 2015 3:59 am

Hello, recently heard about transcendence and I'm very impressed, really fun and interesting game : ) . I've been waiting to "beat" the game before I start trying my hands at mods. One issue I would like would to be able to play the game fully from a controller. I was thinking of using something like xpadder or x360ce.

My question is, is there a config setting or mod that'll let you use arrow/directional keys within the menus and accept a universal accept button? As it is right now, the various prompts all tied to different letters make it's a little hard to play with a controller. Everything else can be reasonably map to the controller.
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

Transcendence doesn't have joystick or gamepad support, but I've heard of people mapping gamepads to keyboard inputs with third party software.
Literally is the new Figuratively
NIGHTHAWK620
Militia Lieutenant
Militia Lieutenant
Posts: 129
Joined: Sat Aug 06, 2011 2:24 am
Location: WESTCHESTER COUNTY, N.Y.

joeman137 wrote:Hello, recently heard about transcendence and I'm very impressed, really fun and interesting game : ) . I've been waiting to "beat" the game before I start trying my hands at mods. One issue I would like would to be able to play the game fully from a controller. I was thinking of using something like xpadder or x360ce.

My question is, is there a config setting or mod that'll let you use arrow/directional keys within the menus and accept a universal accept button? As it is right now, the various prompts all tied to different letters make it's a little hard to play with a controller. Everything else can be reasonably map to the controller.
Logitech has a programmable device that I am trying to figure out how to do this. The game has 24 + enter if you include the arrows which 3 are left. The total is 28. The device has 16 + the D-Pad. How can they then be configured to work with the game? Unless their are newer and/ or better models.
NH620
joeman137
Anarchist
Anarchist
Posts: 7
Joined: Tue Mar 03, 2015 3:59 am

NIGHTHAWK620 wrote:
joeman137 wrote:Hello, recently heard about transcendence and I'm very impressed, really fun and interesting game : ) . I've been waiting to "beat" the game before I start trying my hands at mods. One issue I would like would to be able to play the game fully from a controller. I was thinking of using something like xpadder or x360ce.

My question is, is there a config setting or mod that'll let you use arrow/directional keys within the menus and accept a universal accept button? As it is right now, the various prompts all tied to different letters make it's a little hard to play with a controller. Everything else can be reasonably map to the controller.
Logitech has a programmable device that I am trying to figure out how to do this. The game has 24 + enter if you include the arrows which 3 are left. The total is 28. The device has 16 + the D-Pad. How can they then be configured to work with the game? Unless their are newer and/ or better models.
The way I plan on tackling this issue was pretty much with xpadder. It contains a feature where you can map a button to toggle the control scheme to remap all the buttons. So lets say I bind L2 button to change all the other buttons to be related to various sub-functionality (deploying drones, using special abilities, etc). Then letting go the L2 button could snap back into a default control scheme (firing, docking, gate access, etc). The biggest obstacle currently is the menu interface. With options only initially being accessible via either mouse or specific letters, the variation is staggering. If it was possible to select items via keyboard and enter it would be MUCH easier to play via controller.

So being brand new to this game and modding scene. How difficult would it be to make an interface mod to allow keyboard controls for menu prompts? If that mod doesn't exist can someone give me some guidance on how I could start crafting one for myself?
TVR
Militia Commander
Militia Commander
Posts: 334
Joined: Sat Sep 08, 2012 3:26 am

40 lines of code, more or less. (scrSetActionLabel) to display the cursor over a text action, (scrAddAction) to add invisible actions that move the menu cursor up or down, and <onGlobalPaneInit> to add those actions to every pane.

The end result will be three buttons only required to navigate the menu: Up, Down, and Select.

Am always ready to assist if interested.
Fiction is reality, simplified for mass consumption.
PGP: 0x940707ED, 5DB8 4CB4 1EF5 E987 18A0 CD99 3554 3C13 9407 07ED
Bitcoin: 1LLDr7pnZDjXVT5mMDrkqRKkAPByPCQiXQ
joeman137
Anarchist
Anarchist
Posts: 7
Joined: Tue Mar 03, 2015 3:59 am

TVR wrote:40 lines of code, more or less. (scrSetActionLabel) to display the cursor over a text action, (scrAddAction) to add invisible actions that move the menu cursor up or down, and <onGlobalPaneInit> to add those actions to every pane.

The end result will be three buttons only required to navigate the menu: Up, Down, and Select.

Am always ready to assist if interested.
Wow when you put it like that it sounds incredibly easy. Just got into the game so wasn't sure the extend/reach of the mod tools provided. I would love some assistance making this mod, though since I'm so new I would figure its more like me struggling and blowing things up while you elegantly crafted it :lol: . In the case of edge cases, this wouldn't interfere with other arrow keys navigable menus? (Menu for repairing/change armor, menu for applying barrels/auton)?
TVR
Militia Commander
Militia Commander
Posts: 334
Joined: Sat Sep 08, 2012 3:26 am

Nice. Be sure to select a UNID at https://forums.kronosaur.com/viewtopic.php?f=5&t=959 to get started.

Arrow keys will likely have to be avoided, using another two keys instead. Xpadder has support for all keys, though, so it shouldn't be a problem.
Fiction is reality, simplified for mass consumption.
PGP: 0x940707ED, 5DB8 4CB4 1EF5 E987 18A0 CD99 3554 3C13 9407 07ED
Bitcoin: 1LLDr7pnZDjXVT5mMDrkqRKkAPByPCQiXQ
joeman137
Anarchist
Anarchist
Posts: 7
Joined: Tue Mar 03, 2015 3:59 am

TVR wrote:Nice. Be sure to select a UNID at https://forums.kronosaur.com/viewtopic.php?f=5&t=959 to get started.

Arrow keys will likely have to be avoided, using another two keys instead. Xpadder has support for all keys, though, so it shouldn't be a problem.
Alright great! Placed in a request for UNID 0xD696. Ok I skimmed some of the tutorials from (http://wiki.kronosaur.com/modding/tutorials). So.....where the heck do we start for modifying the interface?! :shock:
TVR
Militia Commander
Militia Commander
Posts: 334
Joined: Sat Sep 08, 2012 3:26 am

Here is the basic framework for the controller support mod, save all of the following code as ControllerDockscreenSupport.xml and place that file inside the Transcendence Extensions directory.

~/Transcendence/Extensions/ControllerDockscreenSupport.xml

Start up a new game and verify that each dockscreen action in the game is automatically overwritten to use the keys 0-9

Afterwards, change the UNIDs from E000 to yours, and be sure to think of a new name for the mod.

Code: Select all

<?xml version="1.0" ?>

<!DOCTYPE TranscendenceExtension
	[	
		<!ENTITY dsRemapper	"0xE0006201">
		<!ENTITY reservedUNID2	"0xE0006202">
		<!ENTITY reservedUNID3	"0xE0006203">
		<!ENTITY reservedUNID4	"0xE0006204">
		<!ENTITY reservedUNID5	"0xE0006205">
		<!ENTITY reservedUNID6	"0xE0006206">
		<!ENTITY reservedUNID7	"0xE0006207">
		<!ENTITY reservedUNID8	"0xE0006208">
		<!ENTITY reservedUNID9	"0xE0006209">
		<!ENTITY reservedUNIDA	"0xE000620A">
		<!ENTITY reservedUNIDB	"0xE000620B">
		<!ENTITY reservedUNIDC	"0xE000620C">
		<!ENTITY reservedUNIDD	"0xE000620D">
		<!ENTITY reservedUNIDE	"0xE000620E">
		<!ENTITY reservedUNIDF	"0xE000620F">
		<!ENTITY reservedUNID10	"0xE0006210">
	]>
<TranscendenceExtension UNID="0xE0006200" version="1.1" name="TVRMOD 7">

	<DockScreen UNID="&dsRemapper;">
		<Events>
			<OnGlobalPaneInit>
				(block Nil
					;; Code goes here!
					
					(printTo 'console "test")
					
					;; Iterate through the first 10 dockscreen actions, if any, and change their action key to a number
					(for i 0 10
						(block Nil
							(if (not (isError (scrSetActionLabel gScreen i 'action1 "1")))
								(scrSetActionLabel gScreen i (cat "Action " i) (cat i))
							)
						)
					)
					
					<!--
					;; Set all dockscreen actions to only use number keys from 1 to 5
					(scrSetActionLabel gScreen 0 'action1 "1")
					(scrSetActionLabel gScreen 1 'action2 "2")
					(scrSetActionLabel gScreen 2 'action3 "3")
					(scrSetActionLabel gScreen 3 'action4 "4")
					(scrSetActionLabel gScreen 4 'action5 "5")
					-->
				)
			</OnGlobalPaneInit>
		</Events>
	</DockScreen>
</TranscendenceExtension>
Fiction is reality, simplified for mass consumption.
PGP: 0x940707ED, 5DB8 4CB4 1EF5 E987 18A0 CD99 3554 3C13 9407 07ED
Bitcoin: 1LLDr7pnZDjXVT5mMDrkqRKkAPByPCQiXQ
joeman137
Anarchist
Anarchist
Posts: 7
Joined: Tue Mar 03, 2015 3:59 am

Wow thanks, it works really nice, had a couple of questions.

I see that scrSetActionLabel replaces what the item was going to say for 'action 0,1,etc'. Was wondering how would one go about placing the text that was stored there previously? I looked around and best I could find was

scrGetListEntry Func
http://xelerus.de/index.php?s=functions&function=329

But not really sure how I'd invoke it. What the heck is a gScreen anyways? g(lobal)Screen? Also what language does transcendence moding use? the for loop/if statements are those built into the xml parsing or is there an embedded lua interpreter? Have to say just from the small glimpse that I've seens, it's quite open/powerful and I like it : )
TVR
Militia Commander
Militia Commander
Posts: 334
Joined: Sat Sep 08, 2012 3:26 am

That's the thing, dockscreen actions were never meant to be dynamically altered, so there is no function for retrieving the text of a dockscreen action.

There is also no function for changing the action keys without changing the action labels or vice versa.

We would normally have to put in a feature request on the bug tracker for (scrGetActionLabel) and wait until the next version.

Fortunately, we can use a workaround. By running the replace action keys code in a separate event 1 tick after the screen is opened, we can avoid changing the action labels. The following code remaps the actions to number keys like before, but without relabelling them.

Code: Select all

<?xml version="1.0" ?>

<!DOCTYPE TranscendenceExtension
	[	
		<!ENTITY dsRemapper	"0xE0006201">
		<!ENTITY vtActionDelayer	"0xE0006202">
		<!ENTITY reservedUNID3	"0xE0006203">
		<!ENTITY reservedUNID4	"0xE0006204">
		<!ENTITY reservedUNID5	"0xE0006205">
		<!ENTITY reservedUNID6	"0xE0006206">
		<!ENTITY reservedUNID7	"0xE0006207">
		<!ENTITY reservedUNID8	"0xE0006208">
		<!ENTITY reservedUNID9	"0xE0006209">
		<!ENTITY reservedUNIDA	"0xE000620A">
		<!ENTITY reservedUNIDB	"0xE000620B">
		<!ENTITY reservedUNIDC	"0xE000620C">
		<!ENTITY reservedUNIDD	"0xE000620D">
		<!ENTITY reservedUNIDE	"0xE000620E">
		<!ENTITY reservedUNIDF	"0xE000620F">
		<!ENTITY reservedUNID10	"0xE0006210">
	]>
<TranscendenceExtension UNID="0xE0006200" version="1.1" name="TVRMOD 7">

	<StationType UNID="&vtActionDelayer;"
        backgroundObject="true"
        virtual="true"
        >
        
        <Events>
        	<SetActionKeys>
        		(block Nil
        			;; Set the dockscreen actions to use number keys
        			(scrSetActionNumberKeys gScreen)
        			
        			;; Self-destruct
        			(objDestroy gSource)
        		)
        	</SetActionKeys>
        </Events>
	</StationType>
	
	<DockScreen UNID="&dsRemapper;">
		<Events>
			<OnGlobalPaneInit>
				(block Nil
					;; Code goes here!
					
					;; Indicate code has been run
					(printTo 'console "test")
					
					;; Create virtual station to delay function by 1 tick
					(block (tempStation)
						(setq tempStation (sysCreateStation &vtActionDelayer; nil))
						(sysAddObjTimerEvent 1 tempStation 'SetActionKeys)
					)
					
					<!--
					;; Add option
					(scrAddAction gScreen 'test -1 "Switch to number keys" "1"
						(block Nil
							(scrSetActionNumberKeys gScreen)
						)
					)
					-->
					
					;(scrShowAction gScreen 'test Nil)
					
					<!--
					(scrSetActionNumberKeys gScreen)
					-->
					
					<!--
					;; Iterate through the first 10 dockscreen actions, if any, and change their action key to a number
					(for i 0 10
						(block Nil
							(if (not (isError (scrSetActionLabel gScreen i 'action1 "1")))
								(scrSetActionLabel gScreen i (cat "Action " i) (cat i))
							)
						)
					)
					-->
					
					<!--
					;; Set all dockscreen actions to only use number keys from 1 to 5
					(scrSetActionLabel gScreen 0 'action1 "1")
					(scrSetActionLabel gScreen 1 'action2 "2")
					(scrSetActionLabel gScreen 2 'action3 "3")
					(scrSetActionLabel gScreen 3 'action4 "4")
					(scrSetActionLabel gScreen 4 'action5 "5")
					-->
				)
			</OnGlobalPaneInit>
		</Events>
	</DockScreen>
	
	<Globals>
		(block Nil
			(setq scrSetActionNumberKeys
				(lambda (gScreen)
					;; Iterate through the first 10 dockscreen actions, if any, and change their action key to a number
					(for i 0 10
						(block Nil
							(if (not (isError (scrSetActionLabel gScreen i 'action1 "1")))
								(scrSetActionLabel gScreen i (cat "Action " (add i 1)) (cat (add i 1)))
							)
						)
					)
				)
			)
		)
	</Globals>
</TranscendenceExtension>
Transcendence's scripting language syntax is similar to LISP, it is called TLISP. Most of the game is implemented in it.

gScreen is a globally defined variable that always refers to the current opened screen. All (scr*) functions always take it as the first argument.

BTW, check out the source code on Xelerus or Github.

We have four functions currently

(scrAddAction screen actionID pos label [key] [special] code)
(scrEnableAction screen actionID enabled)
(scrSetActionLabel screen actionID label [key] [special])
(scrShowAction screen actionID shown)
Fiction is reality, simplified for mass consumption.
PGP: 0x940707ED, 5DB8 4CB4 1EF5 E987 18A0 CD99 3554 3C13 9407 07ED
Bitcoin: 1LLDr7pnZDjXVT5mMDrkqRKkAPByPCQiXQ
joeman137
Anarchist
Anarchist
Posts: 7
Joined: Tue Mar 03, 2015 3:59 am

Just tried out the modified mod and it works perfectly! Thanks a lot really appreciate it! I've never dabbled in LISP before but this game looks like a nice ecosystem to get comfortable with. I've only gotten as far as maybe 2-3 stargates, so I have a long way to go before experiencing a good portion of the game. But once I have i'll definitely look into modding for this one. I've been dying for a roguelike with accessable modding, and while this one is quite daunting it power/flexibility looks worth it!
User avatar
pixelfck
Militia Captain
Militia Captain
Posts: 571
Joined: Tue Aug 11, 2009 8:47 pm
Location: Travelling around in Europe

With the new XML manipulation functions, it should be possible to attach the code to all dockscreens in the game dynamically. This would be a lot more future proof and require a lot less editing of dockscreens, at the 'cost' of a somewhat more difficult block of code to write.

~Brigand
Image
Download the Black Market Expansion from Xelerus.de today!
My other mods at xelerus.de
TVR
Militia Commander
Militia Commander
Posts: 334
Joined: Sat Sep 08, 2012 3:26 am

Excellent idea, pixelfck, that would allow labelling the actions with the number of the key that they have been mapped to. Estimated amount of code needed: 100-150 lines

This current support is just a proof-of-concept, we should continue developing it.
Fiction is reality, simplified for mass consumption.
PGP: 0x940707ED, 5DB8 4CB4 1EF5 E987 18A0 CD99 3554 3C13 9407 07ED
Bitcoin: 1LLDr7pnZDjXVT5mMDrkqRKkAPByPCQiXQ
Post Reply