Scenario Editing Tips

A breakdown of the scenario stuff for you:

gui_id = 4 determines where it appears in the list of scenarios on the choose mission screen
backdrop = “bg2.jpg” background image for the map
icon = “bg2_icon.jpg” smaller one for the choose mission screen
name = “scenario2” must be unique
guiname = “The Lagoon Nebula” displayed to player
mapsizex = 2048 size in pixels at zero zoom
mapsizey = 2048
player_deployment = 10,10,710,2038 location of the rectangle in which the player can deploy his ships
ai_deployment = 1348,10,2038,2038 same for enemy
starfield = 1 are tiny stars shown on the map?
fleetcostlimit = 25000 max budget
pilotlimit = 60 max pilots
enemyrace = rebel enemy race
shader = “data/shaders/yellowboost.fx” the special graphical effect script applied to the whole battle screen (apart from UI)
description = “Shields at 50% effectiveness” shown to the player on choose mission screen
size = “small” shown to the player on choose mission screen
unlocked_after = “scenario1” restricts when this mission is playable. leave empty to be always available

[variables] any number of these, samples below:

I need a little help here Cliff!

I am editing scenario 1.

I’m trying to make a large alliance map. So far I cannot seem to move the AI opening position. I am using a map size of 4096 4096 and an initial AI deployment of (I have plugged in many variables so far) say 3096,3000,3038,3038. Easy and hard show up as right next to my setup while hard is ,well anyones guess. I threw in 150 max pilots just to spice things up.

What am I doing wrong?

Many thanks for a great game!

the deployment numbers are in this order:
Hope that helps :smiley:

hmmmm so that would be

[ ]
[ ]
[ ]
[ 2048,2048 ]
[ + ]
[ ]
[ ]
[ ]
[ ]

Ack, my design got trunciated but you get the picture

I think so, yes :smiley:

I think I get it now (maybe) There is a big difference between scenarios and deployments but that explains why my ships were not going where I wanted them to!

Just thought I’d add in some scenario-related stuff I’ve learned through trial and error that someone might find useful. This is current as of 1.10.

[size=150]More scenario stuff: scenarioNumber.txt[/size]

[size=120]type = TUTORIAL[/size] added under the [size=120][config][/size] section of a scenario file disables hard and expert difficulties for that scenario, but makes it not count toward unlocking races.

[size=120]name = SCENARIONAME[/size] entered in the scenario file points to the folder “data\deployments\SCENARIONAME” which should contain “aifleet_easy.txt”, “aifleet_medium.txt”, and “aifleet_hard.txt” for the difficulties to be included.

[size=150]deployments\aifleet_DIFFICULTY.txt (DIFFICULTY = {easy,medium,hard})[/size]

A deployment file contains a lot of fields that pretty much look like this:

[ship0] unique number representing the order in which the ship is deployed…the AI orders seem to target lower # ships sooner than higher-# ones of the same type, range being equal
shipid = 0 same idea as above, but this is used in ship orders
name = Purple squadron in-game tooltip displayed when hovering over that ship
design = _alliance hornet fighter ship design used by the unit. In this example, there MUST be a ship design file in “data\ships” or “\My Documents\My Games\GratuitousSpaceBattles\ships” (not subfolders!) or it won’t deploy in the scenario.
pos = 1728,960 X,Y coordinates of the center of the ship. This DOES NOT have to match the “player_deployment” and “ai_deployment” in the scenario file!
quantity = 16 number of ships; don’t change from 1 except for fighters
angle = 270 starting facing of the ship, 0 = up 90 = right 180 = down 270 = left
behaviour_0 = ATTACK_FIGHTERS,-1,0.86,300.00 example order, affects order they appear in on the orders screen
behaviour_1 = ATTACK_FRIGATES,-1,0.44,200.00 attack orders work by defining "ATTACK_type,?,priority,distance
behaviour_2 = ATTACK_CRUISERS,-1,0.19,228.57
behaviour_3 = ESCORT,8,100.00,0.00 escort orders work by defining “ESCORT,shipid of target,distance,?”
angle = 270 not sure what the 2nd angle entry is for…initially thought it was turret starting direction but they always point up

[size=150]ships\alliance hornet fighter.txt[/size]

Sample ship configuration. Again, the file must appear in “data\ships” or “\My Documents\My Games\GratuitousSpaceBattles\ships” (not subfolders!) for them to show up in a deployment.

name = _alliance hornet fighter name of the design used by the game engine. THIS MUST MATCH name in the deployment file or bad stuff happens!
guiname = Alliance Hornet Fighter name of the design as it appears in text fields, info, etc
hull = Alliance Hornet Fighter hull type used by the design, which MUST be present in “data\hulls” or you get a lovely crash. Subfolders work for this one.
cost = 93 cost seems to be calculated internally; changing this value doesn’t actually do anything

