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 5 utilisateurs et 229 invités en ligne.

Utilisateurs en ligne

  • Deinonychus_Ant...
  • Randallw
  • mudshark
  • MondoMage
  • goduranus

Languages

  • English English
  • French French

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

Script function to find particular component?

Image de Isopsyco
Soumis par Isopsyco le Jeu, 2007-12-20 08:38 SE:V MODs

Anyone know how to get a particular component from a ship and determine if its damaged?

I've looked through the script function lists and see that a list can be generated by component ID. What is the component ID referenced to? If I wanted to check and see if any ship has component X and its damaged how do I reference the component ID?

‹ Question about abilities DevnullMod 1.0.0 Initial Release ›
» 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.
Image de Psieye

Re: Script function to find particular component?

Soumis par Psieye le Jeu, 2007-12-20 10:09

Hmm... depending on exactly what sort of component (i.e. one-per-ship or not) you're thinking of, is there something that could be done with using AI tags as a marker?

---Sig---
Playing Touhou games (Go to this Wiki if interested. No, nobody else is that good/insane as that replay). No rush for SE

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

Re: Script function to find particular component?

Soumis par Isopsyco le Jeu, 2007-12-20 11:01

Even with an AI tag, how would you determine if its damaged? The functions in the script docs don't have one that does this directly, they have one that gets the component ID, which I'm not sure how that is associated. How would one set up a loop to look through all the components on a ship and single out a particular one (or several if its carrying more than one).

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

Re: Script function to find particular component?

Soumis par Corellon le Sam, 2007-12-22 13:46

Well the way I was handling things was to loop though all the components in the ship,

for index := 1 to Sys_Get_Space_Object_Comp_Count(ship_id) do
set comp_id := Sys_Get_Component_With_Name(sys_long_Player_ID, AI_COMPONENT_(Component Name))
set comp_id2 := Sys_Get_Space_Object_Comp_Info_Comp_ID( ship_id, index)
if (comp_id2 = comp_id ) then
set damage level := Sys_Get_Space_Object_Comp_Info_Comp_Tonnage_Structure(ship_id, index) / Sys_Get_Space_Object_Comp_Info_Comp_Tonnage_Damage(ship_id, index)
endif
endfor

It's not as easy as a function call, but it works, and it can check for multiple components of the same type

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

Re: Script function to find particular component?

Soumis par Isopsyco le Dim, 2007-12-23 00:22

Corellon wrote:
Well the way I was handling things was to loop though all the components in the ship,

for index := 1 to Sys_Get_Space_Object_Comp_Count(ship_id) do
set comp_id := Sys_Get_Component_With_Name(sys_long_Player_ID, AI_COMPONENT_(Component Name))
set comp_id2 := Sys_Get_Space_Object_Comp_Info_Comp_ID( ship_id, index)
if (comp_id2 = comp_id ) then
set damage level := Sys_Get_Space_Object_Comp_Info_Comp_Tonnage_Structure(ship_id, index) / Sys_Get_Space_Object_Comp_Info_Comp_Tonnage_Damage(ship_id, index)
endif
endfor

It's not as easy as a function call, but it works, and it can check for multiple components of the same type


Corellon!! Thanks a bunch, you just saved me several hours of testing functions and script to see if those functions would do the job! The script manual isn't very clear on the syntax limits and what values its asking for when its a name.
Thanks again!!

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

Re: Script function to find particular component?

Soumis par Corellon le Dim, 2007-12-23 11:38

Isopsyco,

Your welcome, I know some things aren't very clear, usually I use the CodeListing_Interface.txt located in the scriptphaser directory to lookup functions but even that is kinda out of date and wrong, in a couple places it calls for a long but expects a string or visa versa (with the queue checks of the top of my head, seems it was a cut and paste job but the planet queue fuction takes facility_id as a long, while the system queue check takes a string with the facility name (but the file still says it takes a long)

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

  • Babylon 5 Wars SEV Mod Update
  • Known SE5 v1.74 Bugs
  • Research By Percentage SUCKS
  • Space Empires V and VI: Expansions and the Future: Tell the Company What's on Your Wish List
  • Bad Bookkeeping

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 :

  • Fighter Defence of Planets
  • Silly question...
  • Warp Point modding question, and a couple of other mod Q's too.
  • Fleets register as Space_Object_Type_Ship
  • Ship/planet detail report window
(c) Strategy First, Inc. All rights reserved.