Page 1 of 1

Cannot add turret to cnc

Posted: Wed Jun 23, 2021 2:08 pm
by Gijsdemik
Hi all!

I just found OpenRa, and its awesome. i already changed cnc to my liking planning on playing whit some friends.
But now i tried to add a new building and i get an exception "Exception of type `System.IO.FileNotFoundException`: File not found: gunbmake.shp"

I wanted to clone the turret and give it a long range weapon. so i tried copy the entrees in structures and seq/structures
i copied Gun: in both structures and in sequences/structures. i tried looking for the normal Gunmake.shp but i cant find it any where i looked around also for gun.shp i dont even know what a shp is. for reference here is what i did to the orginal code.
I chagend all Gunmakes to Gunbmake, note: i also tried leaving gunmake like it was but that threw an exception too
"gunb:
idle: gunbmake # Empty first frame. We need WithSpriteBody for the make anim, and WSB needs at least a placeholder default sequence to work
turret:
Facings: 32
UseClassicFacings: True
recoil:
Start: 32
Facings: 32
UseClassicFacings: True
damaged-turret:
Start: 64
Facings: 32
UseClassicFacings: True
damaged-recoil:
Start: 96
Facings: 32
UseClassicFacings: True
make: gunbmake
Length: *
Tick: 80
muzzle: gunfire2
Length: *
bib: mbGUN
UseTilesetExtension: true
TilesetOverrides:
WINTER: TEMPERAT
JUNGLE: TEMPERAT
SNOW: TEMPERAT
Length: *
Offset: -1,-1
icon: gunicnh.tem
AddExtension: False"
and the structure file
"GUNb:
Inherits: ^Defense
Inherits@AUTOTARGET: ^AutoTargetGround
Selectable:
Bounds: 24,24
Valued:
Cost: 700
Tooltip:
Name: Turretx
Buildable:
BuildPaletteOrder: 45
Prerequisites: barracks
Queue: Defence.GDI, Defence.Nod
BuildDuration: 960
Description: Basic Anti-Tank base defense.\n Strong vs Tanks, vehicles\n Weak vs Infantry
Building:
Health:
HP: 56000
Armor:
Type: Heavy
RevealsShroud:
Range: 6c0
WithBuildingBib:
HasMinibib: true
Turreted:
TurnSpeed: 48
InitialFacing: 192
RealignDelay: -1
RequiresCondition: !build-incomplete
WithSpriteTurret:
RequiresCondition: !build-incomplete
Recoils: false
WithTurretAttackAnimation:
Sequence: recoil
Armament:
Weapon: TurretGunX
LocalOffset: 512,0,112
MuzzleSequence: muzzle
AttackTurreted:
RequiresCondition: !build-incomplete
WithMuzzleOverlay:
-WithDeathAnimation:
DetectCloaked:
Range: 3c0
Power:
Amount: -20
-BodyOrientation:
ClassicFacingBodyOrientation:"

i hope you can hellp me out i have some experience in coding and i could not find any how to do this online.

Re: Cannot add turret to cnc

