Scripters cove
Moderators: winston, another_commander
Re: Scripters cove
Replace vectorForward with either vectorRight or vectorUp. vectorForward is along the Z-axis (around which the station rotates anyway), so a rotation there won't help. But a rotation of Pi radians (aka 180 degrees) around either of the other two should do what you want.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Wildeblood
- ---- E L I T E ----
- Posts: 2454
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: Scripters cove
That worked a treat. Thank you, Thargoid.
Re: Scripters cove
Shouldn't a 180 degree rotation point the ship back into the docking bay?Thargoid wrote:Replace vectorForward with either vectorRight or vectorUp. vectorForward is along the Z-axis (around which the station rotates anyway), so a rotation there won't help. But a rotation of Pi radians (aka 180 degrees) around either of the other two should do what you want.
Re: Scripters cove
He was spinning the station about (before launch), not the launching ship.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Wildeblood
- ---- E L I T E ----
- Posts: 2454
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: Scripters cove
Thargoid wrote:He was spinning the station about (before launch), not the launching ship.
This is quite handy for getting screen-shots of the station with the planet in the background, as well as for when I'm just being impatient. The next step to making it a polished OXP is making sure it only appears in the F3 screen at main stations, not at OXP stations. Is there a condition I can put in the equipment definition, or do I have to mess around giving it a script-changed tech level, and if the latter, how do I do that?Priority Launch READ ME wrote:Place the Priority Launch OXP into your "AddOns" folder. At the main stations of planets with technical level 4 or higher, the station master will - for a small fee - re-align the space station to allow you an unimpeded launch in a direction away from the planet, directly into deep space. Station re-alignment takes 15 minutes of game time, but happens immediately for the player (similar to instant docking, which takes 20 minutes of game time).
Re: Scripters cove
You can use conditions in Equipment.plist to achieve that. Specifically
It's coded in legacy scripting there (more full details are on this page on what is available). As yet that is the only way to do it for such conditions (in equipment and also in shipdata.plist conditions) but that may well be updated soon.
Links are to Maik's backup wiki as the main one is still down.
"conditions" = ( "dockedAtMainStation_bool equal YES" );
will limit it to main station only (you can limit the tech level in the normal way by the equipment's tech level, or alternatively with "systemTechLevel_number morethan 3"
as an additional condition above). You can set multiple conditions in the array in the normal way, just comma-separate them.It's coded in legacy scripting there (more full details are on this page on what is available). As yet that is the only way to do it for such conditions (in equipment and also in shipdata.plist conditions) but that may well be updated soon.
Links are to Maik's backup wiki as the main one is still down.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Wildeblood
- ---- E L I T E ----
- Posts: 2454
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: Scripters cove
Thanks again, Thargoid. I've added Priority Launch to my cutesy tweaks list.
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Scripters cove
Quick question...using this code in a worldscript (to add a station of sorts), how do I align it so the dock is facing the sun?
Code: Select all
system.addShipsToRoute(this.role2, this.count1, 0.8, "ws");
Commander Smivs, the friendliest Gourd this side of Riedquat.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Scripters cove
Code: Select all
// next line spawns the entity and puts it in a local variable 'myShip'
var myShip = system.addShipsToRoute(this.role2, this.count1, 0.8, "ws")[0];
// next line sets up a vector myShip --> sun
var targetVector = system.sun.position.subtract(myShip.position).direction();
// next line aligns the heading to the targetVector by rotating
myShip.orientation = targetVector.rotationTo(new Vector3D(0,0,1));
Re: Scripters cove
I'm trying to switch the AI of all ships in the system that have a particular role but am not having much luck. Does anyone know where I'm going wrong? This only makes one ship change its AI but the rest are the same...
Code: Select all
//Switch AIs on VirgoTech Inc. ships to attack Player:
this._virgotechShipsArray = system.shipsWithRole("virgotech_defender");
var i = 0;
var count = this._virgotechShipsArray.length;
for (i=0; i<count; i++)
{
this._virgotechShipsArray[i].setAI("traitor_pirateAI.plist");
}
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Scripters cove
Your code should be fine, and it's working here.
One suggestion, though: if you want to change the ships' AI permanently,
One suggestion, though: if you want to change the ships' AI permanently,
switchAI()
is what you're looking for. setAI()
only adds the new AI on top of the current AI which is pushed to the AI stack. Thus the next exitAI
command in your new AI will take the ship back to its original AI. switchAI()
on the other hand erases the AI stack, making it impossible for the ship to fall back to its original AI.- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Scripters cove
Okay, here's a tricky one: is there a way to transfer information across a
What do I want to do? There are several ways for the Asteroids3D-minigame to end:
My question is: is it possible to show a mission screen in the last case as well? This means that the JS-engine somehow would have to know that the last player death did not occur during normal game play, but during an Asteroids3D-minigame. However, the
I don't see a solution to this (very special, I admit) problem, but perhaps one of you very clever people does?
startUp
event?What do I want to do? There are several ways for the Asteroids3D-minigame to end:
- The player can destroy all the objects = game successfully ended;
- The player can dock while there are still objects left = game abandoned;
- The player can jump out while there are still objects left = game abandoned;
- The player can be killed during the game = new start at the last save game.
My question is: is it possible to show a mission screen in the last case as well? This means that the JS-engine somehow would have to know that the last player death did not occur during normal game play, but during an Asteroids3D-minigame. However, the
startUp
event removes all traces of what has happened before, clearing all variables, removing all objects and creating the Ooniverse anew from scratch. That's what it has to do, of course. But is it possible to circumvent this in any way for this special case? One possible way is not viable: I do not want the player to save their game after starting the Asteroids3D-minigame, and I absolutely don't want to force a save upon them. So I cannot use a missionVariable
.I don't see a solution to this (very special, I admit) problem, but perhaps one of you very clever people does?
Re: Scripters cove
If I get this right the only thing you can check is the player.ship.status. It is not failsafe though as the status changes.Commander McLane wrote:Okay, here's a tricky one: is there a way to transfer information across astartUp
event?
Code: Select all
if(player.ship.status==='STATUS_DEAD') ...
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: Scripters cove
If so, it’s a bug.Commander McLane wrote:Okay, here's a tricky one: is there a way to transfer information across astartUp
event?
E-mail: [email protected]