This site is in archival mode. A replacement is being developed. In the meantime, please use the PBW2 Forums for community discussions. The replacement software for this site will use a unified account system with PBW2, and any newly created threads will carry over.
Welcome to Spaceempires.net
Login or Register

Search
Modules
· Content
· Downloads
· Forums
· Game Info
· Image Gallery
· Links
· Shipyards
· Topics
· Staff

User Info
· Welcome, Anonymous
Membership:
· New: Astorre
· New Today: 0
· New Yesterday: 0
· Overall: 3155

People Online:
· Visitors: 603
· Members: 0
· Total: 603

  

Spaceempires.net :: get_empire_specific_facility_count :: View topic
Forum FAQ :: Search :: Memberlist :: Usergroups :: Profile :: Log in to check your private messages :: Log in


get_empire_specific_facility_count

 
Post new topic   Reply to topic    Spaceempires.net Forum Index -> SEV Modding Discussion
View previous topic :: View next topic  
Author Message
Shoe
Space Emperor


Joined: Jan 13, 2009

PostPosted: Tue May 19, 2015 11:58 am    Post subject: get_empire_specific_facility_count Reply with quote

Hi, I'm trying to mod facilities that there can only be one of in an empire. It's pretty easy to add impossible requirements, but the modding guide lists a way to do it properly - which has the added advantage of letting a player move the facility, or replace a destroyed one. I'm trying to use get_empire_specific_facility_count, but it doesn't seem to work...

here's the facilities.txt
Code:

Name                                            := Homeworld Research Center
Description                                     := High-Tech researching facility that develops new technology for a society.
Facility Group                                  := Research
XFile Class Name                                := Central Computer Complex
Picture Number                                  := 24
Maximum Level                                   := 11
Tonnage Space Taken Formula                     := 1000
Tonnage Structure Formula                       := 10000
Cost Minerals Formula                           := 15000 + (([%Level%] - 1) * 1500)
Cost Organics Formula                           := 2500 + (([%Level%] - 1) * 250)
Cost Radioactives Formula                       := 2500 + (([%Level%] - 1) * 250)
Number Of Requirements                          := 3
Requirements Evaluation Availability            := AND
Requirements Evaluation Allows Placement        := TRUE
Requirements Evaluation Allows Usage            := TRUE
Requirement 1 Description                       := Empire must have at least tech level 1 in Applied Research.
Requirement 1 Formula                           := Get_Empire_Tech_Level("Applied Research") >= [%Level%]
Requirement 2 Description                       := Empire must not have any Homeworld Research Centers.
Requirement 2 Formula                           := Get_Empire_Specific_Facility_Count("Homeworld Research Center") <= 0
Requirement 3 Description                       := Empire must not be constructing any Homeworld Research Centers.
Requirement 3 Formula                           := Get_Empire_Queues_Specific_Facility_Count("Homeworld Research Center") <= 0
Number of Abilities                             := 2
Ability 1 Type                                  := Point Generation - Research
Ability 1 Description                           := Research Centers generate [%Amount1%] research points per turn.
Ability 1 Scope                                 := Space Object
Ability 1 Range Formula                         := 0
Ability 1 Amount 1 Formula                      := (iif(Empire_Is_Human_Controlled([%PlayerNumber%]), 1, 1) * (10000 + ((Get_Empire_Tech_Level("Applied Research") - 1) * 2000)) / (Get_Empire_Specific_Facility_Count("Homeworld Research Center")))
Ability 1 Amount 2 Formula                      := 0
Ability 2 Type                                  := Description Only
Ability 2 Description                           := Additional Homeworld Research Centers in your empire cause production to decrease proportionately.
Ability 2 Scope                                 := Space Object
Ability 2 Range Formula                         := 0
Ability 2 Amount 1 Formula                      := 0
Ability 2 Amount 2 Formula                      := 0

Am I doing something wrong, or is the function broken?


Person(s) denying the existence of killer robots may be killer robots themselves.


Back to top
Skyburn
Space Emperor


Joined: Mar 12, 2008

PostPosted: Wed May 20, 2015 1:37 am    Post subject: Reply with quote

The function does work. This is how I made a one per empire facility in Skymod:
Code:
Requirement 3 Description                       := There is a limit of one Capitol per empire.
Requirement 3 Formula                           := (Get_Empire_Specific_Facility_Count("Capitol") = 0) and (Get_Empire_Queues_Specific_Facility_Count("Capitol") = 0) and ([%NumQueueItemsAdding%] = 1)


Back to top
Shoe
Space Emperor


Joined: Jan 13, 2009

PostPosted: Wed May 20, 2015 9:25 pm    Post subject: Reply with quote

Your formula does stop more than one facility being placed, but if i scrap the facility it can't be re-placed. Also, if i take out everything but get_empire_specific_facility_count, then it doesnt appear to apply any restrictions whatsoever.

Does this match your experience? I feel like i'm messing something up.

Note, I'm modding on top of BM 1.20


Person(s) denying the existence of killer robots may be killer robots themselves.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    Spaceempires.net Forum Index -> SEV Modding Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
All logos and trademarks used on this site, all comments and stories posted for reading, all files hosted for download,
and all art work hosted for viewing are property of their respective owners; all the rest copyright 2003-2010 Nolan Kelly.
Syndicate news: SpaceEmpires.net News RSS Feed - Syndicate forums: SpaceEmpires.net Forums RSS Feed
Page Generation: 4.01 Seconds