Custom building

Information and discussion for custom maps and mods.
Post Reply
User avatar
raymundo
Posts: 117
Joined: Mon Mar 30, 2015 10:39 am

Custom building

Post by raymundo »

Hello. Recently I've been working on modding aspects of the game, specifically a mini game in RA with Zjordy called Ant base. The idea is 8 players fight against 3 others who are a team of ants. http://resource.openra.net/maps/3915/

Right now we have basically a super up ant for each player with lots of hp and attack power, and flying fire ants who are called in via paradrop by the ant. I plan to add also a chemical sprayer ant and a big queen ant.

I'm wondering if there is a way to make custom production facilities that would build only the ants and not the regular units of the game?

Thanks

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post by Graion Dilach »

This is the RA mod, right? If you resubclassify all units in a production queue (look at helicopters and aircrafts, how they have a subclass of the Aircraft queue along with them) then you can do that with an existing queue.

Mapmods can't do more - you have to go for complete mod if you intend to add a new button for it.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

abcdefg30
Posts: 641
Joined: Mon Aug 18, 2014 6:00 pm

Post by abcdefg30 »

You could try something like:

Code: Select all

	FactAnt:
		Inherits: ^Building
		Valued:
			Cost: 2000
		Tooltip:
			Name: Factory ant
			Description: Produces ants
		Health:
			HP: 120
		Armor:
			Type: Light
		RevealsShroud:
			Range: 12c0
		RenderBuilding:
			Image: ant
			Sequence: stand
		Selectable:
			Bounds: 36,28,0,0
		Voiced:
			VoiceSet: AntVoice
		Building:
		-GivesBuildableArea:
		RallyPoint:
			RallyPoint: 0,2
		Exit:
			SpawnOffset: -280,400,0
			ExitCell: 0,1
		Production:
			Produces: Infantry
		PrimaryBuilding:
		ProductionBar:
		-EmitInfantryOnSell:
		ProvidesPrerequisite@buildingname:
And then

Code: Select all

		Buildable:
			Queue: Infantry
			BuildPaletteOrder: 10
			Prerequisites: ~factant
on "Ant:".

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post by Graion Dilach »

That will still let the ant to be produced from the barracks. But this reminded me that the answer is even more straightforward - dogs are the perfect example.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

User avatar
raymundo
Posts: 117
Joined: Mon Mar 30, 2015 10:39 am

Post by raymundo »

Yes, this is for RA mod. thanks for the information and ideas! I don't know why i overlooked the dog hut, great idea! I am thinking i want to have the dog hut as an actor but possibly have it be rendered as an ant or tree if possible.

abcdefg30 wrote: You could try something like:

Code: Select all

	FactAnt:
		Inherits: ^Building
		Valued:
			Cost: 2000
		Tooltip:
			Name: Factory ant
			Description: Produces ants
		Health:
			HP: 120
		Armor:
			Type: Light
		RevealsShroud:
			Range: 12c0
		RenderBuilding:
			Image: ant
			Sequence: stand
		Selectable:
			Bounds: 36,28,0,0
		Voiced:
			VoiceSet: AntVoice
		Building:
		-GivesBuildableArea:
		RallyPoint:
			RallyPoint: 0,2
		Exit:
			SpawnOffset: -280,400,0
			ExitCell: 0,1
		Production:
			Produces: Infantry
		PrimaryBuilding:
		ProductionBar:
		-EmitInfantryOnSell:
		ProvidesPrerequisite@buildingname:
And then

Code: Select all

		Buildable:
			Queue: Infantry
			BuildPaletteOrder: 10
			Prerequisites: ~factant
on "Ant:".

Production:
Produces: Infantry
^Wouldn't this allow the building to also build regular infantry?

Lets say I do this for the dog hut, could i make extra units available in the hut, or would it just be the one unit (originally the dog).?

One more question: Is there a way to allow a building to automatically build units say once every 20 seconds without the player clicking build?

Edit: The easier way for this may just be to create a way point, or use viceroidspawner? is this doable without lua?
Thanks all :D

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post by Graion Dilach »

Code: Select all

DOG:
	Buildable:
		Queue: Infantry
		BuildAtProductionType: Dog
		BuildPaletteOrder: 50
		Prerequisites: ~kenn, ~techlevel.infonly

KENN:
	Production:
		Produces: Infantry, Dog
should answer your first question. The further ones aren't possible as far as I know.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

User avatar
raymundo
Posts: 117
Joined: Mon Mar 30, 2015 10:39 am

Post by raymundo »

BuildAtProductionType: Dog


So, if i add that to any unit, will it be available in the dog kennel?

Im going to experiment now :D.


Edit: I was able to add the units, the sidebar says Giant Ant but the tool tips will all be different. Custom maps wouldn't support adding a new icon for the sidebar correct?

The ants look strange because they are flying, and one is cloaked. I plan to only let the small one fly.
Attachments
a.png
a.png (375.58 KiB) Viewed 7537 times
Last edited by raymundo on Tue Aug 04, 2015 2:47 am, edited 3 times in total.

abcdefg30
Posts: 641
Joined: Mon Aug 18, 2014 6:00 pm

Post by abcdefg30 »

Production:
Produces: Infantry
^Wouldn't this allow the building to also build regular infantry?
Only if you also have barracks captured.
That will still let the ant to be produced from the barracks. But this reminded me that the answer is even more straightforward - dogs are the perfect example.
Are you sure? Look at the prerequisites, "~factant" shouldn't allow that.

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post by Graion Dilach »

abcdefg30 wrote:
Graion Dilach wrote: That will still let the ant to be produced from the barracks. But this reminded me that the answer is even more straightforward - dogs are the perfect example.
Are you sure? Look at the prerequisites, "~factant" shouldn't allow that.
Having it as prereq alone wouldn't solve the possibility of production. Without using BuildAtProductionType, having both a barracks and an ant hive would let ants being trained from barracks and regular infantry trained from the ant hive which I think raymundo doesn't want.

Listing ~factant only disables the production alone but if that's passed, your solution provides no limits against the buildings eligible from production.

I also acknowledge, using an explicit BuildAtProductionType might make listing the producer building as prereq redundant although I never tested this latter case.

EDIT: Damn, raymundo, downsize that frickin screenshot, it breaks the forum! Also pretty certain there are modmaps already with custom cameos, since those are part of sequences, so you can add such, what you can't add are UI elements (production queue buttons, etc).
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

abcdefg30
Posts: 641
Joined: Mon Aug 18, 2014 6:00 pm

Post by abcdefg30 »

Having it as prereq alone wouldn't solve the possibility of production. Without using BuildAtProductionType, having both a barracks and an ant hive would let ants being trained from barracks and regular infantry trained from the ant hive which I think raymundo doesn't want.
That falls under
Production:
Produces: Infantry
^Wouldn't this allow the building to also build regular infantry?
Only if you also have barracks captured.
But you're right, yes.

Post Reply