• Hello and welcome to MSFC. We are a small and close knitted community who specialises in modding the game Star Trek Armada 2 and the Fleet Operations modification, however we have an open field for discussing a number of topics including movies, real life events and everything in-between.

    Being such a close community, we do have some restrictions, including all users required to be registered before being able to post as well as all members requiring to have participated in the community for sometime before being able to download our modding files to name the main ones. This is done for both the protection of our members and to encourage new members to get involved with the community. We also require all new registrations to first be authorised by an Administrator and to also have an active and confirmed email account.

    We have a policy of fairness and a non harassment environment, with the staff quick to act on the rare occasion of when this policy is breached. Feel free to register and join our community.

Adding Neutral objects ingame

Archonon

Master Chief Petty Officer of Starfleet
Joined
13 Aug 2016
Messages
539
Age
46
Hi folks, long time no see. It's been about six months since I've had my computer, having had moved twice during that time, but I've finally settled in. Hope everyone around here is doing well.

I'm jumping back into making my mod for A2 and I was wondering how I can add a neutral/hostile object that does not require me to use a map editor, if at all possible. I'm looking to add some random space monsters into my game, such as STIV's whale probe or TOS' Doomsday Machine.

I have seen mods that have Borg ships randomly show up from time to time, even spouting out their infamous "resistance is futile" line from First Contact and attack any faction on the map they come across. They wreck some havoc and then either fly off, or are destroyed by a player/AI. Is something like this only possible with a map editor?

I looked into adding my random monsters into the "Ferengi" race but I don't know if that would have the proper effect.

Thanks for any suggestions.

And one last AI related question. I'm pretty sure that there's no way to do this but just in case: Can the AI be made to stop building certain units after a time frame? What I mean is, I am modding races to be unlock more advanced ships through research (ENT, TOS, TMP, etc); once the AI researches TOS level ships, is there a way to prevent them from building back the older ENT techtree?

Again, thanks for any thoughts.
 
Last edited:

Rifraf

I know just enough to be a danger to myself
Joined
25 Aug 2013
Messages
1,225
Age
51
As far as I'm aware there's no way to "inject" ships into a map. You have to place them in the map editor that way every time you play the map they'll be there.

As for limiting what the AI builds just write it that way. Write your build list so that once it researches a certain thing then just stop writing in the previous generation ship to be built.

Here is an example I'm working with in my AI testing from my Klingon_offensive_list:

// Load up the basic structures...
#include "aipdef.h"

int checkTechnologyAvailable = 1;

Way_Better_Build_List_Element the_build_list[MAX_ELEMENTS] =
{
//--------------------------------------------------------------------

//
// Syntax: "ODF name", number to build, base to build at, max number from this

line, min tech level
//

//
// Phase I. Initial Base Setup
//

"kconst", 1,0, -1, 0, // construction ship
"kbase", 1,0, -1, 0, // starbase
"kconst", 1,0, -1, 0, // second construction ship
"korbital", 1,1, -1, 0, // build an orbital station
"kresear", 1,0, -1, 0, // basic research
"kyard", 1,0, -1, 0, // basic shipyard
"kcolony", 1,0, 1, 0, // colony ship
"kmining", 1,1, 3, 0, // 1st mining station
"kfreight", 3,0, -1, 0, // mining freighter
"kscout", 2,0, -1, 0, // scouts

//
// Phase II. Base Protection/Raiding Fleet
//

"kyard2", 1,0, -1, 0, // advanced shipyard
"kbattle2", 2,0, 1, 0, // Qehral
"klipod5", 1,0, -1, 0, // Tachyon Detection Grid (Scout)
"kdestroy", 2,0, 2, 0, // Bird of Prey
"kbattle2", 2,0, 1, 0, // Qehral
"klipod4", 1,0, -1, 0, // Gravity Mines ( Bird Of Prey)
"kdestroy", 2,0, 2, 0, // Bird of Prey
"kbattle2", 2,0, 1, 0, // Qehral
"kdestroy", 2,0, 2, 0, // Bird of Prey

//
// Phase III. Resource Expansion
//

"kmining", 1,2, 4, 0, // 2nd mining station
"kfreight", 2,0, -1, 0, // mining freighter
"korbital", 1,2, -1, 0, // 2nd orbital station
"kfreight", 2,0, -1, 0, // mining freighter
"kyard2", 1,1, -1, 0, // 2nd advanced shipyard
"kbattle2", 2,1, 2, 0, // Qehral
"kbattle2", 2,0, 2, 0, // Qehral
"kbattle2", 2,1, 2, 0, // Qehral
"kbattle2", 2,0, 2, 0, // Qehral

//
// Phase IV. Advanced Research/Upgrade Ships/Weapons/Production
//

"kresear2", 1,0, -1, 0, // advanced research station
"kupgrade", 1,0, -1, 0, // ship upgrade station
"klipod11", 1,0, -1, 0, // weapon upgrade level 2
"kbattle2", 2,1, 3, 0, // Qehral
"kbattle2", 2,0, 3, 0, // Qehral
"kbattle2", 2,1, 3, 0, // Qehral
"kbattle2", 2,0, 3, 0, // Qehral
"klipod21", 1,0, -1, 0, // weapon upgrade level 3

//
// Phase V. Ramp Up Warship Production
//

"kcolony", 1,0, 1, 0, // colony ship
"ksrepair", 1,0, -1, 0, // repair ship
"kmining", 1,3, 5, 0, // 3rd mining station
"kfreight", 3,0, -1, 0, // mining freighter
"klipod2", 1,0, -1, 0, // Poleron Torpedo (Vorcha)
"klipod12", 1,0, -1, 0, // shield upgrade level 2
"kbattle2", 2,1, 4, 0, // Qehral
"kbattle2", 2,0, 4, 0, // Qehral
"kcruise1", 2,0, -1, 0, // Vorcha
"kbattle2", 2,1, 4, 0, // Qehral
"kbattle2", 2,0, 4, 0, // Qehral
"klipod22", 1,0, -1, 0, // shield upgrade level 3

//
// Phase VI. End Game
//

"kyard2", 1,0, -1, 0, // 3rd advanced shipyard
"klipod1", 1,0, -1, 0, // Ion Cannon
"kbattle2", 2,0, -1, 0, // Qehral
"kbattle", 2,0, -1, 0, // Neghvar
"kbattle2", 2,1, -1, 0, // Qehral
"kbattle", 2,1, -1, 0, // Neghvar

};

