tModLoader Double Player Example

Solo-Ion

Dungeon Spirit
Ever wanted to pilot an armed drone and take down your enemies from afar? Well, with this mod and an XBOX 360 controller, you can. Plug in two XBOX 360 controllers, craft the item 'Drone Controller' from Iron and Wire at a work bench, equip it to an accessory slot and you're ready to take down enemies from afar.

For more fun, hand the controller to a friend and have them pilot the drone while you play like a Boss!


drone_1_by_solo_ion-d9ydcpw.jpg
drone_2_by_solo_ion-d9ydcpu.jpg

drone_3_by_solo_ion-d9ydcpm.jpg
drone_6_by_solo_ion-d9ydcpj.jpg


Craft the Drone Controller at a work bench from Iron/Lead and wire. Equip it to an accessory slot to spawn a drone. Pilot with the left stick and shoot with the right. Fire a grenade with the right shoulder button and enter/exit autopilot mode with start.

No XBOX controller, but another kind of controller? No problem. Just use TocaEdit (https://drive.google.com/file/d/0B4uhife6gGJnekt0QTg1TnN6WlE/view) to emulate any controller as a XBOX controller. I've been using a DualShock 2 controller with an adapter and it works great.

To install ToCA EDIT, follow the link above and download the .zip file. Locate the file x360ce.exe within one of the .zip files and copy it to your Terraria directory within your Steam folder, which should be \Steam\SteamApps\common\Terraria. Run x360ce with both of your non-360 controller plugged in and configure controller 2. Click save once you are done and close TocaEdit before you launch tModLoader. Ensure you have your configured controller plugged in before starting tModLoader.

The release of 1.3.1 messed up how my mod worked. The only solution that I have found is to map the drone to controller 2, which means that you need two controllers connected at the same time to use my mod. If someone knows a way to disable Terraria's inbuilt controller mode, either using mods or by some external method, please let me know.

I'm not sure where else to go with this mod, and I have other mods that I want to work on more. So I'm also including the source code for this mod so that other people can innovate on my idea.

Recent Version history
1.0.2.2
- The red part of the drone now glows in the dark (thank you Xiarno for the suggestion)

1.0.2.3
- Updated to tModLoader 0.9.2.2 (Terraria 1.3.4.4)
- Fixed a bug that prevented this mod from loading in multiplayer

1.0.3.0
- Updated to tModLoader 0.10.0.1 (Terraria 1.3.5.2)

Also, check out my other mods.
Terrarian Dreamkeepers
Hotbar Swapper
 

Attachments

  • Double Player Example v1.0.3.0.zip
    23.8 KB · Views: 426
  • Double Player Example v1.0.3.0 - Source.zip
    26.6 KB · Views: 333
Last edited:
This looks amazing and I would love to try it! Shame I don't have a friend to play it with... On that note, how does the autopilot mode work? Does it just turn it into a summon? :)
[doublepost=1460190751,1460190667][/doublepost]
And I just wanted to say one thing to Re-Logic. Controller support? Hah! Beat you to it.
Hahahah, nice job. I also wanted to ask: are you planning to add tiers of this drone, have it be a stand alone, or have it scale some way with the player?
 
Sounds cool.

Edit: Here's a video. Too bad I'm playing with myself.

Next step, allow unlimited of them and make it so twitch users can control them.
Thanks. Yes, I had the same problem when playing by myself.

And Twitch support... ohhohhhoh... I think that's beyond my skill level. :merchanteek:

This looks amazing and I would love to try it! Shame I don't have a friend to play it with... On that note, how does the autopilot mode work? Does it just turn it into a summon? :)
[doublepost=1460190751,1460190667][/doublepost]
Hahahah, nice job. I also wanted to ask: are you planning to add tiers of this drone, have it be a stand alone, or have it scale some way with the player?
Thank you. Autopilot mode simply makes the Drone follow the player so that you can control your player again. However, the follow AI that I wrote is very basic which means that it will get stuck on things easily in autopilot mode. To compensate for this, it will teleport to you if it gets too far off screen.

Besides doing a compatibility update for 1.3.1, I wasn't planning on going much further with this; this is really just a proof of concept. I'm planning to resume work on my other mod shortly. Instead, I've included the source code so that other interested modders can expand on this idea. I look forward to seeing where this is taken. It's theoretically possible to alter the game so that ANY minion can be controlled by a controller. But that is way beyond my skill level.`:sigh:
 
Besides doing a compatibility update for 1.3.1, I wasn't planning on going much further with this; this is really just a proof of concept.
Well, You did a great job and if you don't continue I hope someone else picks this up. :D
 
Ever wanted to pilot an armed drone and take down your enemies from afar? Well, with this mod and an XBOX 360 controller, you can. Plug in your XBOX 360 controller, craft the item 'Drone Controller' from Iron and Wire at a work bench, equip it to an accessory slot and your ready to take down enemies from afar.

For more fun, hand the controller to a friend and have them pilot the drone while you play like a Boss!

YouTube video coming eventually.

drone_1_by_solo_ion-d9ydcpw.jpg
drone_2_by_solo_ion-d9ydcpu.jpg

drone_3_by_solo_ion-d9ydcpm.jpg
drone_6_by_solo_ion-d9ydcpj.jpg


Craft the Drone Controller at a work bench from Iron/Lead and wire. Equip it to an accessory slot to spawn a drone. Pilot with the left stick and shoot with the right. Fire a grenade with the right shoulder button and enter/exit autopilot mode with start.

No XBOX controller? No problem. Just use TocaEdit (https://drive.google.com/file/d/0B4uhife6gGJnekt0QTg1TnN6WlE/view) to emulate any controller as a XBOX controller. I've been using a DualShock 2 controller with an adapter and it works great.

To install ToCA EDIT, follow the link above and download the .zip file. Locate the file x360ce.exe within one of the .zip files and copy it to your Terraria directory within your Steam folder, which should be \Steam\SteamApps\common\Terraria. Run x360ce with your non-360 controller plugged in and configure your controller. Click save once you are done and close TocaEdit before you launch tModLoader. Ensure you have your configured controller plugged in before starting tModLoader.

So why is it called 'Double Player'? Well this mod lets two people play together on one game, but I could hardly call it 'Multiplayer' because Terraria is already multiplayer. Double Player was the next logical choice.

And I just wanted to say one thing to Re-Logic. Controller support? Hah! Beat you to it.

I'm not sure where else to go with this mod, and I have other mods that I want to work on more. So I'm also including the source code for this mod so that other people can innovate on my idea.

Version history
1.0
- First public release

Also, check out my other mods.
Terrarian Dreamkeepers
Hotbar Swapper
It's very neat to see something like this, totally out-of-the-box if you ask me!
Wondering if I could use some of the code (with credits, ofc) for a mod project: the Terrabot.
Basically a drone which you can customize (make it a flying drone or a walking tank) apply different weaponry (lasers, hammers, beams, etc.).
Not sure when the above project will get to the point of release.

Anyway, all in all: nice job!
 
Great work !
There just have to be more Drone-Tiers and this Mod would be game-changing !
I would just add more tiers myself, but I don't think my skill is high enough. I can only work with JSON right now.
You could make a better Drone with the Expert Mode Mech-Boss Drops, for example, or Hallowed Bars and/or their Souls.
I really hope someone will expand this Mod, with more Drone-Tiers.
 
Well, You did a great job and if you don't continue I hope someone else picks this up. :D
Thank you. Maybe I'll make something more than just a proof-of-concept like this, but for now I'll leave it up to more experienced modders.

It's very neat to see something like this, totally out-of-the-box if you ask me!
Wondering if I could use some of the code (with credits, ofc) for a mod project: the Terrabot.
Basically a drone which you can customize (make it a flying drone or a walking tank) apply different weaponry (lasers, hammers, beams, etc.).
Not sure when the above project will get to the point of release.

Anyway, all in all: nice job!
Sure thing. All I ask for is credit. :)

Great work !
There just have to be more Drone-Tiers and this Mod would be game-changing !
I would just add more tiers myself, but I don't think my skill is high enough. I can only work with JSON right now.
You could make a better Drone with the Expert Mode Mech-Boss Drops, for example, or Hallowed Bars and/or their Souls.
I really hope someone will expand this Mod, with more Drone-Tiers.
Thank you. I'll bet there's plenty of ways to use this idea that I haven't thought of. I hope to see other modders pick up this idea and fly with it.
 
Really cool mod, I have some ideas.

How you start with the drone controller in you inventory, and killing bosses can buff the drone as you go on, by increasing the rate of fire, and damage.

How about adding some more things the drone can shoot, by hitting the bumpers you can rotate through the projectile you want to shoot, such as flares, and piercing lasers.
 
Really cool mod, I have some ideas.

How you start with the drone controller in you inventory, and killing bosses can buff the drone as you go on, by increasing the rate of fire, and damage.

How about adding some more things the drone can shoot, by hitting the bumpers you can rotate through the projectile you want to shoot, such as flares, and piercing lasers.
They weren't planning on expanding upon it, and left the source code open to others.
 
hey it is saying it cant find the recipes know a fix
Ah, that's because I haven't updated this to the latest version, which changed the way that recipes worked. I haven't updated this yet because controller support messed up this mod, and the only solution that I've found is to plug in two controllers. I'll update this sooner or later, but if enough people want this working again, I'll make it sooner.
 
I would definately love to see this updated. Looks awesome.

I would also like to recommend upgradable tiers, starting off at wooden-arrow/seed tier tech, thus allowing for those who wish to play from the beginning of a character and map with another person (without access to a second computer).

A suggestion would be to encase some sort of animal capturable from a catching net. and then somehow have it "trained" to use a mini bow.
 
Last edited:
It's very neat to see something like this, totally out-of-the-box if you ask me!
Wondering if I could use some of the code (with credits, ofc) for a mod project: the Terrabot.
Basically a drone which you can customize (make it a flying drone or a walking tank) apply different weaponry (lasers, hammers, beams, etc.).
Not sure when the above project will get to the point of release.

Anyway, all in all: nice job!
Hi, just letting you know I've updated this for the 1.3.1 version of Terraria. That update kind of messed up this mod, and the only way that I've found to fix it is to have the drone operated by controller 2, which means that two controllers need to be connected for my mod to work.

I hope you have fun with your mods.

Thanks man
Thanks you. I've fixed the issue with the recipe and mapped the drone to controller 2 so that this will work with 1.3.1.

I would definately love to see this updated. Looks awesome.

I would also like to recommend upgradable tiers, starting off at wooden-arrow/seed tier tech, thus allowing for those who wish to play from the beginning of a character and map with another person (without access to a second computer).

A suggestion would be to encase some sort of animal capturable from a catching net. and then somehow have it "trained" to use a mini bow.
That's a clever idea. However, this was more of a proof of concept than anything else, though. I wasn't planning on going very far with this, which was why I released the source code alongside the mod so that other people could make their own Double Player mods.

Anyway, I've updated this so that it works with 1.3.1, but I had to move the input for the drone to controller port 2 to prevent a conflict with Terraria's inbuilt controller support.
 
Back
Top Bottom