0 = fighter_pulse laser, placement of modules on the design, based on the numbering system in the hull file. These use the names from the module file.
1 = fighter_engine II,
2 = fighter power III,

[size=150]hulls\alliance\alliance hornet fighter.txt[/size]

Note that your hull can actually be anywhere in “\data\hulls” and the game will find it, but it never hurts to tidy up a bit.

classname = fighter hull type, cruiser frigate or fighter. Entering anything else defaults to cruiser. Sorry, no battleship, mothership, starbase…
name = Alliance Hornet Fighter Internal name used for the hull, which MUST match the ship file’s “design” above
guiname = Alliance Hornet Fighter Hull name that appears when you’re selecting a hull for a design
sprite = Alliance Hornet picture displayed on the design screen as a background, and for anything but fighters as the default graphic
damagetexture = Alliance Hornet texture displayed when the ship is damaged; for fighters it’s the entire right half of “Alliance Hornet”
hulktexture = texture displayed when the ship is destroyed
hulkUVstart = 0 used only by fighters: where on the big texture is the hulk
hulkUVend = 3 used only by fighters: where on the big texture is the hulk
width = 11 meters width of the ship in-game. DO NOT set too high or you will crash; I was stable up to 256 before the game got finicky
height = 11 meters length of the ship in-game. Can be set ridiculously high, I tried up to 4000!
powerproduced = 2.3 Power of base hull before generators
cost = 37 Cost of base hull before modules
racename = alliance Hull is available to this race (alliance, rebel, empire, federation)

0 = ARMOURBOOST,0.12 Bonus type and amount for this hull; here, it’s +12% to armor. Can be negative or positive. Valid variables are ARMOURBOOST, INTEGRITYBOOST, SHIELDBOOST, SPEEDBOOST, POWERBOOST, COSTBOOST

[runninglights]Where do the nifty blinking lights appear on the ship?
0 = 11,191,100,3,1 Light# = X,Y,Blink Speed in ms,Radius,Color
1 = 245,191,100,3,0 Default colors are (0,1,2,3) for (green,red,blue,white)

[contrails] Where does engine exhaust appear for fighters? Larger ships use [engineglows]
0 = 78,214,40,500,1.5,4 Exhaust# = X,Y,?,max length of trail,width,?
1 = 178,214,40,500,1.5,4

[targets] Where can the ship be shot? Based on a 256x256 grid. BE CAREFUL WITH “EMMITER” SPELLING or you’ll get a crash! Must match an effect in “data\particleconfigs”
0 = 76.00,91.00,0,0, target# = X,Y,no special effect on hit,no special damage texture on hit
1 = 148.00,41.50,1,1,115.00,13.00,181.00,70.00,SHIP_EMMITER_SMALL, target# = X,Y,boolean for effect on hit,boolean for damage texture on hit,x1,y1,x2,y2 of damage textures,effect on hit,(particle effects) though there aren’t any for this hull. They’d look like this: (damage_sprite_sparks-x-y),(damage_sprite_smoke-x-y)
2 = 126.50,131.00,1,1,99.00,103.00,154.00,159.00,SHIP_EMMITER_SMALL,

[slots] What can the ship equip. Coordinates are still a 256x256 grid
0 = 128.00,61.00,TURRET,(97.00-21.00),(159.00-21.00), Slot # in the ship file = X,Y,type,(x-y of hardpoint 1),(x-y of hardpoint 2),
1 = 128.00,163.00,STANDARD, You can use hardpoints for standard modules too, but obviously they don’t show up in-game as little turrets
2 = 128.00,128.00,STANDARD,

[explosions]Effects used when the ship is destroyed
0 = 0,128,128,EXP_STARTBREAKUP
3 = 0,128,128,EXP_BLASTGLARE

[size=150]DIFFERENCES between FIGHTERS and other hulls:[/size]

Something that isn’t a fighter classname uses [engineglows] rather than [contrails], for example:

0 = 87,218,32,50,ALLIANCE Glow# = X,Y,width,height,color (ALLIANCE = yellow, IMPERIAL = blue, blank = white)

Large ships don’t have HULKUVSTART and HULKUVEND. They use a dedicated texture file and [hulks] instead, and the coordinates are based on a 512x512 grid (!):

1 = 23,158,117,445,(emit-62-215-hulk_emmiter),(emit-51-245-hulk_smoke_emmiter), fragment# = X1,Y1,X2,Y2 of the fragment on the texture,(emit-x-y-sparks),(emit-x-y-smoke),


Heartfelt thanks to both cliffski and ghoti for the above clarifications! You mates have made it possible for me to begin tinkering at my desktop shipyard with some hope of success. Look for some interesting hull designs of mine coming to the forum in the future.