Posted: Wed Jun 23, 2021 7:00 pm
by abcdefg30
What was the exception you got when you used "gunmake"? (I'd assume it was looking for "gunb.shp"?)
If you don't want to change the graphics I would delete the gunb sequences again and add the following to the gunb rules:

Code: Select all

RenderSprites:
	Image: GUN # if that doesn't work try lower case "gun"

Re: Cannot add turret to cnc

Posted: Fri Jun 25, 2021 10:22 am
by Gijsdemik
Yes indeed it was looking for gunb.shp,
This is the full exception.
"OpenRA engine version release-20210321
Tiberian Dawn mod version release-20210321
on map 242a4cb0e33f137d4a5108289c2d3af3dacc5a0f (Armageddon by J MegaTank).
Date: 2021-06-25 10:20:08Z
Operating System: Windows (Microsoft Windows NT 6.2.9200.0)
Runtime Version: .NET CLR 4.0.30319.42000
Exception of type `System.IO.FileNotFoundException`: File not found: gunb.shp
bij OpenRA.Mods.Common.Graphics.FileNotFoundSequence.OpenRA.Graphics.ISpriteSequence.get_Tick()
bij OpenRA.Graphics.Animation.PlaySequence(String sequenceName)
bij OpenRA.Graphics.Animation.PlayThen(String sequenceName, Action after)
bij OpenRA.Mods.Common.Traits.Render.WithSpriteTurretInfo.<RenderPreviewSprites>d__6.MoveNext()
bij OpenRA.Mods.Common.Traits.Render.RenderSpritesInfo.<RenderPreview>d__6.MoveNext()
bij System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
bij System.Linq.Buffer`1..ctor(IEnumerable`1 source)
bij System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
bij OpenRA.Mods.Common.Traits.ActorPreviewPlaceBuildingPreviewPreview..ctor(WorldRenderer wr, ActorInfo ai, ActorPreviewPlaceBuildingPreviewInfo info, TypeDictionary init)
bij OpenRA.Mods.Common.Traits.ActorPreviewPlaceBuildingPreviewInfo.CreatePreview(WorldRenderer wr, ActorInfo ai, TypeDictionary init)
bij OpenRA.Mods.Common.Orders.PlaceBuildingOrderGenerator.VariantWrapper..ctor(WorldRenderer wr, ProductionQueue queue, ActorInfo ai)
bij OpenRA.Mods.Common.Orders.PlaceBuildingOrderGenerator..ctor(ProductionQueue queue, String name, WorldRenderer worldRenderer)
bij OpenRA.Mods.Common.Widgets.ProductionPaletteWidget.PickUpCompletedBuildingIcon(ProductionIcon icon, ProductionItem item)
bij OpenRA.Mods.Common.Widgets.ProductionPaletteWidget.HandleLeftClick(ProductionItem item, ProductionIcon icon, Int32 handleCount, Modifiers modifiers)
bij OpenRA.Mods.Common.Widgets.ProductionPaletteWidget.HandleEvent(ProductionIcon icon, MouseButton btn, Modifiers modifiers)
bij OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
bij OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
bij OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
bij OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
bij OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
bij OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
bij OpenRA.Widgets.Ui.HandleInput(MouseInput mi)
bij OpenRA.DefaultInputHandler.<>c__DisplayClass5_0.<OnMouseInput>b__0()
bij OpenRA.Sync.RunUnsynced[T](Boolean checkSyncHash, World world, Func`1 fn)
bij OpenRA.Platforms.Default.Sdl2Input.PumpInput(Sdl2PlatformWindow device, IInputHandler inputHandler, Nullable`1 lockedMousePosition)
bij OpenRA.Platforms.Default.Sdl2PlatformWindow.PumpInput(IInputHandler inputHandler)
bij OpenRA.Renderer.EndFrame(IInputHandler inputHandler)
bij OpenRA.Game.RenderTick()
bij OpenRA.Game.Loop()
bij OpenRA.Game.Run()
bij OpenRA.Game.InitializeAndRun(String[] args)
bij OpenRA.WindowsLauncher.WindowsLauncher.RunGame(String[] args)

Thanks you for your response, i will remove gunb from the sequence/structure and add your line to my gunb rules, i hope it works
"

Re: Cannot add turret to cnc

Posted: Fri Jun 25, 2021 10:56 am
by Gijsdemik
If i remove Gunb completly from the sequence/structures and add
RenderSprites:
Image: GUN/gun

I get this exeption.

Exception of type `OpenRA.YamlException`: Actor type gunb: Junk value `GUN` on trait node Image

I also tried
Inherits:Gun at both structures .yalm and sequence/structures.yalm, i then got an error stating cannot find icon.
When i tried to put the orignal icon into gunb (icon: gunicnh.tem)
I got en error stating cannot find icon: gunicnh.tem.shp

I also tried inherits at seq/structures, and adding this to gunb,

gunb:
Inherits: gun
RenderSprites:
Image: gun
and in /structures.
GUNB:
Inherits: GUN
Inherits@AUTOTARGET: ^AutoTargetGround
then i get this error,
Exception of type `OpenRA.YamlException`: Actor type gunb: Junk value `gunicnh.tem` on trait node icon
i am not sure what is going on but it should not be this hard to clone a building and add a different weapon?

Re: Cannot add turret to cnc

Posted: Sun Jun 27, 2021 9:08 pm
by abcdefg30
Something seems to be wrong with your indentation if it complains about junk values. Did you use the correct amount of tabs? (Don't use spaces)