.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   SEV Modders Knowledge Base (http://forum.shrapnelgames.com/forumdisplay.php?f=154)
-   -   Modding SEV Thread Questions (http://forum.shrapnelgames.com/showthread.php?t=30358)

President_Elect_Shang October 14th, 2006 05:24 PM

Re: Modding SEV Thread Questions
 
I need another formula help. What if I want to create a damage formula with the following values:

Range: 0 – 10 – 20 – 30 – 40 – 50 – 60 – 70 – 80 – 90 – 100 – 110 – 120
Damage inflicted: 30 – 30 – 20 – 20 – 20 – 10 – 10 – 10 – 10 – 10 – 10 – 10 – 10

How would I do this? I know that I only need to do the formula once as I want a flat damage rate so the min and max formula would be the same. Apologies but the formatting isn’t coming out and I don’t want to make it into columns.

aegisx October 14th, 2006 05:28 PM

Re: Modding SEV Thread Questions
 
AI colonies...

-Main script calls function to give ship orders.
-If its a colony ship, it calls the colony minister function.
-The minister looks for a planet to colonize (doesn't seem to care about any details, just if it can).

The AI has a function to pick a colony type, what calls that? It also seems to base what colony type based off of how many other colonies of the same type there are?

Noble713 October 14th, 2006 05:29 PM

Re: Modding SEV Thread Questions
 
I may have asked these before but I don't think I got an answer:

What does Base Model Radius in mpire_ships_xfileclasses.txt do?


The scale setting in each xfileclass seems to affect both the display of ships in the system display as well as in the combat engine. I want a different scale for each. For example, I would scale ships so they are all approximately the size of a hex in the system screen (making them clearly visible but not overly large), but I don't want every ship to be the same size in tactical combat. Is this possible now, or is it something I need to ask Aaron to add? It's essentially two seperate scale settings for strategic/tactical views as opposed to the one setting we have now.

Elsemeravin October 14th, 2006 05:29 PM

Re: Modding SEV Thread Questions
 
Why don't you use the exact same formula as for accuracy (below) but changing the weight and limits ?

kind of :
iff %range% <=10 ,30,iff %range% <=40 , 20,iff %range% <=120,10,0

President_Elect_Shang October 14th, 2006 05:47 PM

Re: Modding SEV Thread Questions
 
Quote:

Elsemeravin said:
Why don't you use the exact same formula as for accuracy (below) but changing the weight and limits ?

kind of :
iff %range% <=10 ,30,iff %range% <=40 , 20,iff %range% <=120,10,0

Can I do that? SJ, CPT Kwok, Phoenix-D? Is that a legal formula to use for the damage? How would I place the range limit on it? Something like

>=121, 10000, 0
The >= is for the cut off point.
The 10000 is to change all damage to 0 past that point.
I have no idea why the last 0 is in there(?).

Suicide Junkie October 14th, 2006 06:10 PM

Re: Modding SEV Thread Questions
 
You don't want 10000 damage; that would be huge.

Give me 10 minutes, and I'll tweak my equation parser program to show values at range.

Kana October 14th, 2006 06:17 PM

Re: Modding SEV Thread Questions
 
Yaa...I know what PES is working on...

http://forum.shrapnelgames.com/image...es/biggrin.gif

Suicide Junkie October 14th, 2006 06:38 PM

Re: Modding SEV Thread Questions
 
http://imagemodserver.mine.nu/other/...angeLister.zip

The one thing to keep in mind is that SE5's formula parser is not as flexible as this one.
SE5 demands whitespace everywhere, for example.

Note:
If you're not sure what is causing an error condition, press the "verbose" button, and it will tell you what it thinks is wrong with your formula.

President_Elect_Shang October 14th, 2006 06:46 PM

Re: Modding SEV Thread Questions
 
Quote:

Kana said:
Yaa...I know what PES is working on...

http://forum.shrapnelgames.com/image...es/biggrin.gif

http://forum.shrapnelgames.com/image...es/redface.gif

Kana October 14th, 2006 06:47 PM

Re: Modding SEV Thread Questions
 
Quote:

Imperator Fyron said:
No, it does not. Range has a degree of 1, not 10. Actual damage done will be whatever is calculated at the exact range, for example. The damage charts for component display only display every 10 ls because it would be insane to try to show every 1 LS.

So what value will it display per each 10 LS, if there are different values from 1-10 etc...?

Suicide Junkie October 14th, 2006 07:05 PM

Re: Modding SEV Thread Questions
 
The value AT range 10, 20, etc I believe.

http://imagemodserver.mine.nu/other/...angeLister.zip

Phoenix-D October 14th, 2006 07:08 PM

Re: Modding SEV Thread Questions
 
It displays the value AT ten.

As for the forumla..

iff %range% <=10 ,30,iff %range% <=40 , 20,iff %range% <=120,10,0

aside from the formating, that should work. The spaces have to be in the proper spot and you're missing ( and ) marks as well as the [ around %range%
iff([%range%] <= 10, 30, iff([%range%] <= 40, 20, iff( [%range%] <= 120, 10, 0))) should work.

EDIT:
>=121, 10000, 0
The >= is for the cut off point.
The 10000 is to change all damage to 0 past that point.
I have no idea why the last 0 is in there(?).

You set the range limit in the DAMAGE forumla, not the to hit formula. EDIT2: and that's what you did. Oops. Anyway, despite SJ's protest 10000 works fine in that role.

Even if the to-hit is -99999, a ship will still fire and waste supplies, and the "max range" strategy will use that to determine its range.

The second 0 is the ELSE part of the statement; its what the formula uses if the range isn't above 120.

Captain Kwok October 14th, 2006 07:24 PM

Re: Modding SEV Thread Questions
 
Quote:

aegisx said:The AI has a function to pick a colony type, what calls that? It also seems to base what colony type based off of how many other colonies of the same type there are?

The file Script_AI_ColonyType.txt contains the syntax for the AI to choose a colony type. In stock, it chooses a colony type based on a set percentage desired for each type. If it picked a resource type, then it would pick what resource by the value. Of course this meant a lot of times the AI was using good resource planets for stupid things. However, in the Balance Mod I switched this for the AI to pick a one of the resource colonies if the planet value was good to excellent and if it was poor in value to pick one of the other types based on a desired percentage in the empire.

aegisx October 14th, 2006 07:28 PM

Re: Modding SEV Thread Questions
 
Kwok: Nice, Ill have to check that out.

What I was looking for is what actually calls the Pick_ColonyType function. Or is it event driven, so the internal engine calls that function onColonize() or something.

Captain Kwok October 14th, 2006 07:47 PM

Re: Modding SEV Thread Questions
 
Quote:

aegisx said:What I was looking for is what actually calls the Pick_ColonyType function. Or is it event driven, so the internal engine calls that function onColonize() or something.

The Script_AI_Orders_Ships.txt file has the colony minister choosing a planet from the colonizable list but I'm not sure how its determining which one to go to first other than maybe closest.

aegisx October 14th, 2006 09:51 PM

Re: Modding SEV Thread Questions
 
If I remember right, it is just the first in it's list. That could be another useful place to mod, so they colonize more intelligently.

President_Elect_Shang October 15th, 2006 03:39 AM

Re: Modding SEV Thread Questions
 
Next few questions:

1. Can small craft (i.e. fighters or “shuttles”) be given the ability to make warp transits now?

2. Can the same small craft be given the cargo ability to transport troops or other goodies?

3. If they can transport troops can they be set to land troops?

Fyron October 15th, 2006 04:43 AM

Re: Modding SEV Thread Questions
 
1. Take a look at VehicleUnitTypes.txt and weep with joy.

2. They can act like troops and participate in ground combat. Dunno about actually carrying other units though. There isn't anything in VehicleUnitTypes.txt about it, but it would be really easy to test. Somehow, I doubt that units would be able to carry units, however, due to circular capacities and infinite storage space.

Barnacle Bill October 15th, 2006 09:16 AM

Re: Modding SEV Thread Questions
 
I'm looking at the AI setup scripts and wondering how the Racial Traits section is used...

Do the "random empires" that get added if you select "Generate random computer controlled players" use this to determine their racial traits?

If so, I would assume that they do so in order as listed in the script, until the point limit of the game is reached. However, you can select 2000, 3000 or 5000 point limits and I've checked 4 races so far and they don't add up. For the Abbidon, Amonkrie & Cue Cappa it comes evenly to 2000 and 3000 if you add them in order, but the total list in the script is less than 5000. For the Drushocka, adding them in order jumps you from 1500 to 2500, and the point total of all the traits listed in the script is 6000. So how does this work -

In a 5000 point game, would the Abbidon, Amonkrie & Cue Cappa take additional traits based on something else (what?)to get to 5000? Or would they just soldier on with <5000 in a 5000 point game? Do they get something else for their unused racial points? In a 2000 point game, would the Drushocka skip over that 1000 pt trait at 1500 to get to the next 500 pt trait on the list, or act as if the list didn't contain enough traits to reach the game point total.

Similarly, do I assume correctly the neutral players use the "default" script? In that, the raciat trait section actually contains formulas - a list of if statements in the form...

if (Sys_Get_Random_Long(1, 4) = 1) then
call Add_Racial_Trait("Advanced Storage Techniques")
endif

How does this work -

Does it go down the list until it fills the point total for the game? Again what if it is 500 points under the limit and the next one it gets is a 1000 pt trait? What if it gets through the whole list without hitting the limit? Do the regular races default to this when their list contains fewer pts worth of traits than the game limit?

Also, I haven't seen any negative point trait being called out in the scripts...

President_Elect_Shang October 15th, 2006 12:26 PM

Re: Modding SEV Thread Questions
 
Quote:

Imperator Fyron said:
1. Take a look at VehicleUnitTypes.txt and weep with joy.


Finally... There’s no “weep” emoticon; that sucks?

Has anyone tested to see if it works though?

Spectarofdeath October 15th, 2006 03:37 PM

Re: Modding SEV Thread Questions
 
Are we able to build or mod in a certain structure that can only be built once?

President_Elect_Shang October 15th, 2006 08:56 PM

Re: Modding SEV Thread Questions
 
What if I have a ship component and I want the first version of it to be open for development at tech level x1 and tech level y1. However, I do not want the second version to be developed till tech level x12 and tech level y3. Can that be coded? Put another way:

I want to make a ship component “Funky Monkey 1” and “Funky Monkey 2”.

Funky Monkey 1 can be developed at tech level x =1 and tech level y =1.
Funky Monkey 2 can be developed at tech level x=12 and tech level y=3.

I want this to be generational (one component) so I can write the component Maximum Level as 2. At this time I have them written as two components with Funky Monkey 1 set to disappear when research for Funky Monkey 2 has been completed.

Phoenix-D October 15th, 2006 09:13 PM

Re: Modding SEV Thread Questions
 
Possible.

requirement 1:
Get_Empire_Tech_Level("x") >= (1 + ([%Level%] - 12))
requirement 2:
Get_Empire_Tech_Level("y") >= (1 + ([%Level%] - 3))

should do it..

Suicide Junkie October 15th, 2006 09:46 PM

Re: Modding SEV Thread Questions
 
I think you meant to put multiplication instead of subtraction.

This should work better:
requirement 1:
Get_Empire_Tech_Level("x") >= ([%Level%] * 11 - 10)
requirement 2:
Get_Empire_Tech_Level("y") >= ([%Level%] * 2 - 1)

Level 1 requires X >= (11-10 = 1) and Y >= (2-1 = 1)
Level 2 requires X >= (22-10 = 12) and Y >= (4-1 = 3)

President_Elect_Shang October 15th, 2006 11:06 PM

Re: Modding SEV Thread Questions
 
Apologies gentlemen; however, I am just too slow to follow those examples. I have decided to leave them as separate components that phase out. Now how about something a little less complex, how would I tackle this one?

I have the component “Bottomless Fiend Grinder” [BFG] and I want another generation to come available every other level. So for example:

At tech level 1 you get BFG 1.
At tech level 3 you get BFG 2.
At tech level, ya Ok you get the idea…

How would I do that?

Suicide Junkie October 16th, 2006 01:35 AM

Re: Modding SEV Thread Questions
 
Requirement:

GETL("x") > [%Level%] * 2

Captain Kwok October 16th, 2006 07:40 AM

Re: Modding SEV Thread Questions
 
Quote:

Suicide Junkie said: GETL("x") > [%Level%] * 2

...or GETL("x") > (([%Level%] * 2) - 1) for an odd series.

President_Elect_Shang October 16th, 2006 08:52 AM

Re: Modding SEV Thread Questions
 
Ok; now I understand this and the other formula (1st and 12th tech level)! I was way over thinking the whole thing. Thanks guys, back to the grind till the next question.

President_Elect_Shang October 16th, 2006 10:45 AM

Re: Modding SEV Thread Questions
 
If I use a formula that generates a fraction what will SE do? Choke and die, round up, round down, or ignore all fractions?

Captain Kwok October 16th, 2006 11:11 AM

Re: Modding SEV Thread Questions
 
Most formulas can do decimal entries and the result is either rounded off or used as is depending on what it is affecting. For example, damage is rounded to whole number, while population reproduction or sight level is not. Formula fields that don't use decimals usually return a value of 0.

President_Elect_Shang October 16th, 2006 11:22 AM

Re: Modding SEV Thread Questions
 
Quote:

Captain Kwok said:
Most formulas can do decimal entries and the result is either rounded off or used as is depending on what it is affecting. For example, damage is rounded to whole number, while population reproduction or sight level is not. Formula fields that don't use decimals usually return a value of 0.

How about the build rate for a construction yard; dropped I would think.

President_Elect_Shang October 16th, 2006 11:45 AM

Re: Modding SEV Thread Questions
 
If space yards are in space why were they given the ability to repair facilities?

Captain Kwok October 16th, 2006 12:22 PM

Re: Modding SEV Thread Questions
 
Are you asking about the Space Yard component or Space Yard facility?

For gameplay resasons it's probably a good idea to keep it that way since there is no inherent repair rate for a planet. I requested that some lines be added to settings.txt that allow you set a repair rate for a planet without a SY...

President_Elect_Shang October 16th, 2006 12:52 PM

Re: Modding SEV Thread Questions
 
The component; how does a space yard in space fix a facility on a planet? You do have a good point though!

Spectarofdeath October 16th, 2006 12:59 PM

Re: Modding SEV Thread Questions
 
Construction crews shuttle down to the planet and repair the facilities using supplies from the planet?

Q October 16th, 2006 01:08 PM

Re: Modding SEV Thread Questions
 
A basic repair for colonies is essential IMO. Otherwise damaged facilities will never be repaired and it is quite unlogical that you can build new facilities, upgrade facilities but not repair them!

President_Elect_Shang October 16th, 2006 01:14 PM

Re: Modding SEV Thread Questions
 
Is there a way to build a component which has a restriction that limits the total number that can be carried? For example:

The Mega Toaster
The mega toaster can toast all bread in the blink of an eye; however, due to the power draw only 1 per 100 hull spaces can be used.

*Mega Toaster Inc. is not responsible for burnt slices or charring of crust. http://forum.shrapnelgames.com/image...ies/tongue.gif

Tampa_Gamer October 16th, 2006 01:52 PM

Re: Modding SEV Thread Questions
 
Quote:

President_Elect_Shang said:
Has anyone tested to see if it works though?

Yes and no. It [VehicleUnitTypes.txt] has some issues that are still on Aaron's to-do list (I hope). This file will be incredibly powerful once its working correctly. This file will allow us to create leaders, gunships, and many other things that we have been requesting since 2001. Unfortunately, it's not quite there yet, since Aaron needs to add some more hooks in the actual engine to make the new units behave (and be recognized) like the default units. My fingers are crossed that this can be accomplished easily.

Ed Kolis October 16th, 2006 02:22 PM

Re: Modding SEV Thread Questions
 
Quote:

President_Elect_Shang said:
Is there a way to build a component which has a restriction that limits the total number that can be carried? For example:

The Mega Toaster
The mega toaster can toast all bread in the blink of an eye; however, due to the power draw only 1 per 100 hull spaces can be used.

*Mega Toaster Inc. is not responsible for burnt slices or charring of crust. http://forum.shrapnelgames.com/image...ies/tongue.gif

Sure, I guess you'd have to give it some unique ability that does nothing (like "AI Tag 1"), then do a requirement that Get_Component_Ability_Count("AI Tag 1") <= Get_Vehicle_Hull_Tonnage() / 100... (not entirely sure about the names of those functions)

Now if you could just restrict based on component NAME that would be much easier... but I never tried that and don't have the function list handy, so it might already be possible http://forum.shrapnelgames.com/image...ies/tongue.gif

Phoenix-D October 16th, 2006 02:26 PM

Re: Modding SEV Thread Questions
 
Note: depending on where you use it, Get_Vehicle_Hull_Tonnage has a tendancy to return 0.

It works in the weapon enhancement file, but I've yet to have it work in components.txt.

Fyron October 16th, 2006 02:40 PM

Re: Modding SEV Thread Questions
 
Quote:

President_Elect_Shang said:
Is there a way to build a component which has a restriction that limits the total number that can be carried?

You must have missed this thread:

http://www.shrapnelcommunity.com/thr...;Number=447917

President_Elect_Shang October 16th, 2006 02:59 PM

Re: Modding SEV Thread Questions
 
Quote:

Imperator Fyron said:You must have missed this thread:

I do not want to force a ship type to have x many of weapon Toaster. If the designing player wants to put toasters on his ship I want to restrict how many they can emplace based upon the total tonnage; one per 100 tons to be exact. I did miss that thread and after scanning it I can see where you made 50% of the hull dedicated to fighter bays; however, as I mentioned this is not the type of restriction I want.

Suicide Junkie October 16th, 2006 03:28 PM

Re: Modding SEV Thread Questions
 
If you know the size of the hull, (which you do) then you know how many are allowed simply by doing the X per 100kt math.
Limit to that many. Done.


Restrictions are each an equation. If the equation evaluates to false, then the design is illegal. If it is true, the design is OK.

Fyron October 16th, 2006 03:34 PM

Re: Modding SEV Thread Questions
 
President_Elect_Shang said:
I did miss that thread and after scanning it I can see where you made 50% of the hull dedicated to fighter bays; however, as I mentioned this is not the type of restriction I want.


Well good, cause that is not at all what the thread is talking about. http://forum.shrapnelgames.com/images/smilies/happy.gif The 50% fighter bay requirement is already a part of SE5. The thread is about how to set up a max number or percentage of space you can use for specific types (or groups) of components (eg: weapons); it is in fact exactly what you want to do. You can't do it from the component itself, it has to be a restriction on each hull.

President_Elect_Shang October 16th, 2006 04:30 PM

Re: Modding SEV Thread Questions
 
So you are saying give the component say “tag 1” then each ship size the restriction 1 tag 1 per 100 hull spaces. Won’t this cause the ship to NEED that component or else it will warn of an illegal design? Your light cruiser needs 50% fighter bays or it can’t be created correct?

From your thread:

Requirement 7 Description := This vehicle must have at least 50% of its hull dedicated to Fighter Bays

Making a ship take a certain number of a component is an old trick I know well. If I code something along this lines I will be forcing the player to take the component or else. Is there something else that I am missing? The Ultra-Toaster component MUST be purely optional. I managed a very dirty way to do this in SE4 but with SE5 it is another creature. I am trying to learn to mod all over again.

On another question is Aaron going to release a detail of the abilities that can be used for components, et-el?

Fyron October 16th, 2006 04:33 PM

Re: Modding SEV Thread Questions
 
Huh? The example is a carrier, so it has a fighter bay requirement as the source vehicle from the data file does. That is not what the thread is about though; look at the last requirement (the one the post tells you to add). It is a max space for AI Tag 01. There is no requirement to have any AI Tag 01 abilities present to have a legal design, just a maximum.

Aaron is working on some modding docs.

Suicide Junkie October 16th, 2006 05:31 PM

Re: Modding SEV Thread Questions
 
You can put whatever you like for the formulae; plug math and comparisons and boolean logic together like legos, and you can make whatever you want.

What is the source of confusion?

Phoenix-D October 16th, 2006 05:35 PM

Re: Modding SEV Thread Questions
 
Shang, you're taking the example too literally.

First, the design requires LESS than 1 per 100; 0 is perfectly fine. Look at the engines for a stock example- every ship has a requirement that limits the amount of Standard Move you can have.

Second, the design linked is for a *carrier*. That is why it has the Fighter Bay requirement. Ignore that part, it isn't even relevent.

President_Elect_Shang October 16th, 2006 05:44 PM

Re: Modding SEV Thread Questions
 
Now that question I can answer. The source of my confusion is in the Boolean and SE5. Specifically my experience with either is limited to what; three or four days now? I am learning as I go. My tech skills end at the tips of my fingers so-to-speak.

Ok now I have my focus on requirement 8. So you give all weapons AI Tag 01 and now the AI will only add three weapons. And this restriction will pass on to the player as well? They will only be able to add three weapons? Excellent! That is much better than my solution.

This misunderstanding/confusion is my fault, I’m so conditioned to looking at the “Requirement” list that I stopped reading when I reached the break between 7 and 8. As for it being a carrier I only noticed the post title “SE5 - Mod Out LCX as Early Warship”. LC to me is Light Cruiser and X means Experimental. What I will do now is read the thread in its entirety. As I said below I only scanned the thread.

Fyron October 16th, 2006 06:04 PM

Re: Modding SEV Thread Questions
 
SE4/5 make the Carrier's abbreviation be "CX", so I just appended a L to it. But I see that SE5 has just "LX" for light carrier. Sorry for the confusion.


All times are GMT -4. The time now is 07:53 AM.

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