Page 1 of 2

Adding a new Side?

Posted: Thu Sep 09, 2010 3:23 pm
by raminator
Hello everyone.
i tried to add a new side to ra by adding some stuff to the yaml-files and xmls.

if i play solo withou AI, everything seems to work fine, but once i try a game with AI i get this IE...

Code: Select all

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at OpenRA.Sound.PlayVoice(String phrase, Actor voicedUnit, String variant)
   at OpenRA.Selection.Combine(World world, IEnumerable`1 newSelection, Boolean isCombine, Boolean isClick)
   at OpenRA.Widgets.WorldInteractionControllerWidget.HandleInputInner(MouseInput mi)
   at OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
   at OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
   at OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
   at OpenRA.Widgets.Widget.HandleInput(World world, MouseInput mi)
   at OpenRA.Game.DispatchMouseInput(MouseInputEvent ev, MouseEventArgs e, Modifiers modifierKeys)
   at OpenRA.GlRenderer.GraphicsDevice.Present()
   at OpenRA.Graphics.Renderer.EndFrame()
   at OpenRA.Graphics.Viewport.DrawRegions(World world)
   at OpenRA.Game.Tick()
   at OpenRA.Game.Run()
   at OpenRA.Program.Run(String[] args)
   at OpenRA.Program.Main(String[] args)
any Idea?

Edit:
to be more exactly. the game IE´s as soon as i select my new countries MCV.
without AI this works without any problem

Posted: Thu Sep 09, 2010 7:22 pm
by chrisf
You'll need to do some setup for your new side in voices.yaml

Posted: Thu Sep 09, 2010 7:40 pm
by raminator
ok...will look at it...
but i think i already edited that file

somewat like this
soviet: .r01,.r03
allies: .v01,.v03
test: .r01,.r03

or do i need to have seperate samples for each side like ".t01" ?

Posted: Thu Sep 09, 2010 8:10 pm
by chrisf
That should work. The MCV uses the vehicle voice, make sure it's correct.

If you still have trouble, paste your hacked file somewhere and I'll take a look.

Posted: Sat Sep 11, 2010 3:31 pm
by raminator
ok...the mcv is not a problem anymore...
last time game crashed because i selected a harvester.
things i changed in voices.yaml was to give my testcountry own entry with .t01/2/3 and copied to \extra\ the soviet soundfiles and renamed them to *.t01/2/3
and to be sure i put copied those in a mix named test.mix too.

will test some more and tell you if i was able to get it working

Posted: Wed Sep 15, 2010 2:41 pm
by raminator
tested some more with actual version (both cnc and ra) and the game ies randomly when I select a unit (infantry or vehicles).
like when I select some E1 they say "hello". a couple of times later the game ies when I select those E1 again.
and since I checked everything a couple of times I doupt that I made an error...

debug.log says: "Failed generating OpenAL source 30"
exception.log says:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at OpenRA.Sound.PlayVoice(String phrase, Actor voicedUnit, String variant)
at OpenRA.Selection.Combine(World world, IEnumerable`1 newSelection, Boolean isCombine, Boolean isClick)
at OpenRA.Widgets.WorldInteractionControllerWidget.HandleInputInner(MouseInput mi)
at OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
at OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
at OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
at OpenRA.Widgets.Widget.HandleInput(World world, MouseInput mi)
at OpenRA.Game.DispatchMouseInput(MouseInputEvent ev, MouseEventArgs e, Modifiers modifierKeys)
at OpenRA.GlRenderer.GraphicsDevice.Present()
at OpenRA.Graphics.Renderer.EndFrame()
at OpenRA.Graphics.Viewport.DrawRegions(World world)
at OpenRA.Game.Tick()
at OpenRA.Game.Run()
at OpenRA.Program.Run(String[] args)
at OpenRA.Program.Main(String[] args)

have you ever tried adding a new side/country and can confirm that it works?

thanks again

Posted: Wed Sep 15, 2010 8:04 pm
by chrisf
Well, there's nothing special about the "builtin" sides -- they are done exactly the same way. I will have a look tonight.

Posted: Thu Sep 16, 2010 2:36 pm
by raminator
thank you =)
one thing that seems to be working fine is adding new units...
got to try if it works with AI too

thanks again

Posted: Mon Sep 20, 2010 3:14 pm
by raminator
i have now the problem again, that once i select my mcv the game IEs...
with happens with my new and the 2 standard sides.

Code: Select all

debug.log says:
Failed generating OpenAL source 30

exception.log says:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at OpenRA.Sound.PlayVoice(String phrase, Actor voicedUnit, String variant)
   at OpenRA.Selection.Combine(World world, IEnumerable`1 newSelection, Boolean isCombine, Boolean isClick)
   at OpenRA.Widgets.WorldInteractionControllerWidget.HandleInputInner(MouseInput mi)
   at OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
   at OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
   at OpenRA.Widgets.Widget.HandleMouseInputOuter(MouseInput mi)
   at OpenRA.Widgets.Widget.HandleInput(World world, MouseInput mi)
   at OpenRA.Game.DispatchMouseInput(MouseInputEvent ev, MouseEventArgs e, Modifiers modifierKeys)
   at OpenRA.GlRenderer.GraphicsDevice.Present()
   at OpenRA.Graphics.Renderer.EndFrame()
   at OpenRA.Graphics.Viewport.DrawRegions(World world)
   at OpenRA.Game.Tick()
   at OpenRA.Game.Run()
   at OpenRA.Program.Run(String[] args)
   at OpenRA.Program.Main(String[] args)
i attached my rules, mod.yaml, voices.yaml, chrome.xml...

Posted: Mon Sep 20, 2010 8:40 pm
by chrisf
You appear to have uploaded a zip containing OpenRA.Game.exe and nothing else. Did you mean to upload something else?

Posted: Tue Sep 21, 2010 3:27 pm
by raminator
my fault...
here´s the correct zip

Posted: Thu Oct 14, 2010 5:12 pm
by raminator
any news here?
i tested this again and again with fresh installs of openra and yaml-editing from scratch...
but always the same errors.

how does this exactly work?
- i edited chrome.xml to have entries for "test" (using chrome-allies.png)
- i edited voices.yaml to have sounds for "test"
- i added "test"/"Test" as new "Country@2" to system.yaml
- i gave them all allied units and buildings via infantry.yaml, structures.yaml, vehicles.yaml

and every now and then the game IEs when i select a unit

i will try now removing all voices from all units to see if this helps

UPDATE1:
i gave all infantry, that is using the generic voices, the medic voices and no crash...
so either i did something terribly wrong with thos generic voices for all units or there´s some bugs in that system...

UPDATE2:
giving vehicles engineer voices fixed the problem
so as far as i understand the yaml-files there must be some error in the generic-voices-code for units (atleast if there´s a third country)
can this be fixed by editing the dll-files?

Posted: Thu Oct 14, 2010 8:43 pm
by Sleipnir
I can reproduce your crash, and will look into fixing it.

Edit: Fixed. http://github.com/pchote/OpenRA/commit/49bfd697

Posted: Fri Oct 15, 2010 4:16 am
by raminator
that´s good news! =)

Posted: Sun Oct 17, 2010 12:51 am
by Iran
Any updates? Did you get a third side completely functional?