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 2 users and 168 guests online.

Online users

  • GambitUK
  • Fyron

Languages

  • English English
  • French French

Browse archives

« September 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          
Home » news » forums » Support & Feedback » Scenarios & Mods » SE:V MODs

Empire size information in facility ability formula

Submitted by Eater1 on Mon, 2007-08-13 23:56. SE:V MODs

I'm trying to get a facility ability amount to depend roughly on the size of the owner's empire, and I was wondering if anyone had any ideas about how to insert any of the following quantities into the ability amount formula field:
1. The number of planets the owner controls.
2. The number of star systems the owner controls.
3. Any other quantity that corresponds to the size of the owner's empire.
4. How far the planet the facility is on is from the owner's homeworld, in lightyears or warp jumps - this last one would be really awesome, though probably the hardest and least possible.

‹ How to read the Fleet name Scripts: Get Anger Level ›
» 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.

Re: Empire size information in facility ability formula

Submitted by Eater1 on Wed, 2007-08-15 16:50.

Alternatively, does anyone know if it is possible to call into a custom scripted function from an ability formula?
I'm actually pretty new to SE V modding, and the scripting reference appears to be just a list of functions and doesn't really explain the mechanics very well...

» login or register to post comments
Mod Designer

Re: Empire size information in facility ability formula

Submitted by Fyron on Wed, 2007-08-15 21:26.

No, you can't define new functions for use in the Data files*. You can create whatever you want within the AI/event/intel scripts, but the regular data files have no capacity to create arbitrary functions.

There are a few exceptions, but they pretty much all apply to planet values (temperature, radiation, gravity). You can create new formulas for them in Formulas.txt, and reference them in some of the planet types.


SpaceEmpires.net | Space Empires Wiki

» login or register to post comments

Re: Empire size information in facility ability formula

Submitted by Lord Shleepy on Thu, 2007-08-16 00:38.

#1) I have no idea if it will work in this context but there is a function that will find the # of colonies that a player owns. As stated in the scripting manual:

Quote:
Sys_Get_Player_Colonies_Count: long plr_index: long

This function returns the number of colonies that this player owns. The plr_index is the ID of the player.

#2) Here is another fun one with multiple uses

Quote:
Sys_AI_Empire_Stats_Get_Colonies_Statistics: long plr_index: long colonies_stats_filter: long

This function returns specific statistics about a player’s colonies. The plr_index is the ID of the player. The all_planets_stats_filter determines which
statistic to return. These constants can be used:
COLONIES_STATS_FILTER_NUM_SYSTEMS_WITH_COLONIES,
COLONIES_STATS_FILTER_NUM_COLONIES,
COLONIES_STATS_FILTER_NUM_BLOCKADED_PLANETS,
COLONIES_STATS_FILTER_NUM_RACES,
COLONIES_STATS_FILTER_TOTAL_POPULATION,
COLONIES_STATS_FILTER_NUM_FACILITIES,
COLONIES_STATS_FILTER_TOTAL_FACILITY_TONNAGE.

#3) Many more of the above listed in the scripting document (under empire or empire stats...beginning page 33 or so)

#4)This is the closest I could find for the last one...looks like it should work quite well if I understand correctly. That is assuming that you can call a function from this file at all of course.

Quote:
Sys_Get_Hex_Distance_Between_Sectors: long plr_index: long from_system_location: long from_sector_location: long to_system_location: long to_sector_location: long This function returns the distance in sectors (or hexes) between two sectors. The plr_index is the ID of the player. The from_system_location is the ID of the source solar system. The from_sector_location is the ID of the source sector. The to_system_location is the ID of the destination solar system. The to_sector_location is the ID of the destination sector.

The lack of enthusiastic response from the REAL experts on modding this game makes me worry that none of these will work in this circumstance...but who knows...maybe they're just off duty today. Smiling

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

Re: Empire size information in facility ability formula

Submitted by Captain Kwok on Thu, 2007-08-16 09:47.

He was looking for a function that would work in the data files, in which case there is no function to return the size of the empire.

-----

Space Empires Depot | SE:V Balance Mod

» login or register to post comments

Re: Empire size information in facility ability formula

Submitted by Eater1 on Thu, 2007-08-16 18:41.

Hmmm... that's unfortunate. I was thinking of adding an upkeep system that depended on empire size (to reduce empire growth), in which case it would really cool to be able to do that in the facilities formula, as this would make the whole thing a lot clearer to the player. I can add it to the scripts, but in that case I'm afraid that the player will be very confused about what the total upkeep cost actually is.
My plan was to convert intelligence centers to "administration centers" and intelligence points to "administrative points." Every facility would use a fixed number of administration points to operate (and cause riots if it can't get them - e.g. if admin points are at zero), while the administration centers would produce points as they do now, but with a penalty dependent on empire size (so if the player has a huge empire, they might operate at only 10-20% capacity). This would make large empires harder to maintain, requiring "administration worlds" full of admin. centers, and also make them more vulnerable to espionage, as huge sprawling empires should be.
I can probably do this in the espionage scripts somewhere, by first multiplying the admin. points by the empire size factor, stepping over each planet, subtracting the administration cost of each facility, and using the remaining points to do espionage. However, is there some clear way to expose how this works to the player?
If anyone has any ideas on how I can do this clearly without using facility abilities, I would really appreciate a suggestion. Maybe add a printout somewhere on the intelligence screen, if possible? Or is there some way to influence the total that appears for intelligence points? Maybe add in some "species ability" or something via a script?
Thanks for all the help.

» 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:

  • Babylon 5 Space Empires V mod?
  • Balance Mod v1.05 Available!
  • Killing crew
  • Ship Capture Issues
  • Babylon 5 Wars SEV Mod Update

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:

  • German Version (1.33) Mapcompiler & eng. mod bugs
  • SE5 AI Comparaison
  • SE:V Changelog v1.29
  • Diplomatic Bug in German Version 1.44
  • Construction Queues Screen
(c) Strategy First, Inc. All rights reserved.