Author Topic: Setup Scripts  (Read 3513 times)

Offline Kahuna

  • Core Member
  • *****
  • Posts: 2,222
  • Kahuna Matata!
Setup Scripts
« on: July 24, 2012, 05:16:28 am »
Can I make my own setup scripts? If yes how and where?
« Last Edit: July 24, 2012, 05:20:43 am by Kahuna »
set /A diff=10
if %diff%==max (
   set /A me=:)
) else (
   set /A me=SadPanda
)
echo Check out my AI War strategy guide and find your inner Super Cat!
echo 2592 hours of AI War and counting!
echo Kahuna matata!

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Setup Scripts
« Reply #1 on: July 24, 2012, 11:10:27 am »
Yes, they're all in (ai war)\RuntimeData\Logic\LobbySetupScripts\

Basically take a look at the ones that are already there, copy one, and fiddle with it :)

If you have questions, let me know.  Eventually I should get around to posting all the commands, etc, just short on time right now, and there hadn't been all that much interest.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Mick

  • Hero Member Mark II
  • *****
  • Posts: 911
Re: Setup Scripts
« Reply #2 on: July 24, 2012, 12:17:33 pm »
Oh sweet, I didn't know we could make our own. I just figured we couldn't because there wasn't anything in the mod forum about it.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Setup Scripts
« Reply #3 on: July 24, 2012, 12:21:06 pm »
Oh sweet, I didn't know we could make our own. I just figured we couldn't because there wasn't anything in the mod forum about it.
Haha, yea.  I wrote the scripting language for it (rather than hardcoding the stuff) specifically so people could mod it and figured people would work out crazy "this script gives you a random scenario within a fairly narrow range of difficulty with (blah blah blah)" stuff in no time.  Then the crickets began their chirping ;)  So I pretty much let it go and moved on to more general work.  And then people don't realize its moddable and so the lack of interest remains, etc. 

Anyway, I hope someone has some fun with it, implementing the language and default scripts probably took me a full week :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Mánagarmr

  • Core Member Mark V
  • *****
  • Posts: 4,272
  • if (isInRange(target)) { kill(target); }
Re: Setup Scripts
« Reply #4 on: July 24, 2012, 12:33:40 pm »
Anything with the word "script" in it makes my brain swim.
Click here to get started with Mantis for Suggestions and Bug Reports.

Thank you for contributing to making the game better!

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Setup Scripts
« Reply #5 on: July 24, 2012, 12:37:34 pm »
I think having an option to "export" a lobby layout to a script would help out immensely. (There is a mantis on there somewhere, I think)

Yea, it wouldn't have any randomization or other fancy options, but it would serve as a nice starting point for more advanced scripts. (Taking care of lots of the "boilerplate" and stuff)

Offline _K_

  • Full Member Mark III
  • ***
  • Posts: 219
Re: Setup Scripts
« Reply #6 on: July 24, 2012, 02:57:05 pm »
Yeah i was interested and asked for some more info on some things with the scripting language, specifically the exact names of map setups and AI types.

Got no replies whatsoever. Twice.
http://www.arcengames.com/forums/index.php/topic,10913.msg109384.html#msg109384

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Setup Scripts
« Reply #7 on: July 24, 2012, 03:15:03 pm »
Yeah i was interested and asked for some more info on some things with the scripting language, specifically the exact names of map setups and AI types.

Got no replies whatsoever. Twice.
http://www.arcengames.com/forums/index.php/topic,10913.msg109384.html#msg109384
Sorry, I saw the first one and probably thought I replied, and didn't actually see the second one.