You'll see after phase II I just don't have the AI build destroyers any more. They are too weak and use up resources that could be better used for battle ships.
 

CABAL

<< ■ II ▶ >>
Staff member
Administrator
Star Navigator
Rogue AI technocrat
Joined
15 Aug 2009
Messages
3,511
Age
33
The problem is that the AI treats it like a checklist so that if it loses one of those early ships it will rebuild it, no matter how out of date it is. For example, if the AI has teched-up to the post-Nemesis era and a Constitution-class is destroyed, it will build a replacement Connie, even though it could be spending its resources on Sovereigns.

There might be a way around this in FO4 with tech-dependent auto-replaceweapons and the originalClass line. For instance, give the Federation a generic Explorer build item that auto-replaces into a Constitution, Constitution Refit, Ambassador, or Galaxy depending on what's been researched and use originalClass to make them all appear to be the same class as far as the AI code and UI shortcuts are concerned. I'm not entirely sure that originalClass will trick the AI, though.
 

Rifraf

I know just enough to be a danger to myself
Joined
25 Aug 2013
Messages
1,225
Age
51
Oops on my part. Idiot here. :oops: Cabal's right. To limited degrees you can achieve this in A2 by using the tech level designations though I believe you can only establish so many tech levels before the game crashes. At least in my testing years ago.

Condensed from the Starbase 34 Tuts:

//
// Phase II. Research
//
"kresear", 1,0, -1, 2, // basic research
"kcolony", 1,0, 4, 0, // colony ship
"korbital", 1,1, -1, 0, // second orbital station
"kcruise1", 2,0, 4, -2, // Vorcha
"kmining", 1,2, -1, 0, // second mining station
"kfreight", 3,0, -1, 0, // mining freighters
"kturret", 2,2, 4, -3, // mining defense

The last number in the row designates the tech level. The "kresear" line starts tech level 2. The "kcruise1" line has a -2 at the end so that ship will be built any number of times until a new line appears with a 3 at the end noting the start of tech level 3.

So you can set up each "era" of research as a new tech level. So something like:

"fconnie", 1, 0,3, -1, // fed connie
"fmiranda" 1, 0, 3, -1, //fed miranda
"fresear", 1, 0, -1, 0, //basic research
"fedpod1", 1, 0, -1, 2, //TMP era

So once you research the TMP era all previous generation ships will no longer be built because they are locked at tech level 1 and your TMP research triggers tech level 2. I'm not sure though if you have to have a station set to trigger a tech level or if the research line itself can trigger it? You'll have to experiment.

There was a mod that did something similar to what you're doing years ago and I think it was the Starfleet Compilation Mod. You started with the earliest ships then used research to refit your starting ship and could then build the next generation of ships. Check it out for reference. I didn't see that you stated, but is this for stock A2 or FO?
 

Archonon

Master Chief Petty Officer of Starfleet
Joined
13 Aug 2016
Messages
539
Age
46
Thanks for your replies Rifraf and Cabal, it is very helpful.

I have not experimented with using tech level designations, my AI knowledge is functional at best. I am re-familiarizing myself, almost from scratch, with A2 modding since the last time I touched it...some point in 2007.

This is for stock A2, when I stopped modding FO was pretty new-ish and when I deconstructed the mod to see how it worked and see if I could learn it, well, I couldn't see anything. I know there are more lines of information in the odfs and weapons could be expanded upon (Such as carriers/fighters) but I couldn't see the sods in Storm 3D or make heads or tails of how it all worked.

I will look at the Starfleet Compilation Mod for reference to see if I can get some ideas. I will also look into the tech levels and see if I can make it work like that. If I can't, it's not the end of the world, as much as I like the idea of having the AI keep to specific areas after a time, I understand that there are a lot of limitations to vanilla A2. I mostly use research of "events" or specific technology to restrict ship/station construction but that might be too complicated for the AI.

Just so you get an idea as to how complicated my AI would be here is my Federation Tech Tree:

Starting Unit:
NX beta evolves into Memory Alpha station (Chooses background history of Earth and tech tree: United Earth or Terran Empire)
//
Tech tree 1
1) United Earth (Tech tree branches into two possible UFP tech trees)
2) Terran Empire (Enterprise Era)
//
Tech tree 2
1A) United Federation of Planets (Prime Universe, TOS Era)
1B) United Federation of Planets (AR Universe, Axanar Era)
2) Terran Empire (TOS Era)
//
Tech tree 3
1A) United Federation of Planets (Prime Universe, TMP Era)
1B) United Federation of Planets (AR Universe, Kelvin Era)
2) Terran Empire (TMP Era)
//
Tech tree 4
2) Terran Empire (TNG/DS9/Voy Era)

Most likely I will only create an AIP for the Terran Empire and have the AI use those units. But it would be nice to be able to see an Imperial Galaxy running around without Archer's ISS Enterprise flanking them in battle.

Thanks again for the tips!
 
Top