Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: [1] 2

Author Topic: Moar missions  (Read 17544 times)

icepick37

  • Admiral
  • *****
  • Posts: 1788
  • Go.
    • View Profile
Moar missions
« on: January 29, 2012, 08:44:54 PM »

    This is me trying to do something significant with a game I love. But I'll be honest, I'm doing it mostly because the stuff I put in here is fun to me personally. So let me here it if you like any of it.  :D

    Here's what I have so far.
latest google share  (you have to go to file->download)

Stuff in here:
  • Bunch of random 1v1 missions to practice piloting the various classes against something in the same class
  • Some campaign practice/fun missions
  • A sweet trade defense mission featuring the most awesome mule
[/list]
« Last Edit: January 22, 2014, 08:33:12 PM by icepick37 »
Logged
“I [may] not agree with a word that you say, but I will defend to the death your right to say it”
- Voltaire

kwekly

  • Lieutenant
  • **
  • Posts: 54
    • View Profile
Re: Moar missions
« Reply #1 on: January 30, 2012, 12:28:48 AM »

it's very mysterious indeed:

I replaced all the code in straight1vs1 with one of the working missions, crash on load

Replaced the code in cap1vs1 with that of straight1vs1, disable straight1vs1 ,loads just fine

Rename straight1vs1 "balls" so it appears above cap1vs1, same set() error but with cap1vs1

tried changing the name of the ships array, but no luck.

Logged

Magokitsune

  • Ensign
  • *
  • Posts: 34
    • View Profile
Re: Moar missions
« Reply #2 on: January 30, 2012, 04:15:59 AM »

Have you tried deleting the file and and just creating a new file? It might be that the file that it's writen in is corrupted in someway and starting from scratch might make it work.

I don't know give it a go maybe, see if it works
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Moar missions
« Reply #3 on: January 30, 2012, 08:47:21 AM »

Ahh, this is a bug in the Janino compiler I'm using. It can't handle a "break" or "continue" inside a loop, and fails with that error (a "return" works fine). Will have to fix it at some point, but for now, you'd have to code around using those. Check the above link for a list of what it officially supports/doesn't support, btw.
« Last Edit: January 30, 2012, 08:56:46 AM by Alex »
Logged

icepick37

  • Admiral
  • *****
  • Posts: 1788
  • Go.
    • View Profile
Re: Moar missions
« Reply #4 on: January 30, 2012, 09:34:35 AM »

Changed the order of the missions in the csv file and that worked. (shrug)

Will modify the OP with a version that is working.

Ahh, this is a bug in the Janino compiler I'm using. It can't handle a "break" or "continue" inside a loop, and fails with that error (a "return" works fine). Will have to fix it at some point, but for now, you'd have to code around using those. Check the above link for a list of what it officially supports/doesn't support, btw.

I don't think I was doing that anywhere, though.  X[

Like I said, just changing the order of the missions in the csv list worked. Whatever.
« Last Edit: January 30, 2012, 09:36:09 AM by icepick37 »
Logged
“I [may] not agree with a word that you say, but I will defend to the death your right to say it”
- Voltaire

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Moar missions
« Reply #5 on: January 30, 2012, 09:39:21 AM »

Changed the order of the missions in the csv file and that worked. (shrug)

That probably means that the one causing the error is now last (the error comes up on the *next* mission to compile). Mind posting the MissionDefinition.java for that one?
Logged

icepick37

  • Admiral
  • *****
  • Posts: 1788
  • Go.
    • View Profile
Re: Moar missions
« Reply #6 on: January 30, 2012, 10:06:36 AM »

Ooooooo. Yeah, here it is. (whole mod is in the OP, also)

Code
package data.missions.class1v1;

import com.fs.starfarer.api.combat.BattleObjectiveAPI;
import com.fs.starfarer.api.fleet.FleetGoal;
import com.fs.starfarer.api.fleet.FleetMemberType;
import com.fs.starfarer.api.mission.FleetSide;
import com.fs.starfarer.api.mission.MissionDefinitionAPI;
import com.fs.starfarer.api.mission.MissionDefinitionPlugin;

public class MissionDefinition implements MissionDefinitionPlugin {

