Tweak-List

Collection Of Small Tweaks

Information and discussion for custom maps and mods.
Post Reply
User avatar
Petrenko
Posts: 156
Joined: Fri Apr 08, 2011 5:36 pm

Tweak-List

Post by Petrenko »

Greetings,

i thought it might be of use for everyone (and myself) to have a list of small tweaks everyone could apply within 5 minutes.

Before i create the list i want to gather a few tweaks. So everyone is invited to add questions, tweaks and comments.

Also know that i'm not a modder/coder or anything. I got almost no knowledge how to do anything more complicated then adding or changing a few lines. But i think this is still enough to manage this list.

Before you edit any .yaml: (Needs to be edited for better understanding.)

1.

I truely recommand to use NotePad 2 to edit.
If you copy/ edit lines be sure to use space correctly. (In Notepad 2 get to View / Show Whitespace)
White space is then marked by arrows.
You will notice before a trait there is 1 orange arrow. Then everything that belongs to the trait there are 2 orange arrows in front of it.
A trait will NOT work if you just press space a lot and then just get some orange points in front of it. So better copy an arrow and paste it.

2.

Trait names are case sensitive. So SelfHealing and not selfhealing. S and H need to be capital-letters.

Tweaklist:

Adding a cashtrickler

To make a structure create money you can add this:

Code: Select all

CashTrickler:
      Amount: 20                (How much it adds)
      Period: 50                  (Time between creating money)
      ShowTicks: True       (Shows the money above the building)
      TickLifetime: 30         (How long you can  see text showing the money)
      TickVelocity: 1          (How fast the text showing the money moves up)
If you just add CashTrickler: it will set the rest to the defaults seen in the example.

Make a unit heal itself (Like mammoth) - Thanks to Nudalz

Code: Select all

SelfHealing:
		Step: 5
		Ticks: 5
		HealIfBelow: 1 	
Give each building the possibility to have it's own productionqueue. (Like in RA)

1. Open up /ra/rules/system
2. Right at the beginning there are productionqueue's for everything you need. (Infantry, Vehicle, etc...)
3. Delete them
4. Add this to a structure in /ra/rules/structures

Code: Select all

	ProductionQueue:
		Type: Vehicle
		BuildSpeed: .4
		LowPowerSlowdown: 3
You can change the type to whatever you want.
There is: Infantry, Aircraft, Vehicle,Building,Defense

Give a unit the ability to have it's own productionqueue.

1. Do as in mentioned in the tweak before
2. Add following traits to your unit:

Code: Select all

RallyPoint:
	Exit@1:
		SpawnOffset: -1,19
		ExitCell: 0,2
	Exit@2:
		SpawnOffset: -17,15
		ExitCell: 0,2
	ProductionBar:
	ProductionQueue:
		Type: Infantry
		BuildSpeed: .4
		LowPowerSlowdown: 3
	Production:
		Produces: Infantry
	PrimaryBuilding:
Note:

