.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   SE5 - Mod Out LCX as Early Warship (http://forum.shrapnelgames.com/showthread.php?t=30410)

Fyron September 21st, 2006 04:26 PM

SE5 - Mod Out LCX as Early Warship
 
As an example of the flexibility of the SE5 data format, I present to you a way to kill the gamey tactic of using light carriers as warships early on. This could also be used to make non-combatant ships (eg: mining hulls, transports, colony ships) non-combatant by not carrying many weapons, rather than just large to hit penalties that still allow the use of missiles.

First, you must add an ability to every single weapon. AI Tag ## abilities have stuck around, so I will use one of those. The following must be added to every weapon in Components.txt:

====================
Number Of Abilities := 1
Ability 1 Type := AI Tag 01
Ability 1 Description :=
Ability 1 Scope := Space Object
Ability 1 Range Formula := 0
Ability 1 Amount 1 Formula := 0
Ability 1 Amount 2 Formula := 0
====================

You can do this in a flash by extracting the following Python script in your mod's Data folder and running it. It will create a "ComponentsTemp.txt" file with the extra ability appended to all weapons.

add_ability.zip

Next, we need to modify the light carrier hull in VehicleSizes.txt. This is an abbreviated portion of the light carrier entry:

====================
Number Of Requirements := 7
Requirements Evaluation Availability := 1, 2
Requirements Evaluation Allows Placement := 3, 4, 5, 6, 7
Requirements Evaluation Allows Usage := TRUE
Requirement 1 Description := Empire must have at least tech level 1 in Light Hull Construction.
Requirement 1 Formula := Get_Empire_Tech_Level("Light Hull Construction") >= (1 + ([%Level%] - 1))
Requirement 2 Description := Empire must have at least tech level 1 in Fighters.
Requirement 2 Formula := Get_Empire_Tech_Level("Fighters") >= (1 + ([%Level%] - 1))
Requirement 3 Description := This vehicle must have 1 Bridge.
Requirement 3 Formula := (Get_Design_Ability_Component_Count("Control Center") = 1) or (Get_Design_Ability_Component_Count("Master Computer") >= 1)
Requirement 4 Description := This vehicle must have at least Life Support for 100 crew members.
Requirement 4 Formula := (Get_Design_Ability_Total("Life Support", 1) >= 100) or (Get_Design_Ability_Component_Count("Master Computer") >= 1)
Requirement 5 Description := This vehicle must have at least Crew Quarters for 100 crew members.
Requirement 5 Formula := (Get_Design_Ability_Total("Crew Quarters", 1) >= 100) or (Get_Design_Ability_Component_Count("Master Computer") >= 1)
Requirement 6 Description := This vehicle can only have a maximum of 12 movement.
Requirement 6 Formula := Get_Design_Ability_Component_Count("Movement Standard") <= 12
Requirement 7 Description := This vehicle must have at least 50% of its hull dedicated to Fighter Bays.
Requirement 7 Formula := Get_Design_Ability_Percentage_Of_Hull_Space("Units - Launch", "Fighter") >= 50
====================

Take a look at Req 6. This is how max engines are defined now, a limit on the ability. Since we gave all weapons the ability AI Tag 01, we can use a similar limit to limit the number of weapons. You could add this:

====================
Requirement 8 Description := This vehicle can only have a maximum of 3 weapon systems.
Requirement 8 Formula := Get_Design_Ability_Component_Count("AI Tag 01") <= 3
====================

Of course, remember to increase the Num Reqs tag and add 8 to the allows placement, as so:

====================
Number Of Requirements := 8
Requirements Evaluation Availability := 1, 2
Requirements Evaluation Allows Placement := 3, 4, 5, 6, 7, 8
====================

Voila! Now, light carriers can only have 3 weapons!

Alternatively, you could make the limit a percent of the hull space, by making Req 8 be this instead:

====================
Requirement 8 Description := This vehicle can have at most 10% of its hull dedicated to weapon systems.
Requirement 8 Formula := Get_Design_Ability_Percentage_Of_Hull_Space("AI Tag 01", 1) <= 10
====================

Captain Kwok September 21st, 2006 04:40 PM

Re: SE5 - Mod Out LCX as Early Warship
 
It's a little work intensive but it works. If we could just count components that were weapons that would make this so much easier.

For the SE:V Balance Mod, suitable engine requirements make it so that carriers can't be packed with lots of weapons like in stock.

StarShadow September 21st, 2006 04:46 PM

Re: SE5 - Mod Out LCX as Early Warship
 
Wouldn't it be easier to just require the light carrier to devote most of it's space to fighter bays?

Just change:
Requirement 7 Description := This vehicle must have at least 50% of its hull dedicated to Fighter Bays.
Requirement 7 Formula := Get_Design_Ability_Percentage_Of_Hull_Space("Units - Launch", "Fighter") >= 50

To something like:

Requirement 7 Description := This vehicle must have at least 80% of its hull dedicated to Fighter Bays.
Requirement 7 Formula := Get_Design_Ability_Percentage_Of_Hull_Space("Units - Launch", "Fighter") >= 80

Fyron September 21st, 2006 04:50 PM

Re: SE5 - Mod Out LCX as Early Warship
 
A python script could add the ability to all weapons in a flash. http://forum.shrapnelgames.com/images/smilies/wink.gif

===

I did not see a formula for "weapon count," sadly. All I saw was what mounts use:

Requirement 1 Formula := Get_Component_Weapon_Type() = "Direct Fire"

Which is just a bool, not a count. http://forum.shrapnelgames.com/images/smilies/frown.gif

===

Starshadow:
That is possible, yes, but it eliminates other choices too, like the tradeoff between fighter bays vs. cargo bays (store more fighters, or launch more at once?), and defenses (armor/shields) vs. fighter bays.

Captain Kwok September 21st, 2006 04:51 PM

Re: SE5 - Mod Out LCX as Early Warship
 
You could do that - but it wouldn't affect the AI in this case. One change in SE:V due to formulas is that the those requirements are actually "hard-coded" in a couple of the AI scripts, which means you need to edit that and re-compile the AI scripts. Not a big deal, but something to consider.

Fyron September 21st, 2006 04:52 PM

Re: SE5 - Mod Out LCX as Early Warship
 
Actually, such requirements were ignored by AI in SE4 too...

Atrocities September 21st, 2006 05:13 PM

Re: SE5 - Mod Out LCX as Early Warship
 
Why too much work involved.. I just got a headace from looking at it. http://forum.shrapnelgames.com/images/smilies/frown.gif

Phoenix-D September 25th, 2006 04:51 PM

Re: SE5 - Mod Out LCX as Early Warship
 
Quote:

Atrocities said:
Why too much work involved.. I just got a headace from looking at it. http://forum.shrapnelgames.com/images/smilies/frown.gif

However you can't even *do* it in SE4.

In general, the stuff that was easy in SE4 is easy in SE5 (weapon forumlas excepted, but Fyron has a tool for those). Its only when you get to the more advanced stuff that things get..weird.

Fyron September 25th, 2006 07:17 PM

Re: SE5 - Mod Out LCX as Early Warship
 
Eh? It's just making a little script to add the AI Tag ability to weapons, then adding another req to each hull you want to have a weapon limit. It's not much effort at all, really.

Fyron September 25th, 2006 08:40 PM

Re: SE5 - Mod Out LCX as Early Warship
 
1 Attachment(s)
Attached to this post is a Python script that will add the ability "AI Tag 01" to all weapon components.

Suicide Junkie September 25th, 2006 09:00 PM

Re: SE5 - Mod Out LCX as Early Warship
 
Also fun and simple is the component-based crew requirements:

- Add "AI Tag 02" ability to all components. Amount 1 = the nessesary crew to operate
- Add "AI Tag 02" ability to the crew quarters. Amount 1 = NEGATIVE the amount of crew supplied.
- Ship requirements are that:
a) AI Tag 02 ability 1 is less than or equal to zero. (Otherwise "Insufficient crew")
b) Lifesupport ability amount >= crew quarters ability amount.

