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

Connexion utilisateur

  • Créer un nouveau compte
  • Demander un nouveau mot de passe

Navigation

  • news
    • archive
    • blogs
    • books
    • forums
    • recent posts
    • groups
  • image galleries
  • projects & downloads
  • search
  • create content
  • agrégateur de nouvelles

Rechercher

Qui est en ligne

Il y a actuellement 1 utilisateur et 144 invités en ligne.

Languages

  • English English
  • French French

Parcourir les archives

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

Help needed with component coding

Soumis par CP1985 le Dim, 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 ›
» Vous devez vous identifier ou créer un compte pour écrire des commentaires

Options d'affichage des commentaires

Sélectionnez la méthode d'affichage des commentaires que vous préférez, puis cliquez sur "Sauvegarder les paramètres" pour activer vos changements.

Re: Help needed with component coding

Soumis par Lastdreamer le Lun, 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...

» Vous devez vous identifier ou créer un compte pour écrire des commentaires
Mod Designer

Re: Help needed with component coding

Soumis par Fyron le Lun, 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

» Vous devez vous identifier ou créer un compte pour écrire des commentaires
Mod Designer

Re: Help needed with component coding

Soumis par CP1985 le Lun, 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?

» Vous devez vous identifier ou créer un compte pour écrire des commentaires

Re: Help needed with component coding

Soumis par Brad le Lun, 2008-02-04 18:21

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

» Vous devez vous identifier ou créer un compte pour écrire des commentaires
Mod Designer

Re: Help needed with component coding

Soumis par CP1985 le Lun, 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?

» Vous devez vous identifier ou créer un compte pour écrire des commentaires
Mod Designer

Re: Help needed with component coding

Soumis par Fyron le Lun, 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

» Vous devez vous identifier ou créer un compte pour écrire des commentaires
Mod Designer

Re: Help needed with component coding

Soumis par CP1985 le Mar, 2008-02-05 02:35

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

» Vous devez vous identifier ou créer un compte pour écrire des commentaires

Options d'affichage des commentaires

Sélectionnez la méthode d'affichage des commentaires que vous préférez, puis cliquez sur "Sauvegarder les paramètres" pour activer vos changements.

Now on STEAM

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

Contenu populaire

Aujourd'hui :

  • Research By Percentage SUCKS
  • Cloaked Warp Points
  • Capturing suicidal colony ships of Balance Mod AI empires
  • Space Empires V 1.74
  • Space Empires V

Depuis toujours :

  • 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

Dernier accès :

  • 1.58 and the Unnamed mod?
  • Refitting Satellites and Weapon Platforms
  • long-term RP PBW
  • Ai + mod question
  • Multiple Weapons Question
(c) Strategy First, Inc. All rights reserved.