Most of my tweaks are in my mod Ra-Remixed
(don't want to advertise it but you can use it to have examples)

As always,

thanks in advance for any help.
Last edited by Petrenko on Tue May 17, 2011 12:47 pm, edited 8 times in total.

User avatar
hamb
Posts: 112
Joined: Mon Oct 18, 2010 4:57 pm

Post by hamb »

Hey Petrenko :D

There's actually an OpenRA wiki -- although barren at the moment, it already has some information about these traits you can use for modding :) see: https://github.com/OpenRA/OpenRA/wiki/T ... umentation

This is where any awesome discussion or information on traits will be. Anyone should feel free to update it

Devs, feel free to correct me! To find out these traits I grabbed a copy of the source code, and many (all?) are located in the root of the OpenRA.Mods.RA project (example: SelfHealing.cs). From looking at SelfHealing in the source code, I can see:

Code: Select all

public readonly int Step = 5;
public readonly int Ticks = 5;
public readonly float HealIfBelow = .5f;
So, what this means is these are the default values for these traits. Put "SelfHealing:" on a unit, and it will be met with those default values for step, ticks, and healIfBelow (5, 5, 0.5)

Now, from looking at the code, I am guessing:
Step: 5 (heal amount) -- I wonder if you can put negative Step to inflict damage? That would require testing.
Ticks: 5 (how many game ticks (not sure if this is true) between healing.
HealIfBelow: 0.5 (heal unit if below N % of health)

Sorry if I'm being overly descriptive by this point! If you wanted a unit to heal all the time, you could..

Code: Select all

SelfHealing:
    Step: 5
    Ticks: 5
    HealIfBelow: 1
Now, about visceroid -- in OpenRA.Mods.CNC, there is a class known as SpawnVisceroid.cs

Code: Select all

public readonly string ViceroidActor = "vice";
public readonly int Probability = 10;
public readonly string Owner = "Creeps";
public readonly int InfDeath = 5;
Finding out requires asking devs or experimenting yourself :)

GivesExperience is a bit complicated, so try some things out!

Code: Select all

public readonly float[] CostThreshold = { 2, 4, 8, 16 };
public readonly float[] FirepowerModifier = { 1.1f, 1.15f, 1.2f, 1.5f };
public readonly float[] ArmorModifier = { 1.1f, 1.2f, 1.3f, 1.5f };
public readonly decimal[] SpeedModifier = { 1.1m, 1.15m, 1.2m, 1.5m };
{a,b,c,} is an array - you might be able to try ArmorModifier=2,3,4,5 in the yaml.

Finding out about these traits doesn't require any coding skills, check out these files

https://github.com/OpenRA/OpenRA/tree/m ... RA.Mods.RA
Last edited by hamb on Sat Apr 16, 2011 11:08 pm, edited 1 time in total.

User avatar
Sleipnir
Posts: 878
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Post by Sleipnir »

SpawnViceroid is simple enough: When a unit with this trait is killed by a weapon with the specified <InfDeath>, there is a <Probaility> in 100 chance that <ViceroidActor> will be spawned, owned by <Owner>.

To have a unit continuously heal, you'll want to set HealIfBelow to 1, setting it to 0 will ensure it will never heal ;)

User avatar
hamb
Posts: 112
Joined: Mon Oct 18, 2010 4:57 pm

Post by hamb »

my bad. thanks!

gamefreak11221
Posts: 12
Joined: Fri Apr 15, 2011 8:56 am

Post by gamefreak11221 »

Do cash trickler makes money without harvester?

I did put cash tricler for the refinery but nothing works

User avatar
Petrenko
Posts: 156
Joined: Fri Apr 08, 2011 5:36 pm

Post by Petrenko »

My bad.

I didn't know something like this already exist.

So... close/kill topic? How to?

chrisf
Posts: 246
Joined: Mon Sep 06, 2010 4:59 am

Post by chrisf »

@Petrenko: no, keep discussing this, we'll just take the results and transfer them to the docs wiki.

User avatar
Petrenko
Posts: 156
Joined: Fri Apr 08, 2011 5:36 pm

Post by Petrenko »

Alright then,

i tried adding

Code: Select all

Selfhealing&#58;
		Step&#58; 5
		Ticks&#58; 5
		Healifbelow&#58; 1
But i got an exception log:

System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.InvalidOperationException: Cannot locate type: SelfhealingInfo
bei OpenRA.ObjectCreator.<MissingTypeAction>m__2(String s)
bei OpenRA.ObjectCreator.CreateObject[T](String className, Dictionary`2 args)
bei OpenRA.ActorInfo..ctor(String name, MiniYaml node, Dictionary`2 allUnits)

Haven't tested anything else for now. (i'm on vacation)

Thanks so far everyone.

@Nudalz

The more you describe the better it is. I realy like it this way.

@Gamefreak

I added a cashtrickler to the silo. Here is the whole entry:

Code: Select all

SILO&#58;
	Inherits&#58; ^Building
	Valued&#58;
		Cost&#58; 500
	Tooltip&#58;
		Name&#58; Tiberium Silo
		Icon&#58; siloicnh
		Description&#58; Stores processed Tiberium
	Buildable&#58;
		Queue&#58; Defense
		BuildPaletteOrder&#58; 20
		Prerequisites&#58; anypower
		Owner&#58; gdi,nod
	&#91;b&#93;CashTrickler&#58; 
		Period&#58; 200
		Amount&#58;  20&#91;/b&#93;
	Building&#58;
		Power&#58; -10
		Footprint&#58; xx
		Dimensions&#58; 2,1
		Capturable&#58; true
		BaseNormal&#58; no
	Health&#58;
		HP&#58; 400
	RevealsShroud&#58;
		Range&#58; 4
	RenderBuildingOre&#58;
	StoresOre&#58;
		PipCount&#58; 5
		PipColor&#58; Green
		Capacity&#58; 1000
	-RenderBuilding&#58;
	-EmitInfantryOnSell&#58;

User avatar
Sleipnir
Posts: 878
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Post by Sleipnir »

Trait names are case sensitive. The 'h' in SelfHealing should be capitalized. That exception is telling you that you are trying to add an trait that doesn't exist.

User avatar
Petrenko
Posts: 156
Joined: Fri Apr 08, 2011 5:36 pm

Post by Petrenko »

@ nudalz

i've read a bit about editing dll's.
Is it possible to manage tweaking them in a few minutes?
(i know it kind of a luxus-problem (hope this word exists in english))

Question::

Is there a way to make special powers cost money and set time to zero?

Problem:

After a unit gets a rank up it doesn't autoheal anymore. Why?

chrisf
Posts: 246
Joined: Mon Sep 06, 2010 4:59 am

Post by chrisf »

>Problem:
>After a unit gets a rank up it doesn't autoheal anymore. Why?

Healing works by inflicting negative damage. Ranked units have an armor bonus, which is just multiplied by the damage taken. So you'd try to do -1 damage, get scaled to -0.8 or something, rounded toward zero => 0 damage, autoheal broken.

This is fixed in 0602 -- armor modifiers are no longer applied to negative damage. This also fixes the service depot, etc.

chrisf
Posts: 246
Joined: Mon Sep 06, 2010 4:59 am

Post by chrisf »

> Is there a way to make special powers cost money and set time to zero?

You can set the time to zero easily enough. We'd have to add support for costing money, and UI for it, etc. Not a huge deal -- file a feature ticket at http://bugs.open-ra.org and it will happen.

Post Reply