Note:
This does make ship design take a little longer, since you don't know exactly how much crew you'll need until you're done, but it is pretty cool.

Intimidator October 1st, 2006 11:01 AM

Re: SE5 - Mod Out LCX as Early Warship
 
I lost it already ............

aegisx October 1st, 2006 11:08 AM

Re: SE5 - Mod Out LCX as Early Warship
 
That will really open up alot of possibilities. I like the crew mod too, techs could reduce the amount of crew it takes to operate a component... or even add robotic crews etc.

Could we then have said crew have modifiers on each component?

thorfrog October 1st, 2006 11:21 PM

Re: SE5 - Mod Out LCX as Early Warship
 
I will miss the days of simply editing text files. Now I need to learn phython. And some said this would be easier to mod. Well, maybe some one will create a gui editor to help those with out a programming background.

Phoenix-D October 1st, 2006 11:25 PM

Re: SE5 - Mod Out LCX as Early Warship
 
You don't actually need Python, Fyron just likes to get fancy. http://forum.shrapnelgames.com/image...ies/tongue.gif Everthing in that post can be done by hand by editing the files, it just takes a bit longer.

thorfrog October 1st, 2006 11:31 PM

Re: SE5 - Mod Out LCX as Early Warship
 
Well, maybe a wiki guide will be created to help better explain how to code this. I just don't get the formulas. I'm sure they are good I just need a tutorial.

