Is it possible to make a transport aircraft which paradrops the transported troops?

I'm trying to create a transport aircraft, similar to the Chinook. However instead of having to land it to deploy troops I would like them to be able to parachute out, like in the paradrop support power.

Information and discussion for custom maps and mods.
Post Reply
cloud_of_shame
Posts: 2
Joined: Sat Aug 18, 2018 7:22 pm

Is it possible to make a transport aircraft which paradrops the transported troops?

Post by cloud_of_shame »

I thought it could be a fun idea for a mod where the player has full control over their paradrops. So instead of it being a support power they would build an aircraft, load it with troops, fly it across the map to where they want the drop to happen, then deposit the troops via parachute. They could even return the plane to base to do it again if they didn't get shot down.

Is it possible to make such as unit?

So far I have created the unit, using the Mig as a template and the sprites from the badger. I can build it, load it with troops and fly it around. It has the ParaDrop trait. If I'm reading the docs correctly this does let it drop off whatever it's cargo is? Which in this case would be the onboard troops? However when I am in game I can't see any way to command the plane to paradrop it's cargo.


SirCake
Posts: 341
Joined: Thu Feb 04, 2016 5:40 pm

Re: Is it possible to make a transport aircraft which paradrops the transported troops?

Post by SirCake »

Well, thanks for using UOE Code, I guess.
I hope you did mention the shp author somewhere, like the license suggests?

Edit: I looked at it, and the mentions are insufficient.
The license instructs you to put an explicit "XY.shp made by SirCake" in your credits AND to mention "made by SirCake" in your code, where you reference the shp's you used. You didn't ask me before publishing on GitHub and you did not copy the license for the artwork to your project.

They must either remove the shp's they published under no specified license or add those things above mentioned.

The Code copy is O.K., since it's under another license.
Last edited by SirCake on Fri Jun 26, 2020 5:49 pm, edited 2 times in total.

SirCake
Posts: 341
Joined: Thu Feb 04, 2016 5:40 pm

Re: Is it possible to make a transport aircraft which paradrops the transported troops?

Post by SirCake »

And @cloud_of_shame
you may want to try out these maps here: ;)

https://resource.openra.net/maps/35888/
https://resource.openra.net/maps/35890/

cloud_of_shame
Posts: 2
Joined: Sat Aug 18, 2018 7:22 pm

Re: Is it possible to make a transport aircraft which paradrops the transported troops?

Post by cloud_of_shame »

Thanks all. I was able to figure it out by studying these. I haven't exhaustively tested it yet so there might still be some issues but this is what I have got currently:

In the lua code:

Code: Select all

Badgers={}

WorldLoaded = function()
	--Make anything that is produced check if it needs to add itself to the badger list
	Trigger.OnAnyProduction(function(producer, produced, productionType) TabulateBadgers(produced) end)
end

Echo = function(SomeText)
	UserInterface.SetMissionText(SomeText)
end

TabulateBadgers = function(BadgerID)
	--check if it is ubadg (my custom unit) and if so add id to the list
	if BadgerID.Type == "ubadg" then
		table.insert(Badgers,BadgerID)
	end
end

--This function checks if the weapon is being fired and if so commences the paradrop
BadgerAttackParadrop = function(BadgerID)
	if BadgerID.AmmoCount("primary")<1 then --this should happen whenever the weapon is force fired
		BadgerID.Paradrop(BadgerID.Location) --quick and dirty method. If I've understood the UOE code that works out the actual position of the force fir command and does the drop around there.
		BadgerID.Reload("primary",1) --immediately reload so it is ready to be used again
	end
end

Tick = function()
	--for every badger in the list call the function to check if it should paradrop
	for _,b in pairs(Badgers) do
		if b.IsDead==false then --lua throws an error about lack of AmmoCount on dead badgers if I let the function run for them
			BadgerAttackParadrop(b)
		end
	end
end
Then in my yaml I define a fake bullet weapon (this follows UOE almost exactly). The ubadg has this fake bullet as it's armament with 1 Ammo. There is no reloading trait as this is handled by the lua.

prawda
Posts: 12
Joined: Thu Nov 15, 2018 1:16 pm

Re: Is it possible to make a transport aircraft which paradrops the transported troops?

Post by prawda »

SirCake wrote:
Fri Jun 26, 2020 11:40 am
Well, thanks for using UOE Code, I guess.
I hope you did mention the shp author somewhere, like the license suggests?

Edit: I looked at it, and the mentions are insufficient.
The license instructs you to put an explicit "XY.shp made by SirCake" in your credits AND to mention "made by SirCake" in your code, where you reference the shp's you used. You didn't ask me before publishing on GitHub and you did not copy the license for the artwork to your project.

They must either remove the shp's they published under no specified license or add those things above mentioned.

The Code copy is O.K., since it's under another license.
Me != MlemandPurrs

Post Reply