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 4 users and 182 guests online.

Online users

  • Astroshak
  • Piffle
  • mudshark
  • awolf

Languages

  • English English
  • French French

Browse archives

« Juillet 2008  
Lu Ma Me Je Ve Sa Di
  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

Help needed with component coding

Submitted by CP1985 on Sun, 2008-02-03 22:23. SE:V MODs

Hi guys, I apologize for asking so many questions but I have another question. In my mod all space vehicles(except units) require an energy reactor. (Nuclear,fusion,fission,quantum etc,.) I had an idea that more advanced components require a better reactor. Anti - Matter engines require at least a fusion reactor. The function get_specific_component_design works fine for this. The problem is how do I also code it to accept higher up reactors? Putting "or" between the functions didn't work.

An example of what I want to do, in vehicle sizes the Bridge requirement has an "or" between the two functions for Bridge and Master Computer. Is this not possible for the Components file?

‹ Mod coding help Damage Control Component ›
» 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: Help needed with component coding

Submitted by Lastdreamer on Mon, 2008-02-04 04:32.

I don't know for sure, but I think that you can make one rquirement field for each Reactor the engine can require and set an OR in the Placement field...

» login or register to post comments
Mod Designer

Re: Help needed with component coding

Submitted by Fyron on Mon, 2008-02-04 13:20.

This is definitely doable. What have you tried doing that did not work (just the component name and requirement fields for each component will suffice)? Make sure you are doing this in 1.66, since these sorts of function calls did not even work in the component req fields until very recent versions.


SpaceEmpires.net | Space Empires Wiki

» login or register to post comments
Mod Designer

Re: Help needed with component coding

Submitted by CP1985 on Mon, 2008-02-04 17:10.

I'm running SE5 1.66

What I've tried so far is Get_Specific_Design_Component_Count("Fusion Reactor") = 1, or """"("Fission Reactor") = 1, or """"("Quantum Reactor") = 1

That didn't work. I was hoping it would read like it does in Vehicle sizes where you can either place a Master Computer or Bridge component.

Maybe an iif statement would work here? Problem is I can never get the format right.

Any Ideas?

» login or register to post comments

Re: Help needed with component coding

Submitted by Brad on Mon, 2008-02-04 18:21.

Just to be sure, you didn't use commas in the actual formula did you?

» login or register to post comments
Mod Designer

Re: Help needed with component coding

Submitted by CP1985 on Mon, 2008-02-04 19:09.

I removed the commas, still doesn't work. Adding a fusion reactor satisfies the requirement, but it wont let me add a more advanced one to the design. Why is "Or" not recognized?

» login or register to post comments
Mod Designer

Re: Help needed with component coding

Submitted by Fyron on Mon, 2008-02-04 20:28.

Its a single boolean formula, not a list. The whole thing has to evaluate to TRUE for the requirement to be satisfied. You have 3 separate items that could all trigger the requirement, which is of the form A OR B OR C (where A is a GSDCC()=1 bit).

Note that GSDCC() is a function that returns a number. That number is then tested to see if it is equal to one by the = operator. If it is, the = operation returns TRUE. Else, it returns FALSE. OR is an operator that compares two boolean values (TRUE/FALSE), and returns TRUE if at least one of those values is TRUE. Else, it returns FALSE.

I would recommend using >= 1 instead of just =, since the requirement will fail to be satisfied if you add two Fusion Reactors to a ship (even if they are one per ship, its a better habit to always do >= when you don't explicitly need = ).

(Get_Specific_Design_Component_Count("Fusion Reactor") >= 1) OR (Get_Specific_Design_Component_Count("Fission Reactor") >= 1) OR (Get_Specific_Design_Component_Count("Quantum Reactor") >= 1)


If you look more carefully at the bridge/master computer requirement in VehicleSizes.txt, you will see that it is written in the same format (OR is apparently not case sensitive):

(Get_Design_Ability_Component_Count("Control Center") = 1) or (Get_Design_Ability_Component_Count("Master Computer") >= 1)


SpaceEmpires.net | Space Empires Wiki

» login or register to post comments
Mod Designer

Re: Help needed with component coding

Submitted by CP1985 on Tue, 2008-02-05 02:35.

Thanks a bunch Fyron and to all that helped. The last formula worked.

» 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 Wars SEV Mod Update
  • SEV 1.74 misc. Issues and Suggestions
  • Starting with custom empires
  • Research By Percentage SUCKS
  • Space Empires V 1.74

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:

  • AI - 1.13
  • Space Empires V 1.74
  • Creating the Peace
  • Ships Inner Hulls, Planets, Climate Control and Intel
  • Default ShipSet
(c) Strategy First, Inc. All rights reserved.