Decreasing power requirements

Information and discussion for custom maps and mods.
User avatar
Blackened
Posts: 347
Joined: Sat May 21, 2016 6:27 pm

Decreasing power requirements

Post by Blackened »

I'm not much of a modder, and by that I mean none. Is it possible to decrease the power consumption for 3 neutral buildings so that when captured they don't eat up power?

And if it is, could someone kindly point me in the right direction to do that? Thanks. :)

User avatar
Murto the Ray
Posts: 487
Joined: Mon Nov 10, 2014 4:34 pm

Post by Murto the Ray »

All of the actor definitions go below the "Rules:" bit of your map.yaml. Something like this would reduce the soviet barracks' power consumption to 0:

Code: Select all

Rules:
	BARR:
		Power:
			Amount: 0
The "BARR:" bit means you are redefining some parameters of the barracks, the "Power:" trait means you are redefining something to do with the power and the "Amount: 0" redefines the amount of power that that barracks uses.

You can find a complete list of traits here! :D

User avatar
Blackened
Posts: 347
Joined: Sat May 21, 2016 6:27 pm

Post by Blackened »

Wouldn't that set any soviet barracks to 0 power drain?

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

Post by Graion Dilach »

Yes, that would.

If you want to change 3 exact building on the map like that, you have to clone their type into a new one (XY: Inherits: type RenderSprites: type, with ofc proper indenting) and replace the three instances with your new type.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

User avatar
Blackened
Posts: 347
Joined: Sat May 21, 2016 6:27 pm

Post by Blackened »

Ok I stayed up all night trying to figure this out. I made some progress. Baby steps. Baby steps.

90% of what you just said went straight over my head :P but I'm going to assume that is the sleep deprivation and not my complete lack of understanding what the hell I'm doing. :)

User avatar
Blackened
Posts: 347
Joined: Sat May 21, 2016 6:27 pm

Post by Blackened »

Ok al I did was copy everything from "fix" and changed this to fix2, then replaced the actor with fix2. But when I try to view the map the game crashes what have I missed?

Code: Select all

FIX2:
	Inherits: ^BaseBuilding
	Valued:
		Cost: 500
	Tooltip:
		Name: Repair Facility
		Description: Repairs vehicles	Footprint: _x_ xxx _x_
		Dimensions: 3,3
	Selectable:
		Bounds: 64,34,0,3
	SelectionDecorations:
		VisualBounds: 72,48
	Health:
		HP: 600
	RevealsShroud:
		Range: 5c0
	Bib:
		HasMinibib: Yes
	Reservable:
	RepairsUnits:
		Interval: 15
	RallyPoint:
	WithRepairAnimation:
	Power:
		Amount: 0

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

Post by Graion Dilach »

fix2 requires to need RenderSprites: Image: fix. It has no artwork atm.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

User avatar
Blackened
Posts: 347
Joined: Sat May 21, 2016 6:27 pm

Post by Blackened »

Code: Select all

fix2:
	Inherits: ^BaseBuilding 
	Valued: 
	Cost: 500 
	Tooltip: 
	Name: Repair Facility 
	Description: Repairs vehicles   Footprint: _x_ xxx _x_ 
	Dimensions: 3,3 
	Selectable: 
	Bounds: 64,34,0,3 
	SelectionDecorations: 
	VisualBounds: 72,48 
	Health: 
	HP: 600 
RevealsShroud: 
Range: 5c0 
Bib: 
	HasMinibib: Yes 
Reservable: 
RepairsUnits: 
	Interval: 15 
	RallyPoint: 
	WithRepairAnimation: 
Power: 
	Amount: 0
RenderSprites:
	Image:
	fix
added but still crashing. is there something else I'm doing (or not doing)?

User avatar
Murto the Ray
Posts: 487
Joined: Mon Nov 10, 2014 4:34 pm

Post by Murto the Ray »

"fix" needs to be after "Image:" on the same line

User avatar
Blackened
Posts: 347
Joined: Sat May 21, 2016 6:27 pm

Post by Blackened »

Still crashing. Where exactly should this code be inserted?

Also thanks for the help thus far. :)

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

Post by Graion Dilach »

Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

User avatar
Blackened
Posts: 347
Joined: Sat May 21, 2016 6:27 pm

Post by Blackened »

I meant into the correct .yaml file.

User avatar
Blackened
Posts: 347
Joined: Sat May 21, 2016 6:27 pm

Post by Blackened »

Ok I think I got almost everything out, but now I'm getting this:


Tiberian Dawn Mod at Version release-20160508
Operating System: Windows (Microsoft Windows NT 6.1.7601 Service Pack 1)
Runtime Version: .NET CLR 4.0.30319.42000
Exception of type `System.AggregateException`: One or more errors occurred.
Inner Exception of type `System.InvalidOperationException`: Cannot locate type: RenderspritesInfo
at OpenRA.ObjectCreator.<MissingTypeAction>m__7(String s)
at OpenRA.ObjectCreator.CreateObject[T](String className, Dictionary`2 args)
at OpenRA.ObjectCreator.CreateObject[T](String className)
at OpenRA.ActorInfo.LoadTraitInfo(ObjectCreator creator, String traitName, MiniYaml my)
at OpenRA.ActorInfo..ctor(ObjectCreator creator, String name, MiniYaml node)
at OpenRA.Ruleset.<LoadDefaults>c__AnonStorey0.<>m__1(MiniYamlNode k)
at OpenRA.Exts.ToDictionaryWithConflictLog[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, String debugName, Func`2 logKey, Func`2 logValue)
at OpenRA.Ruleset.MergeOrDefault[T](String name, IReadOnlyFileSystem fileSystem, IEnumerable`1 files, MiniYaml additional, IReadOnlyDictionary`2 defaults, Func`2 makeObject)
at OpenRA.Ruleset.<LoadDefaults>c__AnonStorey0.<>m__0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at OpenRA.Ruleset.LoadDefaults(ModData modData)
at OpenRA.ModData.<ModData>m__2()
at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Lazy`1.get_Value()
at OpenRA.ModData.get_DefaultRules()
at OpenRA.Ruleset.LoadDefaultsForTileSet(ModData modData, String tileSet)
at OpenRA.Map.PostInit()
at OpenRA.Map..ctor(ModData modData, IReadOnlyPackage package)
at OpenRA.ModData.PrepareMap(String uid)
at OpenRA.Game.StartGame(String mapUID, WorldType type)
at OpenRA.Game.LoadShellMap()
at OpenRA.Mods.Common.LoadScreens.BlankLoadScreen.StartGame(Arguments args)
at OpenRA.Game.InitializeMod(String mod, Arguments args)
at OpenRA.Game.Initialize(Arguments args)
at OpenRA.Program.Run(String[] args)
at OpenRA.Program.Main(String[] args)

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

Post by Graion Dilach »

It's RenderSprites not Rendersprites. This game is case-sensitive.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

User avatar
Blackened
Posts: 347
Joined: Sat May 21, 2016 6:27 pm

Post by Blackened »

Alright all but 1 thing is working now. I tried looking through all the traits to see if there was a specific one I was missing but I can't seem to find it. The modified repair facility won't allow units on to be repaired. Do you know how I would go about doing that?

Post Reply