Page 1 of 1

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

Posted: Thu Jun 25, 2020 5:03 pm
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.

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

Posted: Thu Jun 25, 2020 10:20 pm
by prawda

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

Posted: Fri Jun 26, 2020 11:40 am
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.

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

Posted: Fri Jun 26, 2020 1:10 pm
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/

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

Posted: Fri Jun 26, 2020 4:58 pm
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.

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

Posted: Sun Jun 28, 2020 11:02 am
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

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

Posted: Wed Aug 05, 2020 2:37 pm
by 3.Lucian
This is a cool idea and I'd like to see it explored further. Maybe as a secondary Chinook function. Ctrl-f parachute all troops out.