Phoenix-D October 1st, 2006 11:44 PM

Re: SE5 - Mod Out LCX as Early Warship
 
The formulas are easier if you break them down. They're a MESS by default because they have to be crammed onto one line.

A simple one:
Cost Minerals Formula :=
4000 + (([%Level%] - 1) * 40)

The cost starts out at 4000.

%Level% is a variable, it kicks out whatever the component's current level is. Then this subtracts 1 from that and multiplies the result by 40.
In other words- it increases the cost by 40 per level.

The weapons are a bit more complicated. Here's the anti-proton beam.

(20 + (([%Level%] - 1) * 5)) - (([%Range%] / 10) * 1.67) - iif([%Range%] > Min(90, (([%Level%] - 1) * 10) + 30), 10000, 0)

Breaking it down, this part:
(20 + (([%Level%] - 1) * 5)) - (([%Range%] / 10) * 1.67)
sets the damage.

(20 + (([%Level%] - 1) * 5)
works the same way as the cost function above.

- (([%Range%] / 10) * 1.67)
%Range% is another variable- the current range. This part divides it by 10, then multiples the result by 1.67. So for every 10 units of range, the beam loses 1.67 points of damage.

Now comes the weird part.
iif([%Range%] > Min(90, (([%Level%] - 1) * 10) + 30), 10000, 0)

Ok, what this is is a really convulted way of limited the maximum range.
iif is an if/then statement. What this says is:

IF the range is greater than X, subject 10000 from the damage. If the range is NOT greater than 90, do nothing.

X is defined by the Min(90, (([%Level%] - 1) statement. Min is Minimum. So it takes either 90 or ten times the level minus 1, whichever is LESS, and caps the range at that.

There will apparently be a full list of variables and such with the full game; I imagine the wiki will get more forumla information then. As long as you can keep your ( math straight it isn't complicated, just a bit tedius to puzzle through.

Fyron October 2nd, 2006 12:00 AM

Re: SE5 - Mod Out LCX as Early Warship
 
Phoenix-D said:
You don't actually need Python, Fyron just likes to get fancy. http://forum.shrapnelgames.com/image...ies/tongue.gif Everthing in that post can be done by hand by editing the files, it just takes a bit longer.


Making the same repetitive change to 100s of entries is exactly why we got the single entry families. Why not take it a step further? hehehe. I even wrote a script to generate the next version of FQM for SE5. http://forum.shrapnelgames.com/images/smilies/wink.gif

Fyron October 2nd, 2006 12:51 AM

Re: SE5 - Mod Out LCX as Early Warship
 
thorfrog said:
Well, maybe a wiki guide will be created to help better explain how to code this.


Good idea. I've created a basic framework for SE5 modding in the wiki. People should fill it in as they go along, with whatever they learn about each file.

http://wiki.spaceempires.net/index.p...ials_%28SEV%29

Phoenix-D October 8th, 2006 04:39 PM

Re: SE5 - Mod Out LCX as Early Warship
 
On the actual requirement:
Requirement 8 Formula := Get_Design_Ability_Percentage_Of_Hull_Space("AI Tag 01", 1) <= 10

What's the , 1 after "AI Tag 01" for? I don't see it in any other requirement.

Fyron October 8th, 2006 05:47 PM

Re: SE5 - Mod Out LCX as Early Warship
 
It is looking at type of the ability, I surmise. Witness:

Requirement 7 Formula := Get_Design_Ability_Percentage_Of_Hull_Space("Units - Launch", "Fighter") >= 50

This is looking for the Units - Launch ability, of type Fighter.

Looking at fighter bay:

Ability 1 Type := Units - Launch
Ability 1 Amount 1 Formula := "Fighter"

The second parameter of the req formula matches the ability amount 1 value. Maybe 1 just means "true," to match anything with the ability?


All times are GMT -4. The time now is 08:43 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.