    private String[] capitalShips = { "onslaught_Standard",
                                      "onslaught_Outdated",
                                      "onslaught_Elite",
                                      "conquest_Elite",
                                      "astral_Elite",
                                    };

    private String[] cruisers = { "apogee_Balanced",
                             "aurora_Balanced",
                             "dominator_Assault",
                             "dominator_Support",
                             "dominator_Outdated",
                             "eagle_Assault",
                             "eagle_Balanced",
                             "falcon_CS",
                             "falcon_Attack",
                             "venture_Balanced",
                           };

    private String[] destroyers = { "buffalo_FS",
                           "condor_Strike",
                           "condor_FS",
                           "enforcer_Assault",
                           "enforcer_CS",
                           "enforcer_Balanced",
                           "gemini_Standard",
                           "hammerhead_Balanced",
                           "hammerhead_Elite",
                           "medusa_Attack",
                           "medusa_CS",
                           "medusa_PD",
                           "sunder_CS",
                         };

    private String[] frigates = {
                                    "brawler_Assault",
                           "hound_Assault",
                           "hyperion_Strike",
                           "lasher_Assault",
                           "lasher_PD",
                           "lasher_Strike",
                           "lasher_CS",
                           "omen_PD",
                           "tempest_Attack",
                           "vigilance_FS",
                           "vigilance_Strike",
                           "wolf_Assault",
                           "wolf_Strike",
                           "wolf_PD",
                           "wolf_CS",
                                };
   
    private String getRandomShip(String[] ship_type) {
        int index = (int)(Math.random() * ship_type.length);
        return ship_type[index];
    }

public void defineMission(MissionDefinitionAPI api) {

// Set up the fleets
api.initFleet(FleetSide.PLAYER, "ISS", FleetGoal.DEFEND, false);
api.initFleet(FleetSide.ENEMY, "ISS", FleetGoal.DEFEND, true);

// Set a witty blurb for each fleet
api.setFleetTagline(FleetSide.PLAYER, "Suck it, Blue!");
api.setFleetTagline(FleetSide.ENEMY, "No you suck it, Blue?");

// These show up as items in the bulleted list under
// "Tactical Objectives" on the mission detail screen
api.addBriefingItem("Kill the other Dude");
api.addBriefingItem("You can pretend you are testing balance");
api.addBriefingItem("But really you should be able to kill the other Dude since you are a Smarty");

// Pick a ship size
int size = (int)(Math.random() * 4);
String[] shipsAvailable = frigates;
switch(size) {
   case 0:
       shipsAvailable = capitalShips;
       break;
   case 1:
       shipsAvailable = cruisers;
       break;
   case 2:
       shipsAvailable = destroyers;
       break;
   case 3:
       shipsAvailable = frigates;
       break;
}

// Pick a random ship for each side
api.addToFleet(FleetSide.PLAYER, getRandomShip(shipsAvailable), FleetMemberType.SHIP, "Red", true);
api.addToFleet(FleetSide.ENEMY, getRandomShip(shipsAvailable), FleetMemberType.SHIP, false);


// Set up the map.
float width = 20000f;
float height = 12000f;
api.initMap((float)-width/2f, (float)width/2f, (float)-height/2f, (float)height/2f);

float minX = -width/2;
float minY = -height/2;

// All the addXXX methods take a pair of coordinates followed by data for
// whatever object is being added.

// Add two big nebula clouds
api.addNebula(minX + width * 0.66f, minY + height * 0.5f, 2000);
api.addNebula(minX + width * 0.25f, minY + height * 0.6f, 1000);
api.addNebula(minX + width * 0.25f, minY + height * 0.4f, 1000);

// And a few random ones to spice up the playing field.
// A similar approach can be used to randomize everything
// else, including fleet composition.
for (int i = 0; i < 5; i++) {
float x = (float) Math.random() * width - width/2;
float y = (float) Math.random() * height - height/2;
float radius = 100f + (float) Math.random() * 400f;
api.addNebula(x, y, radius);
}

// Add objectives.
api.addObjective(minX + width * 0.5f, minY + height * 0.5f,
"sensor_array", BattleObjectiveAPI.Importance.NORMAL);


api.addAsteroidField(-(minY + height), minY + height, -45, 2000f,
20f, 70f, 100);

api.addPlanet(minX + width * 0.8f, minY + height * 0.8f, 300f, "jungle", 300f);
}

}







