Scripters cove

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

Ebi
Competent
Competent
Posts: 40
Joined: Fri Jun 27, 2008 9:45 pm

Post by Ebi »

I've finished my OXP "Orbits". Can I just upload it to the wiki?
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6876
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Post by Disembodied »

@ Ebi: if you don't have an account already you can PM Winston and ask him to set one up for you.
User avatar
Amen Brick
Deadly
Deadly
Posts: 187
Joined: Sat May 10, 2008 5:22 pm
Location: Bolton!

Post by Amen Brick »

Disembodied wrote:
@ Ebi: if you don't have an account already you can PM Winston and ask him to set one up for you.
Actually he sends you a link to do it yourself, I'll see if I can rustle it up.

Edit: Here she blows.

http://wiki.alioth.net/index.php?title= ... =Main_Page
Ebi
Competent
Competent
Posts: 40
Joined: Fri Jun 27, 2008 9:45 pm

Post by Ebi »

Cool, thanks! I've uploaded the OXP :D
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

...

Post by Lestradae »

Hi Ebi,
I've uploaded the OXP
I might be blind or something, but where is it? :(
Ebi
Competent
Competent
Posts: 40
Joined: Fri Jun 27, 2008 9:45 pm

Post by Ebi »

Hm, Lestradae, you can see in the logs that i've uploaded a zipped file. I thought, some administrator would take it out of the queue and place it on the main page. Am I wrong with that? That's my first encounter with Wiki as non-reader.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

There is no queue. You can refer to the uploaded file in wiki markup as [[Media:Foo.zip]] (or [[Image:Foo.zip]] to link to the information page for the file). You can go to the information page with an URL of the form http://wiki.alioth.net/index.php/Image:Foo . The first letter in the name must be uppercase, and any spaces in the name are replaced with underscores (_).
Ebi
Competent
Competent
Posts: 40
Joined: Fri Jun 27, 2008 9:45 pm

Post by Ebi »

Done, finally. Thanks Ahruman!
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Quick question, is it possible to control or set which ship a station launches if attacked?

I've looked over the various AI's, and can see the "RED_ALERT" = (launchDefenseShip); action, but I'm pondering a scenario where I'd want a particular station to launch a particular ship model.

Is it possible?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Yes, using defense_ship_role (default is interceptor or police depending on tech level and randomness). It’s also possible to use defense_ship to specify a ship by key instead of role, but roles are preferred for flexibility.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2862
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Yep you want to specify it the stations shipdata with:-

Code: Select all

<key>defense_ship_role</key>
<string>my_defense_ship</string> (or a standard game role like thargoid)
You can also set the maxium number it has in it's hangers with:-

Code: Select all

<key>max_defense_ships</key>
<integer>10</integer>
<key>max_police</key>
<integer>0</integer>
<key>max_scavengers</key>
<integer>0</integer>
For an Alien Carrier or station you might want to set it's savengers, traders, shuttles and police to zero to stop it launching human ships.
:wink: [/code]
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Thank you both...

Almost all the ship designs are done (one more to do), then ship roles etc to do, then the dreaded AI's to tackle. I hope it's worth it all in the end (and RL doesn't get in the way again too much).
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

How does one detect a killed ship in a list entities? At first I copied the code used by Kaks. He just tested for false, but that does not work, it is always true. When I dump the killed entity to the console, I get "[object Ship]"

At first I have an array of existing entities. During gameplay some get killed and to detect them I used folowing code:

Code: Select all

for (let i=0; i<salvageList.length;i++)
{
    if(this.salvageList[i] =="[object Ship]")
          player.commsMessage(expandDescription(" [salvage_drone_killed] "), 6);
}
It is working, but I just think this is the not right way to check for a killed ship. But after the ship is killed, all properties are gone and just replaced by the string "[object Ship]" as far I can see.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Another question, as I'm now playing with code again (the thing to do in a thunderstorm when the TV's been knocked out)...

Is there any way to control or stimulate missile launches (or in this case Thargon launches)? I'm working on a "ship" which will be a thargon controller, my thought being that it acts kinda like an ambush. Player flies in, it detects them and launches 5 or 10 thargons and it's a firefight until either the thargons, the controller or the player are dead.

I'm having to use the thargons as missiles like the normal thargoid ships as if I do it with spawn or escort they either don't get the correct target (and just wander off) in the spawn case, or they live on after the controller has been destroyed in the escort case (although I'm not sure why, as there's nothing with role "thargoid-mothership" around to keep them functional).

As I want them to keep their normal "go inactive and become cargo" when the controller is nuked then I can't use escort or defense ship roles, and I'd rather not have to write whole new variants on the ships and AIs to make them scan for targets on spawning.

Doing it as a normal missile works, except that the controller either doesn't generate them at all, or at best you have to shoot several shades of circuits out of it before it decides to missile (thargon) launch. So is there any easy way to change the ship's AI (currently just the standard thargoidAI.plist) to fire them off when it scans and finds a non-thargoid target in range?

I think the above makes some kinda sense, but as we've been having said storm for the last couple of hours it's rather distracting :twisted:
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2862
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

a fireMissile command in AI will do it. You need to set the conditions under which it launches. This ship carries remote controled Worm fighters which it launches for its aft-hatch. (done by setting its missile role to a custom one in shipdata). It will allways launch a Worm as a distraction when running and launches further ones (until its runs out of them) if attacked whilst running. In gameplay this causes it to fire one Worm, followed by another if attacked whilst running and then switch to another state.

Code: Select all

"FOUND_PLAYER_FLEE_PLAYER" = {
ENTER = (fireMissile, "commsMessage: [mark-fleeing]", "addFuel: 2", "setSpeedFactorTo: 2.0", "setDesiredRangeTo: 25600", performFlee);
"ENERGY_LOW" = (fireMissile);
"INCOMING_MISSILE" = (fireMissile, setTargetToPrimaryAggressor, fightOrFleeMissile, "setStateTo: REACT_TO_PLAYER_ATTACK"); 
ATTACKED = (fireMissile, setTargetToPrimaryAggressor, "setStateTo: REACT_TO_PLAYER_ATTACK"); 
"TARGET_LOST" = (performIdle, "addFuel: -2", "setStateTo: DECIDE_COURSE"); 
"TARGET_DESTROYED" = (performIdle, "addFuel: -2", "setStateTo: DECIDE_COURSE"); 
EXIT = ();  
"REACHED_SAFETY" = (performIdle, "addFuel: -2", "setStateTo: DECIDE_COURSE"); 
UPDATE = ();     }; 
To get th drones to shut down on the death of the mother you'd need to give them a custom AI, but tweaking the normal thargonAI would do it. Copy the AI to your AI folder and rename it. Then assine this AI to your drones. The normal thargonAI scans for Thargoids every so often and if it doesn't find them shuts down. Just change your version to scan for the role you've given their mother.

An AI to get the mother launching would be faily simple. Just:-

Code: Select all

{

"GLOBAL" = {
 "ATTACKED" = (setTargetToFoundTarget, "setStateTo: SCRAMBLE");
 "INCOMING_MISSILE" = (setTargetToFoundTarget, fireECM, "setStateTo: SCRAMBLE");
 ENTER = (); 
 EXIT = ();  
 "TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: SCRAMBLE");
 "NOTHING_FOUND" = ();  
 UPDATE = ("pauseAI: 1.0", "scanForNearestShipWithRole: player");     };

"SCRAMBLE" = {
 ENTER = (fireMissile); 
 EXIT = ();  
 "TARGET_LOST" = ("setStateTo: SCRAMBLE""); 
 UPDATE = ("pauseAI: 2.0", fireMissile);     };

}

That'd cause mum to spew out a drone every 2 seconds (until she runs out or the target is lost) whenever she is attacked or spots the player.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
Post Reply