AIType:
Code: [Select]
    Entrenched_Homeworlder, //planets all heavily defended, does moderate attacks on players
    Vicious_Raider, //planets all moderately defended, does heavy attacks on players
    Fortress_Baron, //planets mostly moderately defended, but the core planets are incredibly highly defended
    Sledge_Hammer, //all guys are routed to one planet, then the next
    Assassin, //planets all moderately defended, harasses the strongest player with prejudice
    Bully, //planets all moderately defended, harasses the weakest player with prejudice
    Turtle, //planets all very-to-incredibly heavily defended, but no attacks on players
    Technologist_Homeworlder, //planets all heavily defended, does moderate attacks on players with higher technology
    Technologist_Raider, //planets all moderately defended, does heavy attacks on players with higher technology
    Mad_Bomber=10, //planets all lightly defended except core, does extremely heavy attacks on players
    Feeding_Parasite, //uses parasite raids almost exclusively
    Stealth_Master, //uses stealth raids almost exclusively
    Special_Forces_Captain, //uses special forces in place of regular guard posts
    Train_Master, //uses many, many astro trains
    Teleporter_Turtle, //like the turtle, but specializing in teleporting ships
    Counter_Spy, //uses the counterspy superweapon on every planet, making the player fight blind
    Scorched_Earth, //destroys any planet it is knocked off of
    Shadow_Master, //like the stealth master, but also has the Planetary Cloaker
    Attritioner, //planets moderately defended except for Attrition Emitters, does heavy attacks on players
    Backdoor_Hacker=20, //planets moderately defended, has a backdoor wormhole to each player's planet
    Random_Easier,
    Random_Moderate,
    Random_Harder,
    Random_All,
    Mine_Enthusiast, //lots of mines around wormholes
    The_Tank, //tanks, plus harder attacks
    Random_Moderate_And_Easier,
    Technologist_Parasite, //like feeding parasite, but higher tech
    Technologist_Turtle, //like turtle, but higher tech
    Technologist_Sledge_Hammer=30, //like sledge hammer, but higher tech
    The_Core, //only uses core ships
    Raid_Engine, //uses many raid engines (expansion 1)
    Alarmist, //use many alarm posts (expansion 1)
    Random_Harder_Non_Technologist,
    Random_All_Non_Technologist,
    Camouflager, //all mobile ships have camouflage (expansion 1)
    Experimentalist, //uses all experimental ships (expansion 1)
    StarfleetCommander, //uses only starships (expansion 1)
    ZenithDescendant, //uses only zenith ships (expansion 1)
    Golemite=40, //uses many golems (expansion 1)
    SpeedRacer, //uses speed-enhancing ships all over (expansion 1)
    Peacemaker, //uses anti-golem/starship/wearhead etc weapons (expansion 1)
    RadarJammer, //uses radar jammers on all its planets (expansion 1)
    OneWayDoormaster, //uses black hole machines on all its planets (expansion 1)
    TagTeamer, //defensive AI whose guards don't use stay near their posts (expansion 1)
    ShieldNinny, //planets all heavily defended, with planetary shield boosts or inhibits but no attacks on players (expansion 1)
    GravDriller, //aggressive AI with many gravity drill stations (expansion 1)
    NeinzulClusterBomber, // builds Neinzul Clusters on all of its planets (expansion 2)
    NeinzulViralEnthusiast, // builds Neinzul Viral Clusters on all of its wormholes (expansion 2)
    NeinzulNester, // builds Neinzul Nests on most of its planets (expansion 2)
    NeinzulYoungster, // waves are all Neinzul Younglings, waves warning time / 2, planets lightly defended (expansion 2)
    SupportCorps, // no waves, adds supporting units to ally waves, adds supporting units to own planets and ally planets (expansion 2)
    WarpJumper, // no warp gates, can launch waves against any non-warp-jammed planet (expansion 2)
    Vanilla, // expansion 3
    Everything, // expansion 3
    Retaliatory, // counter attack posts seeded lots (expansion 3)
    Spireling, // starts will all spire bonus types unlocked (expansion 3)
    CraftySpire, // seeds lots of various spirecraft (expansion 3)
    Thief, // starts with and uses lots of etherjet tractors, spire tractor platforms, parasites (expansion 3)
    ExtremeRaider, // Vicious Raider ++ (expansion 3)
    SpireHammer, // Includes a Spire Capital Ship in every wave (expansion 3)

The comments may not be accurate, and ignore the ordinal values.