straight1v1 was previously last. If that's relevant at all.
Logged
“I [may] not agree with a word that you say, but I will defend to the death your right to say it”
- Voltaire

icepick37

  • Admiral
  • *****
  • Posts: 1788
  • Go.
    • View Profile
Re: Moar missions
« Reply #7 on: January 31, 2012, 09:21:43 AM »

So class1v1 is the problem, and it's the switch statement. It doesn't like breaks in switches?

Anywho. That's an easy fix. Just use if/else's instead.
« Last Edit: January 31, 2012, 09:42:32 AM by icepick37 »
Logged
“I [may] not agree with a word that you say, but I will defend to the death your right to say it”
- Voltaire

icepick37

  • Admiral
  • *****
  • Posts: 1788
  • Go.
    • View Profile
Re: Moar missions
« Reply #8 on: February 24, 2012, 09:05:50 AM »

Added two new missions. One to practice your skills as a single frigate vs some fairly typical small fleets. The other is an effort to pit two fairly equal (less random than big battles, which is why I even bothered, haha) battle between two factional fleets.

Also here's some sprites I intend to use eventually.  :D

[attachment deleted by admin]
« Last Edit: February 26, 2012, 03:57:50 PM by icepick37 »
Logged
“I [may] not agree with a word that you say, but I will defend to the death your right to say it”
- Voltaire

icepick37

  • Admiral
  • *****
  • Posts: 1788
  • Go.
    • View Profile
Re: Moar missions
« Reply #9 on: February 25, 2012, 08:30:04 PM »

Smallish update:
*Got my missile frigate in. Balance is probably crap right now, though.
*Modded in some custom variants just for kicks. They are in the random 1v1 battles now.  :D
*Modded in a tiny faction to be added upon bit by bit. It's called the protectorate, and they are a protectorate of the hegemony. So they are very similar, but with a personality that is more loose.
Logged
“I [may] not agree with a word that you say, but I will defend to the death your right to say it”
- Voltaire

Psiyon

  • Admiral
  • *****
  • Posts: 772
  • Trippy
    • View Profile
Re: Moar missions
« Reply #10 on: February 25, 2012, 08:39:18 PM »

Cool missions. I like the new cruiser sprite, too.
Logged

icepick37

  • Admiral
  • *****
  • Posts: 1788
  • Go.
    • View Profile
Re: Moar missions
« Reply #11 on: February 25, 2012, 08:41:39 PM »

Thanks! I think I will try and get that in next, then focus on getting some actual pixel art done, haha.
Logged
“I [may] not agree with a word that you say, but I will defend to the death your right to say it”
- Voltaire

icepick37

  • Admiral
  • *****
  • Posts: 1788
  • Go.
    • View Profile
Re: Moar missions
« Reply #12 on: February 25, 2012, 10:18:17 PM »

Sorry to keep bumping, but I got the cruiser carrier in and thought it at least slightly newsworthy.  :)
Logged
“I [may] not agree with a word that you say, but I will defend to the death your right to say it”
- Voltaire

Alexander86

  • Lieutenant
  • **
  • Posts: 51
    • View Profile
Re: Moar missions
« Reply #13 on: February 25, 2012, 10:22:52 PM »

I like that cruiser. Kinda phallic though...lol yea cant unsee now I'm sure.
Logged

icepick37

  • Admiral
  • *****
  • Posts: 1788
  • Go.
    • View Profile
Re: Moar missions
« Reply #14 on: February 25, 2012, 10:24:30 PM »

DOH!

Should have thought of that sooner, haha. Ah well. It's just temp until Alex gives us a more worthy carrier.

Made the carrier less phallic, though it's not as good anymore.  :/
« Last Edit: February 26, 2012, 03:59:08 PM by icepick37 »
Logged
“I [may] not agree with a word that you say, but I will defend to the death your right to say it”
- Voltaire
Pages: [1] 2