Page 1 of 1

Can someone point out what I have done wrong with this YAML

Posted: Sat Oct 28, 2017 6:43 am
by traincrazy484
So I have been tinkering around with openra files, and I tried to create a build-able Badger Bomber. However I seem to have run into a bit of a bother with the Badger icon. So here is the Yaml.

Bomber:
Inherits: ^Plane
Inherits@AUTOTARGET: ^AutoTargetGroundAssaultMove
Buildable:
Queue: Aircraft
BuildAtProductionType: Plane
BuildPaletteOrder: 30
Prerequisites: ~afld, ~techlevel.medium
Description: Anti-Tanks & Anti-Infantry Plane.\n Strong vs Infantry, Vehicles\n Weak vs Aircraft
Valued:
Cost: 250
Tooltip:
Name: Tu-16 Badger
Health:
HP: 60
Armor:
Type: Light
RevealsShroud:
Range: 11c0
Type: GroundPosition
RevealGeneratedShroud: False
RevealsShroud@GAPGEN:
Range: 9c0
Type: GroundPosition
Armament@PRIMARY:
Weapon: ChainGun.Yak
LocalOffset: 256,-213,0
MuzzleSequence: muzzle
Armament@SECONDARY:
Name: secondary
Weapon: ChainGun.Yak
LocalOffset: 256,213,0
MuzzleSequence: muzzle
Armament@SECONDARY:
Name: secondary
Weapon: Napalm
LocalOffset: 85,213,-85
AttackPlane:
FacingTolerance: 20
Aircraft:
CruiseAltitude: 2560
InitialFacing: 192
TurnSpeed: 4
Speed: 178
RepulsionSpeed: 40
MaximumPitch: 56
AutoTarget:
InitialStance: HoldFire
InitialStanceAI: HoldFire
AmmoPool:
Ammo: 999999999
PipCount: 6
ReloadDelay: 11
ReturnOnIdle:
SelectionDecorations:
VisualBounds: 30,28,0,2
WithMuzzleOverlay:
Contrail:
Offset: -853,0,0
SpawnActorOnDeath:
Actor: BADR.Husk
SmokeTrailWhenDamaged:
Offset: -853,0,0
Interval: 2
ProducibleWithLevel:
Prerequisites: aircraft.upgraded
RenderSprites:
Image: badr
Icon: badricon.shp


Here is the Error code I got with it.

OpenRA.Utility(1,1): Error: Failed with exception: System.AggregateException: One or more errors occurred. ---> OpenRA.YamlException: Actor type bomber: Junk value `badricon.shp` on trait node Icon
at OpenRA.ActorInfo..ctor(ObjectCreator creator, String name, MiniYaml node) in c:\Users\bobda\Desktop\OpenRAModSDK-


A few notes I would like to leave:

1. I copy-pasted the yak code and changed few things as this was a test.
2. I modified the Yak weapons , However the modded Yak (which I copy-pasted from) worked fine beforehand.
3. I have tried typing without .shp at the end.
4.I have tried using IconPalette.
5. The badger icon was already in the regular openra files.

I've tried all sorts of things but I can't seem to get to work. I feel like I did something wrong here. In case this not legible for you guys I'm going to leave the yaml file on here as well.

Posted: Sat Oct 28, 2017 7:05 am
by MustaphaTR
You should define the Icon on sequence code not, rule.

Posted: Sat Oct 28, 2017 6:06 pm
by traincrazy484
Alright I did that, but now its saying its missing icon info.

bomber:
idle:
Facings: 16
icon: badricon


OpenRA.Utility(1,1): Error: Missing Type: IconInfo

Posted: Sun Oct 29, 2017 8:28 am
by MustaphaTR
Game is still trying to read it as a rule code. You need to put the sequence code under Sequences/aircraft.yaml.

Posted: Sun Oct 29, 2017 8:30 pm
by traincrazy484
The thing that throwing me off, is that the code I posted yesterday is what I put In Sequences/Aircraft. I removed the Icon from the Rules/Aircraft.yaml too just to make sure it wasn't conflicting or something.

Posted: Mon Oct 30, 2017 5:17 am
by MustaphaTR
There shouldn't be an Icon: tag on rule file, if you removed it, it should work fine.

Posted: Mon Oct 30, 2017 6:22 am
by traincrazy484
Well I don't know what to say , I suppose its just a fluke then. I'm going to write this off as a no go and just lower the cool down for the Para Bombs. :)[/img]