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 134 guests online.

Online users

  • Randallw
  • Pham Nuwen

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

AI modding... Help me, please!!!

Submitted by Lastdreamer on Tue, 2008-01-29 07:25. SE:V MODs

I want to let AI use the new component I've created in my personal mod, and looking a little bit around the AI files, I've seen how to make... or I think so.

I've created 3 new component (at least in this moment...):

1) Temporal Shield (block anything)
2) Self Repairing Armor (Armor which repair itself like Organic)
3) Self Repairing Emissive Armor (Self Repairing and Emissive...)

If I don't make a mistake, I must add in file "Script_AI_GlobalConstants_Components.txt" the entry, like this:

1) AI_COMPONENT_TEMPORAL_SHIELD_GENERATOR: string := "Temporal Shield Generator"
2) AI_COMPONENT_SELF_REP_ARMOR: string := "Self Repairing Armor"
3) AI_COMPONENT_SELF_REP_EMISSIVE_ARMOR: string := "Self Repairing Emissive Armor"

and then in file "Script_AI_DesignCreation.txt" in the "Get_Best_Component_Of_Type" function I must add this modification:

1) for Temporal Shield in the section "AI_GEN_COMP_TYPE_SHIELD":

set comp_id := Sys_Get_Component_With_Name(sys_long_Player_ID, AI_COMPONENT_TEMPORAL_SHIELD_GENERATOR)
if (Sys_Is_Component_Available(sys_long_Player_ID, comp_id) then set final_comp_id := comp_id
endif
if (final_comp_id = 0) then
set comp_id := Sys_Get_Component_With_Name(sys_long_Player_ID, AI_COMPONENT_PHASED_SHIELD_GENERATOR)
if (Sys_Is_Component_Available(sys_long_Player_ID, comp_id)) then set final_comp_id := comp_id
endif
if (final_comp_id = 0) then
set comp_id := Sys_Get_Component_With_Name(sys_long_Player_ID, AI_COMPONENT_SHIELD_GENERATOR)
if (Sys_Is_Component_Available(sys_long_Player_ID, comp_id)) then
set final_comp_id := comp_id
endif
endif
endif

2 and 3) here come the trouble... the file "Script_AI_DesignCreation.txt" refer to "Get_Wanted_Component_From_List", but I don't undestand this part... where I can manipulate this list?

And one last thing... when I finished mod all this file... how can I compile all this file to let empire use them?

‹ Help with a little bit of comp. code Creating Racial Traits ›
» 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.
Isopsyco's picture
Mod Designer

Re: AI modding... Help me, please!!!

Submitted by Isopsyco on Tue, 2008-01-29 08:06.

AI Scrips List.txt data file has the list, however, each Empire_main script has a section where it loads the list with the wanted tech.

» login or register to post comments

Re: AI modding... Help me, please!!!

Submitted by Lastdreamer on Tue, 2008-01-29 08:55.

thanks!

But now I don't understand one thing... how function this entries?

call lst_Armor_Wanted_Name.add(AI_COMPONENT_EMISSIVE_ARMOR)
call lst_Armor_Wanted_Tech_Area.add(AI_TECH_AREA_ARMOR)
call lst_Armor_Wanted_Tech_Level.add(20)

As I can see, the first is the name of the component, as in Global Constant files, the second is the tech area... and the third? What make the third entry?

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

Re: AI modding... Help me, please!!!

Submitted by Isopsyco on Tue, 2008-01-29 14:06.

these are actually three related lists being filled,
this is the one you want to add your component to:
call lst_Armor_Wanted_Name.add(AI_COMPONENT_EMISSIVE_ARMOR)

This one just keeps track of the tech area that its in:
call lst_Armor_Wanted_Tech_Area.add(AI_TECH_AREA_ARMOR)

And this one associates the level needed to obtain it. If you look in the Script_AI_GlobalResearch.txt you'll see how it keeps research areas populated and the empire on track in the right tech area to obtain certain tech/components.
call lst_Armor_Wanted_Tech_Level.add(20)

» login or register to post comments

Re: AI modding... Help me, please!!!

Submitted by Lastdreamer on Tue, 2008-01-29 14:56.

I've tried to add the new armor I've added, but it seem the AI don't use them anyway... maybe there is any metod to set "priorities"?

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

Re: AI modding... Help me, please!!!

Submitted by Captain Kwok on Tue, 2008-01-29 15:01.

The AI proceeds through the lists from first to last entry, so the most preferred armor should be listed first.


Space Empires Depot | SE:V Balance Mod

» login or register to post comments

Re: AI modding... Help me, please!!!

Submitted by Lastdreamer on Tue, 2008-01-29 15:12.

Thanks!!!

» login or register to post comments

Re: AI modding... Help me, please!!!

Submitted by Brad on Tue, 2008-01-29 15:59.

Shameless Plug: http://www.spaceempires5.com/en-US/node/5037

Down in part four there's stuff about getting the AI to use new components in its designs.

» login or register to post comments

Re: AI modding... Help me, please!!!

Submitted by Lastdreamer on Wed, 2008-01-30 07:43.

Thanks to all!!! All this info make a good start for me to mod AI and Script!!!

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

  • Research By Percentage SUCKS
  • Hows the current AI?
  • Cross Sector Reinforcements
  • Space Empires V 1.74
  • A Few Questions and Observations

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:

  • Play By FTP script 0.11.0-b
  • 1.17 - the Crashes I'm seeing
  • Space Empires V 1.74
  • Proposition for new, more streamlined treaty interface
  • IRC Transcript of Q/A with Aaron Hall!
(c) Strategy First, Inc. All rights reserved.