Scripters cove
Moderators: winston, another_commander
- Disembodied
- Jedi Spam Assassin
- Posts: 6885
- Joined: Thu Jul 12, 2007 10:54 pm
- Location: Carter's Snort
@ Ebi: if you don't have an account already you can PM Winston and ask him to set one up for you.
- Amen Brick
- Deadly
- Posts: 187
- Joined: Sat May 10, 2008 5:22 pm
- Location: Bolton!
Actually he sends you a link to do it yourself, I'll see if I can rustle it up.Disembodied wrote:@ Ebi: if you don't have an account already you can PM Winston and ask him to set one up for you.
Edit: Here she blows.
http://wiki.alioth.net/index.php?title= ... =Main_Page
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
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 (_).
E-mail: [email protected]
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?
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?
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
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.
E-mail: [email protected]
- LittleBear
- ---- E L I T E ----
- Posts: 2882
- Joined: Tue Apr 04, 2006 7:02 pm
- Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.
Yep you want to specify it the stations shipdata with:-
You can also set the maxium number it has in it's hangers with:-
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.
[/code]
Code: Select all
<key>defense_ship_role</key>
<string>my_defense_ship</string> (or a standard game role like thargoid)
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>
[/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.
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).
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).
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
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:
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.
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);
}
UPS-Courier & DeepSpacePirates & others at the box and some older versions
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
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
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- LittleBear
- ---- E L I T E ----
- Posts: 2882
- Joined: Tue Apr 04, 2006 7:02 pm
- Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.
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.
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:-
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.
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 = (); };
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); };
}
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.