MapStyle:
Code: [Select]
    Simple,
    Realistic,
    Simple_Hubs,
    Realistic_Hubs,
    EXP1_Tree,
    EXP1_Spokes,
    EXP1_Snake,
    EXP1_Vines,
    EXP1_Lattice,
    EXP2_ConcentricCircles,
    EXP2_XShaped,
    EXP3_Grid,
    EXP3_Crosshatch,
    EXP3_MazeRecursiveBacktracker,
    EXP3_MazeRecursiveBacktrackerEasy,
    EXP3_MazeRecursiveBacktrackerAngled,
    EXP3_MazeRecursiveBacktrackerAngledEasy,
    EXP3_MazePrims,
    EXP3_MazePrimsAngled,
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Cyborg

  • Master Member Mark III
  • *****
  • Posts: 1,957
Re: Setup Scripts
« Reply #8 on: July 25, 2012, 11:14:13 pm »
I know I have said it, as well as others, but these setup scripts need to be integrated with the lobby. We need to be able to copy out our current setup and paste in other setups into the game. This is the easiest way, as most people don't want to bother with programming. What they really want is to copy other game setups and post action reports.
Kahuna strategy guide:
http://www.arcengames.com/forums/index.php/topic,13369.0.html

Suggestions, bugs? Don't be lazy, give back:
http://www.arcengames.com/mantisbt/

Planetcracker. Believe it.

The stigma of hunger. http://wayw.re/Vi12BK

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Re: Setup Scripts
« Reply #9 on: July 25, 2012, 11:26:57 pm »
I know I have said it, as well as others, but these setup scripts need to be integrated with the lobby. We need to be able to copy out our current setup and paste in other setups into the game. This is the easiest way, as most people don't want to bother with programming. What they really want is to copy other game setups and post action reports.

Yes, as a lower priority feature request, better integration with setup scripts and setup script features, and the GUI. As I said, especially nifty would be the ability to "export" simple scripts from the game setup lobby.

Now, I am fine with the complicated scripting features, like advanced randomization, strings of boolean logic, or arithmetic to determine numeric settings, to not have an nice GUI way to create them. But even an easy way to export a simple script would be very useful.

(Yes, I do realize I am repeating myself ;))

Offline Kahuna

  • Core Member
  • *****
  • Posts: 2,222
  • Kahuna Matata!
Re: Setup Scripts
« Reply #10 on: July 26, 2012, 10:00:29 am »
So "FastAndDangerous" is normal speed?

What are these  ???
"DeclareVariable("Int","RandomRoll");"
"SetIntVariableToRandom("RandomRoll",1,4);"

SetIntVariableToRandom("RandomRoll",1,1999999999); = wut ???

SetMapSeed(RandomRoll); = Random seed? If I want to use "123456" seed how do I do that?

How do I disabled certain ship types(Swallowers)? And how do I specify which Minor Factions, AI Modifiers and AI Plots I want? I don't want them to be random.

When specifying the AI types can I make it so it selects pairs of AIs.. like ::)..
AI 1/2
Raid Engine/One Way Doormaster
Speed Racer/Tag Teamer
Spire Hammer/Support Corps
Instead of
AI 1
Raid Engine
Speed Racer
Spire Hammer
AI 2
One Way Doormaster
Tag Teamer
Support Corps
If the AI 1 is Raid Engine the AI 2 should be One Way Doormaster and so on.

I'm trying to make a challenge setup script.
set /A diff=10
if %diff%==max (
   set /A me=:)
) else (
   set /A me=SadPanda
)
echo Check out my AI War strategy guide and find your inner Super Cat!
echo 2592 hours of AI War and counting!
echo Kahuna matata!

Offline amethyst

  • Newbie Mark III
  • *
  • Posts: 36
Re: Setup Scripts
« Reply #11 on: July 26, 2012, 10:19:42 am »
Would anyone mind if I tried writing up a few notes about the setup scripts for the wiki? I'm planning to dig into them a bit more soon, so I might as well share what I understand of it. I'd also include the info from this thread, of course.

