Home Crush your enemies... and create an EMPIRE!!! Space Empires V -- BUY NOW!!!

User login

  • Create new account
  • Request new password

Navigation

  • news
    • archive
    • blogs
    • books
    • forums
    • recent posts
    • groups
  • image galleries
  • projects & downloads
  • search
  • create content
  • news aggregator

Search

Who's online

There are currently 1 user and 152 guests online.

Online users

  • Faithful

Languages

  • English English
  • French French

Browse archives

« December 2008  
Mo Tu We Th Fr Sa Su
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Home » news » forums » Support & Feedback » Scenarios & Mods » SE:V MODs

Question about abilities and formulas

Submitted by Sinapus on Wed, 2006-10-25 08:03. SE:V MODs

Is it possible to use Get_Empire_Tech_Level as a variable in an ability calculation?

What I'm thinking of doing is trying to bring in something like the Cultural Centers from the SE:IV Proportions mod, give them a variety of abilities, and make the abilities increase based on different tech levels. Like, say, the mineral extraction value gets a bonus based on the mineral extraction tech and the research point value going up with the research tech level.

I guess what I'm looking for is something like:
Ability 1 Type := Mined Resource Generation - Minerals
Ability 1 Description := Mines [%Amount1%] minerals each turn.
Ability 1 Scope := Space Object
Ability 1 Range Formula := 0
Ability 1 Amount 1 Formula := 3000 + ([%Get_Empire_Tech_Level("Minerals Extraction")%] * 100)
Ability 1 Amount 2 Formula := 0

So my "cultural center" would have only one level but its resource production and abilities would hopefully grow as you gained techs in other areas. I'm also hoping I can create the entry for the cultural center, but give it an impossible tech level and have it only appear on homeworlds via the HomeworldStartingFacilities file.

Wondered if anyone tried this and if it worked for them before I go breaking things in my game. Eye-wink

‹ Helper Application Release - Space Empires V DesignTypes Editor v0.1.8 Planet conditions... ›
» login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ekolis's picture
Mod Designer

Yes, I believe Suicide

Submitted by ekolis on Wed, 2006-10-25 08:29.

Yes, I believe Suicide Junkie and Captain Kwok have used both the concepts you want to use in their respective mods - it should work Smiling

~~~
Mr. Flibble says...
Game over, boys! Laughing out loud

» login or register to post comments
Captain Kwok's picture
Mod Designer

GETL works good in formulae!

Submitted by Captain Kwok on Wed, 2006-10-25 09:00.

It will work. It has been used for example to allow armor advances to improve missile damage resistance etc.

-----

Space Empires Depot | Space Food Empires!

» login or register to post comments
Mod Designer

Ooh GETL? *IDEA* Your lord

Submitted by LordHavoc on Wed, 2006-10-25 10:30.

Ooh GETL? *IDEA*

Your lord and master (below Foamy) LordHavoc

» login or register to post comments
Rilbur's picture

GETL

Submitted by Rilbur on Wed, 2006-10-25 11:20.

For ship designs, the result of "GETL" saved to the design, so advancing tech / trading ships won't change its value? Seems like it should be, but before I base a mod on it I"d like to be sure.

There are 10 types of people in the world:

Those that understand binary, and those that don't.

» login or register to post comments

Another question.

Submitted by Sinapus on Thu, 2006-10-26 08:47.

Is there a way to give a facility the ability to increase the maximum population of a planet? Like, say, a facility that increases the population by 100M so a large planet goes from 4000M to 4100M?

» login or register to post comments
Rilbur's picture

Another another question....

Submitted by Rilbur on Thu, 2006-10-26 11:24.

When modding weapons, how do the formulas work? Looking at them, I can't make heads or tails of them.

There are 10 types of people in the world:

Those that understand binary, and those that don't.

» login or register to post comments
Captain Kwok's picture
Mod Designer

Stock Damage Formula

Submitted by Captain Kwok on Thu, 2006-10-26 14:56.

The stock formula falls into 3 pieces. The first part of the formula is the damage amount minus the second term which is the damage decrease at range, and lastly if IIF statement at the end tells the game if the range is more than X, subtract -10000 (ie make damage zero) and that's the maximum range.

-----

Space Empires Depot | Space Food Empires!

