Page 1 of 1

Ant Units (Update: map added "Radioactive Forest")

Posted: Tue Aug 04, 2015 8:32 am
by raymundo
Looking for help here, I've been running into a strange exception.

Here is the exception

Exception of type `System.InvalidOperationException`: TypeDictionary contains multiple instance of type `OpenRA.Mods.Common.Traits.RenderSpritesInfo`
at OpenRA.Primitives.TypeDictionary.Get[RenderSpritesInfo] () [0x00000] in <filename unknown>:0
at OpenRA.Mods.Common.Widgets.ProductionPaletteWidget.RefreshIcons () [0x00000] in <filename unknown>:0
at OpenRA.Mods.Common.Widgets.ProductionPaletteWidget.set_CurrentQueue (OpenRA.Mods.Common.Traits.ProductionQueue value) [0x00000] in <filename unknown>:0
at OpenRA.Mods.Common.Widgets.Logic.ClassicProductionLogic+<SetupProductionGroupButton>c__AnonStorey0.<>m__1 (Boolean reverse) [0x00000] in <filename unknown>:0
at OpenRA.Mods.Common.Widgets.Logic.ClassicProductionLogic+<SetupProductionGroupButton>c__AnonStorey0.<>m__4 (KeyInput e) [0x00000] in <filename unknown>:0


and here is a link with text of my .yaml, note the actual map is attached to this post. https://gist.github.com/anonymous/a4cec7a536d44870fab2


I was wondering if it was because I am trying to create multiple units that are using RenderUnit: with the same Image: ant

Edit: Extra info- The first 2 units Ant, and REDANT work fine, its when i add the others that this exception occurs.
Any help much appreciated, thanks!

Posted: Tue Aug 04, 2015 9:26 am
by abcdefg30
You probably want "RenderSprites:" instead of "RenderUnit:" on "TANT" and "QANT".
("^Infantry" uses "RenderSprites:". If you define "RenderUnit:" on an actor that inherits "^Infantry", you have two Render traits, which causes this crash.)

Posted: Tue Aug 04, 2015 3:41 pm
by raymundo
Thanks, I can now get them to load in! I will have to change one to inherit tank because I want to give it mad tank ability, and mad tank require renderunit: instead of render sprites:

That was hard to figure out for me because I was looking in infantry and wondering how the game knew which sprite to render. It is based off their default names but it doesn't indicate which type of rendering is used.

Posted: Tue Aug 04, 2015 5:18 pm
by Canavusbis
raymundo wrote: Thanks, I can now get them to load in! I will have to change one to inherit tank because I want to give it mad tank ability, and mad tank require renderunit: instead of render sprites:

That was hard to figure out for me because I was looking in infantry and wondering how the game knew which sprite to render. It is based off their default names but it doesn't indicate which type of rendering is used.
This will be fixed in the next release.

Posted: Tue Aug 04, 2015 9:19 pm
by raymundo
I am now trying to create the queen ant, I got the MadTank to work but I am having an issue when adding healing. This exception crashes the game after the ant turns to to heal the other ant, it crashes right as it should heal it.

Exception of type `System.InvalidOperationException`: TypeDictionary contains multiple instances of type `OpenRA.Traits.IQuantizeBodyOrientationInfo`
at OpenRA.Primitives.TypeDictionary.GetOrDefault (System.Type t) [0x00000] in <filename unknown>:0
at OpenRA.Primitives.TypeDictionary.GetOrDefault[IQuantizeBodyOrientationInfo] () [0x00000] in <filename unknown>:0
at OpenRA.Traits.BodyOrientation+<BodyOrientation>c__AnonStorey0.<>m__0 () [0x00000] in <filename unknown>:0
at System.Lazy`1[System.Int32].CreateValue () [0x00075] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.0/external/referencesource/mscorlib/system/Lazy.cs:440

https://gist.github.com/anonymous/2b5791129e41aa4619c8

A link to my Queen Ant yaml^^

Thanks all for your help :D Hoping to create a fun mod map soon.

Posted: Tue Aug 04, 2015 11:58 pm
by Graion Dilach
MadTank requires WithFacingSpriteBody in playtest and RenderUnit in last release, which are probably already inherited from ^Tank, your crash is caused by the fact that you're using WithInfantryBody and you don't remove the inherited renderer trait.

Posted: Wed Aug 05, 2015 3:51 am
by raymundo
Thanks, I simply removed the withinfantrybody and it works now, the reason i put that on there was because it was on the medic unit, should've remembered i was really using a tank.

Posted: Wed Aug 05, 2015 7:36 pm
by raymundo
http://resource.openra.net/maps/3998

My map is up if anyone wants to try. This is my first mod map, comments and critique welcomed! This idea was inspired by Zjordy's map Ant Base

3v9 map where soviets (the 3) play as ant faction:

Kennel:
- gives spy satellite (ant vision)
- Cash trickler built into their kennel
4 Buildable units:

-Worker Ant High Hp, cheap, and strong close range attack
-Electric Ant- High Hp, longer build time but uses a stronger version of tesla tank cannon
-Flying Ant - Low hp, Fast, flamethrower weapon and rocketeer missiles for anti-air
-Queen Ant- M.A.D. Tank that also acts as a medic to the worker and electric ant.

The Allie team starts with limited bases and 2 engineers each. There are many buildings to capture on the map, including 3 service depots so it is possible to get mcv if the wrong person doesn't capture these. Id say ants have the early advantage, if they don't stop the allies from building up they are more likely to lose.

Posted: Mon Aug 10, 2015 6:01 am
by eddie
Nice Map!

Tschokky created a cool new interior tileset (http://cnc-comm.com/community/index.php?topic=4294.0). You could use that for a map inside the ant hill.

I think that would be fun!