Offline Hearteater

  • Core Member
  • *****
  • Posts: 2,334
Re: Setup Scripts
« Reply #12 on: July 26, 2012, 10:32:57 am »
What are these  ???
"DeclareVariable("Int","RandomRoll");"
"SetIntVariableToRandom("RandomRoll",1,4);"
First line declare a variable called RandomRoll that is of type Int (aka, integer, aka, whole number).
Second line sets the variable RandomRoll to a random number from 1 to 4 (so: 1, 2, 3 or 4).

Quote
SetIntVariableToRandom("RandomRoll",1,1999999999); = wut ???

SetMapSeed(RandomRoll); = Random seed? If I want to use "123456" seed how do I do that?
First line here is setting RandomRoll to a random number from 1 to 1999999999.
Second line is setting the Map Seed to the RandomRoll, which has just been assigned a suitable random number.  If you wanted 123456 specifically, try: SetMapSeed(123456);

If you want to see it in another language, those four lines would look something like this:

Code: [Select]
int RandomRoll;
RandomRoll = random(1,4);
RandomRoll = random(1,1999999999);
SetMapSeed(RandomRoll);

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Setup Scripts
« Reply #13 on: July 26, 2012, 10:58:34 am »
@Cyborg: yes, an export option is needed, I just don't have time right now.

So "FastAndDangerous" is normal speed?
Correct; it used to be that what's now "Epic" was normal and what's now normal was "Fast And Dangerous".  The actual definition:
Code: [Select]
public enum CombatStyle
{
    Normal,
    FastAndDangerous,
    Blitz
}

On the questions about the randoms, Hearteater is correct.

Quote
How do I disabled certain ship types(Swallowers)?

Code: [Select]
RemoveOptionalShipCategory("Swallowers");
Here's the corresponding enum:
Code: [Select]
public enum OptionalShipCategory
{
    Cloaking,
    Teleporting,
    HeavyDefense,
    Mines,
    Parasites,
    Starships,
    Turrets,
    TractorBeams,
    CoreShieldGenerators,
    Swallowers,
    Length
}
FYI, whenever you see "None" at the beginning and/or "Length" at the end of one of those, just ignore it.  Definitely don't use it ;) It's just for our convenience in code logic.

While I'm at it with the reference info, here's the enum from which the script commands that actually "do" something to the setup are drawn:
Code: [Select]
public enum TextScenarioChangeType
{
    None,
    SetNumberOfPlanets,
    SetMapStyle,
    SetCampaignType,
    SetMapSeed,
    SetShipDifficulty,
    AddOptionalShipCategory,
    RemoveOptionalShipCategory,
    AddAllOptionalShipCategories,
    RemoveAllOptionalShipCategories,
    SetCombatStyle,
    SetUnitCapScale,
    SetFogOfWarType,
    SetMinorFactionIntensity,
    RemoveAllMinorFactions,
    AddAIModifier,
    RemoveAIModifier,
    AddAllAIModifiers,
    RemoveAllAIModifiers,
    SetAutoAIPMagnitude,
    SetAutoAIPInterval,
    SetFirstPlayerAIPlotIntensity,
    RemoveAllFirstPlayerAIPlots,
    SetSecondPlayerAIPlotIntensity,
    RemoveAllSecondPlayerAIPlots,
    SetFirstAIType,
    SetSecondAIType,
    SetShowUnexploredPlanets,
    SetFirstAIDifficulty,
    SetSecondAIDifficulty,
    SetFirstAIHandicap,
    SetSecondAIHandicap,
    SetAccessibilityOf_FirstAIType,
    SetAccessibilityOf_SecondAIType,
    SetAccessibilityOf_FirstAIDifficulty,
    SetAccessibilityOf_SecondAIDifficulty,
    SetAccessibilityOf_FirstAIHandicap,
    SetAccessibilityOf_SecondAIHandicap,
    SetAccessibilityOf_MinorFactions,
    SetAccessibilityOf_AIModifiers,
    SetAccessibilityOf_AutoAIP,
    SetAccessibilityOf_FirstPlayerAIPlots,
    SetAccessibilityOf_SecondPlayerAIPlots,
    Length
}