» login or register to post comments
Rilbur's picture

Ok...

Submitted by Rilbur on Thu, 2006-10-26 16:13.

Just to check, here's a formula from the game:

(20 + (([%Level%] - 1) * 5)) - (([%Range%] / 10) * 0.00) - iif([%Range%] > Min(80, (([%Level%] - 1) * 10) + 40), 10000, 0)

It breaks down into two parts:

20 + (([%Level%] - 1) * 5)) - (([%Range%] / 10) * 0.00)

The first half of this controls the damage done by a given level, and teh second half adjusts for range. However, this is the "default" formula and I can change it to something like...

(20+(([%Level%]-1)*5)/(2^([%Range%]/10)))

and have a weapon which halves in damage every 10 units of range.

The second half:

iif([%Range%] > Min(80, (([%Level%] - 1) * 10) + 40), 10000, 0

still leaves me a little confused. I get that "if range is greater than the min" but the entire min value leaves me confused. Where's the 80 come from? How does it figure in (or not in) to the "(([%Level%] - 1) * 10) + 40)" part? And what does the zero at the end control?

There are 10 types of people in the world:

Those that understand binary, and those that don't.

» login or register to post comments
Captain Kwok's picture
Mod Designer

More Dmg formula stuffs

Submitted by Captain Kwok on Thu, 2006-10-26 16:25.

The Min function returns the lower of two items, min(a, b). In this case what's lower 80 or the weapon level * 10? In this case the 80 represents the maximum allowed range of the weapon.

The IIF function than looks at the condition, which in this case is the range value more than what Min returns? If yes, then the value to subtract is 10000, and if false its 0.

-----

Space Empires Depot | Space Food Empires!

» login or register to post comments

Weapon range

Submitted by Sinapus on Thu, 2006-10-26 16:26.

The iif statement, is that how it increases range via tech level?

» login or register to post comments
Rilbur's picture

I think

Submitted by Rilbur on Thu, 2006-10-26 16:38.

Sinapus wrote:
The iif statement, is that how it increases range via tech level?

I think so, it would certianly allow it. I wonder how we could get it to return the HIGHER of two values, though...

And Kwok, if I read this right, if the damage reduces to 0 naturally (say because the diminising damage formula reduced that much) it would range cap that way, instead of needing the iif, right?

There are 10 types of people in the world:

Those that understand binary, and those that don't.

» login or register to post comments
Mod Designer

Nope

Submitted by LordHavoc on Thu, 2006-10-26 16:47.

Sinapus wrote:
The iif statement, is that how it increases range via tech level?

The line
Weapon Space At Range Distance Increment := 10.0
is what causes the range to increase up to a maximum of 300

However, the IIF is what is used to determin a weapons 'maximum' range. It does this by checking to see if a weapon has fired "x" distance, if it has gone beyond it, it reduces the damage by 10000.
You can see it in this code

Weapon Space Min Damage Modifier Formula := (20 + (([%Level%] - 1) * 5)) - (([%Range%] / 10) * 1.67) - iif([%Range%] > Min(90, (([%Level%] - 1) * 10) + 30), 10000, 0) Your lord and master (below Foamy) LordHavoc

» login or register to post comments
Mod Designer

Yep

Submitted by Phoenix-D on Thu, 2006-10-26 16:53.

The iif statement is what determines maximum range. I have no idea what the Distance Incriment field does; changing doesn't seem to have an effect.

Foamy: in your example, that's not fixed at all. It uses the either 90, OR the result from ([%Level%] - 1) * 10) + 30). That means the gun starts at 30 range and goes up by 10 per level until it reaches 90.

» login or register to post comments
Mod Designer

I didn't say fixed.

Submitted by LordHavoc on Thu, 2006-10-26 17:05.

Phoenix-D wrote:
Foamy: in your example, that's not fixed at all.

I never said it was fixed. And i'm not Foamy, he's the TRUE lord and master. I can't measure up to him...no one can.
Your lord and master (below Foamy) LordHavoc

» login or register to post comments
Rilbur's picture

So....

Submitted by Rilbur on Thu, 2006-10-26 17:11.

Quote:
The line Weapon Space At Range Distance Increment := 10.0 is what causes the range to increase up to a maximum of 300

So if I increase that value, will it be possible to increase teh relative maximum range of thigns? (One of the reasons I'm modding missiles onto drone bodies is I DETEST how short range weapons are ATM -- you can go through the long-ranged weapons "fire zone" very quickly to get to point blank, especially if both sides are going head on).

There are 10 types of people in the world:

Those that understand binary, and those that don't.

» login or register to post comments
Mod Designer

Not sure about that one.

Submitted by LordHavoc on Thu, 2006-10-26 17:12.

Not sure about that one. Could be hard-coded. The interface only goes up to 300.

Your lord and master (below Foamy) LordHavoc

» login or register to post comments
Rilbur's picture

Poking around some more...

Submitted by Rilbur on Thu, 2006-10-26 17:23.

OK, poking around in the files a little more, I've realised that "iif" is actually an if/else combination statement. iff([condition],[if true do this],[else do this]).

Things are starting to make a LOT more sense, yay!

There are 10 types of people in the world:

Those that understand binary, and those that don't.

» login or register to post comments
Mod Designer

Max range

Submitted by Phoenix-D on Thu, 2006-10-26 17:25.

The max range is 500 ls. The stock CSM gets to about 160 LS max, so you've got plenty of room to play with.

» login or register to post comments
Mod Designer

Give yourself a pat on the

Submitted by LordHavoc on Thu, 2006-10-26 17:25.

Give yourself a pat on the back. You've taken the first step into becoming a modder.

Now you've got to make something and release it.

Your lord and master (below Foamy) LordHavoc

» login or register to post comments
Rilbur's picture

O RLY

Submitted by Rilbur on Thu, 2006-10-26 17:36.

LordHavoc wrote:
Give yourself a pat on the back. You've taken the first step into becoming a modder.

Now you've got to make something and release it.

Your lord and master (below Foamy) LordHavoc

And here I was, thinking the first step was waaaaay back when I first started modding SEIV (OK, so I started out on MoO3... don't kill me!)Sticking out tongue

There are 10 types of people in the world:

Those that understand binary, and those that don't.

» login or register to post comments

Oh goodie.

Submitted by Sinapus on Mon, 2006-10-30 22:44.

Phoenix-D wrote:
The max range is 500 ls. The stock CSM gets to about 160 LS max, so you've got plenty of room to play with.

Muahaha. SBMs and HBMs, here we come. Smiling

» login or register to post comments

IT'S ALIVE!! MUAHAHAHA!!!

Submitted by Sinapus on Thu, 2006-11-09 23:03.

Got it to work so far!

It can:
1. Place the facility on the homeworld but it can't be built anywhere else. (Gave it a tech level requirement that can't be met.) So the HomeworldStartingFacilities.txt file will force placement of a facility.
2. Set the variable for 3000 Minerals + 100 per Mineral Extraction level. Started a test game, it was 3100 minerals per turn. Put all my research into Mineral extraction, ended the turn, got up to lvl 8 in mineral extraction and the facility was producing 3800 minerals per turn!

(Oh, and don't use the formula I showed above. Game can't parse it unless you take away the bracket-% parts and then it reads it fine.)

Now to see if I can add Ordnance/Supply Storage variables to a facility and then see if it will increase a planet's capacity.

EDIT: Nope. Though I think someone mentioned that elsewhere. Oh well. Guess I'll have to use dedicated space stations as depots if I want a ton of supplies/ordnance stockpiled.

» login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Now on STEAM

Now on STEAM!Space Empires V via STEAMSpace Empires IV via STEAMSTEAM online by Valve Corporation

Popular content

Today's:

  • Research By Percentage SUCKS
  • Space Empires V and VI: Expansions and the Future: Tell the Company What's on Your Wish List
  • What does Environmental Resistance do?
  • OK Ship Mod
  • Space Empires V

All time:

  • Space Empires V and VI: Expansions and the Future: Tell the Company What's on Your Wish List
  • Space Empires V
  • Gritty Galaxy Fleet Clash
  • Damn Dirty Bugs/Annoyances
  • Space Empires V: General Thoughts, Observations, and Suggestions

Last viewed:

  • 1.35 bug list
  • SE:V v1.59 History
  • The game enforces treaties
  • Just some questions that are driving me nuts
  • Is this doable
(c) Strategy First, Inc. All rights reserved.