.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   SEV Modders Knowledge Base (http://forum.shrapnelgames.com/forumdisplay.php?f=154)
-   -   Component.txt Knowledge Base (http://forum.shrapnelgames.com/showthread.php?t=31763)

Phoenix-D December 4th, 2006 04:05 PM

Re: Component.txt Knowledge Base
 
It looks like he wants it to stay the same for several levels, THEN drop 10kt..

President_Elect_Shang December 4th, 2006 04:18 PM

Re: Component.txt Knowledge Base
 
That was my impression, but how many levels till the next drop 7? I don’t know why he is dividing level minus one by seven or what the int is for. Maybe he is thinking he has to tell SE5 it is an integer before he declares it? Integer or Intelligence?

Thank you for helping out Imperator Fyron. Is that what you were looking for DeadMilkMan? I dub thee DMM! http://forum.shrapnelgames.com/images/smilies/cool.gif

Fyron December 4th, 2006 11:16 PM

Re: Component.txt Knowledge Base
 
DMM is already reserved for Deathstalker's Mount Mod. http://forum.shrapnelgames.com/images/smilies/wink.gif

Ah, drop after several levels. Gotcha. Here is a horrible way to do it:

Note the if-else function:

iif(cond, A, B)

This means, if cond is true, return A. Else, return B. You can naturally put other functions in for A and/or B.

Now to apply it:

40 - iif([%Level%] >= 5, 20, iif([%Level] >= 3, 10, 0))

This will make it:

L1: 40
L2: 40
L3: 30
L4: 30
L5: 20
L6: 20
L7: 20
...


Hmm... a possibly less crazy way that gets the same progression:

iif([%Level] >= 5, 20, iif([%Level%] >= 3, 30, 40))

Or, as a purely aesthetic issue, if you want to see decreasing sizes, just invert:

iif([%Level] < 3, 40, iif([%Level%] < 5, 30, 20))

DeadMilkman December 5th, 2006 12:05 AM

Re: Component.txt Knowledge Base
 
Quote:

President_Elect_Shang said:

Your question is a little confusing; before I can answer let me make sure I know what you want to do. You want the Master Computer to go up every level but you want the space taken to go down by 10kt every seven levels? Or do you want it to go down every level? What does the “int” you are using in your formula mean; Intelligence?

If you want it to go down every level than use: (40 – ([%Level%] * 10) but once you hit level 4 you will have a 0 ton component. You see why I am asking now?

You were correct that I wish the space taken to go down approximately every seven levels (although that number is somewhat arbitrary).

The "int()" in the formula should be an integer function, assuming that Aaron has programmed the formulas to follow standard coding practice. Which I would think he would since he is in fact a programmer http://forum.shrapnelgames.com/images/smilies/happy.gif

The integer function should drop anything after the decimal point, but this does not seem to be working. I was hoping maybe the trunc() function may be something similar, but it also does not seem to work.

The reason for this is if the decimal is not truncated, the value returned would not go in increments of 10Kt, but instead in smaller increments equal to the rounded value of the decimal. Which is unfortunately what it seems to be doing anyways http://forum.shrapnelgames.com/images/smilies/happy.gif

Quote:

Imperator Fyron said:
Erm... what is wrong with just:

40 - (([%Level%] - 1) * 10)

(excessive parenthesis cause I still don't trust SE5's order of operations...)

If that doesn't produce the desired results, you have found a bug and should report it to se5 at malfador.com (with as simple a data file as you can send).

Nothing really wrong with that formula, I just wanted it to go in increments of 10, instead of incremints of 1, which yours does.

It is no big deal really, I am just trying to get a hang of the formulas in SEV. I actually just suspect that it is a bug, and will email it in.


DOH, didnt notice that this thread was already 3 pages long, so missed some replys there.

Phoenix D basically has the idea, Imperator Fyron , that solution should work fine, I just hate nesting IIF's if avoidable, I always end up messing those up.

I put the -1 in the formula at some point because I kept getting into negative Kt otherwise (this is using the formula helper on the SEV editor).

As I said, I mainly posted the question because I suspect the INT() formula is not working as it should.

Of course it is entirely possible that I just dont remeber how int functions are supposed to work, considering my normal brain function http://forum.shrapnelgames.com/images/smilies/happy.gif

Fyron December 5th, 2006 01:47 PM

Re: Component.txt Knowledge Base
 
Quote:

DeadMilkman said:
Nothing really wrong with that formula, I just wanted it to go in increments of 10, instead of incremints of 1, which yours does.

Huh? How does the level * 10 bit not go in increments of 10?

Quote:

Of course it is entirely possible that I just dont remeber how int functions are supposed to work, considering my normal brain function http://forum.shrapnelgames.com/images/smilies/happy.gif

I'd consider it more likely that there is no such function in SEV land. http://forum.shrapnelgames.com/images/smilies/wink.gif Or if there is, it was never tested...

President_Elect_Shang December 5th, 2006 02:11 PM

Re: Component.txt Knowledge Base
 
Actually int is one of the functions called from the main string. Thus far everything I have tried from the main string works; once I figured how to use it that is. Now I am not saying everything there works, just that the ones I have used have all worked. Another possibility is that int works but not with components.

Hay DeadMilkMan, did you try “int()” or “Int()” because int is nothing to SE5 but Int() [notice the capital I] means round toward zero I believe. Round() should round off to the nearest whole number if that is what you want.

DeadMilkman December 5th, 2006 08:26 PM

Re: Component.txt Knowledge Base
 
Imperator Fyron, you are correct, as I said, my brain isn't what it used to be http://forum.shrapnelgames.com/images/smilies/happy.gif
The formula you suggest would cause a 10kt drop in space every level, which would make the component 0kt at level 5, and then it would go into negatives after that. The reason I divided it by 7 is it would spread the reduced component size across the 20 research levels at roughly 1/3 intervals ending with a final component size of 20Kt, although I am considering dividing it by 6 instead which theoretically would cause levels 19 and 20 to result in a 10Kt component.

Quote:

President_Elect_Shang said:
Actually int is one of the functions called from the main string. Thus far everything I have tried from the main string works; once I figured how to use it that is. Now I am not saying everything there works, just that the ones I have used have all worked. Another possibility is that int works but not with components.

Hay DeadMilkMan, did you try “int()” or “Int()” because int is nothing to SE5 but Int() [notice the capital I] means round toward zero I believe. Round() should round off to the nearest whole number if that is what you want.

Nope, I've only tried int not Int, will give it a shot when I get a chance, round may work fine too, will check it out.

Thanks.

DeadMilkman December 5th, 2006 08:28 PM

Re: Component.txt Knowledge Base
 
Btw President_Elect_Shang, where do I find the main string?

President_Elect_Shang December 5th, 2006 08:43 PM

Re: Component.txt Knowledge Base
 
MainString.txt is one of the files in the same directory as the component file you are modding. Please remember to make a backup copy of any file you are going to mod before you mod it. Any you can just call me PES, much easier! http://forum.shrapnelgames.com/images/smilies/happy.gif

DeadMilkman December 5th, 2006 10:13 PM

Re: Component.txt Knowledge Base
 
Thanks for the info, I use a mod directory for my playing around so as not to mess up my game http://forum.shrapnelgames.com/images/smilies/happy.gif

PES works fine for me, just remember, copy and paste is my friend.

DM.


All times are GMT -4. The time now is 10:07 PM.

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