Quote
And how do I specify which Minor Factions, AI Modifiers and AI Plots I want? I don't want them to be random.

Example:
SetMinorFactionIntensity("HumanMarauders",4);
(make sure you use 1 as the second parameter for a faction that doesn't take an intensity; I think it will just default to 1 even if you do give it something else, but... never assume ;) )

Reference:
Code: [Select]
public enum AIMinorFaction
{
    HumanMarauders,
    HumanResistanceFighters,
    HumanColonyRebellions,
    ZenithTraders,
    ZenithMiners,
    ZenithDysonSphere,
    ZenithDevourer,
    NeinzulRocketryCorps,
    NeinzulPreservationWardens,
    NeinzulRoamingEnclaves,
    FallenSpire,
    SpireCivilianLeaders,
    BrokenGolemsEasy,
    BrokenGolemsModerate,
    BrokenGolemsHard,
    SpirecraftEasy,
    SpirecraftModerate,
    SpirecraftHard,
    BotnetGolemEasy,
    BotnetGolemModerate,
    BotnetGolemHard,
    Length
}
(the three botnet ones at the end  are in my working copy, not in the public version, but they'll be there soon)

Example:
AddAIModifier("Schizophrenic");

Reference:
Code: [Select]
public enum AIModifier
{
    None,
    Schizophrenic,
    DoubleWaves,
    HalfWaves,
    NuclearCommandStations,
    NoWaves,
    RevealRandomAITypes,
    NoWaveWarnings,
    CrossPlanetWaves,
    Length
}

Examples:
SetFirstAIPlayerAIPlotIntensity("Avenger",1);
SetSecondAIPlayerAIPlotIntensity("AstroTrains",1);

Reference:
Code: [Select]
public enum AIPlot
{
    Avenger,
    Defender,
    WrathOfNature,
    EXP2_Subroutines,
    EXP2_AdvancedSubroutines,
    AstroTrains,
    EXP3_Beachheads,
    Length
}
(Defender and WrathOfNature were never used, "Subroutines" means "Hybrids")

Quote
When specifying the AI types can I make it so it selects pairs of AIs.. like ::)..
AI 1/2
Raid Engine/One Way Doormaster
Speed Racer/Tag Teamer
Spire Hammer/Support Corps

You could achieve that with:
Code: [Select]
SetIntVariableToRandom("RandomRoll",1,3);
IfLeftIntEqualToRightInt(RandomRoll,1)
{
SetFirstAIType("Raid_Engine");
SetSecondAIType("OneWayDoormaster");
}
IfLeftIntEqualToRightInt(RandomRoll,2)
{
SetFirstAIType("SpeedRacer");
SetSecondAIType("TagTeamer");
}
IfLeftIntEqualToRightInt(RandomRoll,3)
{
SetFirstAIType("SpireHammer");
SetSecondAIType("SupportCorps");
}

And if there were specific other things you wanted in each bundle (like turning on/off schizo waves, turning on/off Avenger, etc) they could go in the right block.

The list of AI type values is earlier in this thread, iirc, I can post them again if desired.

Quote
I'm trying to make a challenge setup script.
That's one of the use cases I had in mind :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline amethyst

  • Newbie Mark III
  • *
  • Posts: 36
Re: Setup Scripts
« Reply #14 on: July 26, 2012, 11:28:43 am »
Thanks for those lists, Keith. When you have the time, could you post a couple more enums, please? This is what might still be needed for a complete documentation so far:

- Campaign types (specifically: the string constants for the various defender mode durations)
- Unit cap scale types (mostly whether it's "Ultra_Low" or "UltraLow")
- Fog of War types
- The accepted parameters for the various SetAccessbility_* functions
- Data types available for DeclareVariable()

I ask mostly because the example scripts don't cover these and having a full reference could be handy. :) Thanks for your time!