Scripters cove
Moderators: winston, another_commander
- CaptSolo
- ---- E L I T E ----
- Posts: 909
- Joined: Wed Feb 23, 2011 10:08 pm
- Location: Preying Manta
- Contact:
Re: Scripters cove
I'm a total noob with scripting, but I would like to know what event or condition that checks to see what kind of station the player has docked with? To be more specific, what event handler is passed when the player has docked with a rock hermit?
Re: Scripters cove
The two pages you want as reference are Javascript World Script Events and Javascript Ship Script Events.
The former are basically events that happen to the player (or the player ship), in world scripts which run in the background for the player. The latter are scripts associated with (usually NPC) ships and stations.
So specifically for your question, you want the events
WillDock occurs just prior to docking (at the beginning of the rings effect) and Docked occurs after docking (after the rings). See the links above for more details.
The former are basically events that happen to the player (or the player ship), in world scripts which run in the background for the player. The latter are scripts associated with (usually NPC) ships and stations.
So specifically for your question, you want the events
this.shipWillDockWithStation(station)
and this.shipDockedWithStation(station)
. In both cases station
is the identify of the station you docked with. So you could use the event to trigger a check using station.hasRole
to see if that matches the role of a rock hermit in this case (via an if statement check) and then if true act on that accordingly.WillDock occurs just prior to docking (at the beginning of the rings effect) and Docked occurs after docking (after the rings). See the links above for more details.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- CaptSolo
- ---- E L I T E ----
- Posts: 909
- Joined: Wed Feb 23, 2011 10:08 pm
- Location: Preying Manta
- Contact:
Re: Scripters cove
Thanks, Thargoid. My bare bones main script for handling this task works.
- 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
I've got an alternative solution. I found out that I can display a mission screen after the player died, triggered by theAhruman wrote: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?
shipDied
event, which is totally sufficient for my purpose. The only downside seems to be that no model can be displayed at this point (probably because the player isn't docked).- Cody
- Sharp Shooter Spam Assassin
- Posts: 16081
- Joined: Sat Jul 04, 2009 9:31 pm
- Location: The Lizard's Claw
- Contact:
Re: Scripters cove
<looks up, intrigued>Commander McLane wrote:I found out that I can display a mission screen after the player died, triggered by theshipDied
event
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
And any survivors, their debts I will certainly pay. There's always a way!
- CommonSenseOTB
- ---- E L I T E ----
- Posts: 1397
- Joined: Wed May 04, 2011 10:42 am
- Location: Saskatchewan, Canada
Re: Scripters cove
That's very cool, I can think of many uses for that.Commander McLane wrote:I found out that I can display a mission screen after the player died, triggered by theshipDied
event
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.
CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Scripters cove
But, who is going to read that screen. The player is dead after all.....Commander McLane wrote:I found out that I can display a mission screen after the player died, ....
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Rese249er
- ---- E L I T E ----
- Posts: 647
- Joined: Thu Jun 07, 2012 2:19 pm
- Location: Well, I WAS in G3...
Re: Scripters cove
Quick question: how would one script a forced change to the player's ship to a point along a vector?
I'm attempting to create an OXP with equipment designed to keep the player following the currently locked target, intended as an assist for various escort contracts.
I'm attempting to create an OXP with equipment designed to keep the player following the currently locked target, intended as an assist for various escort contracts.
Got all turned around, lost my nav connection... Where am I now?
- 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
Rese249er wrote:Quick question: how would one script a forced change to the player's ship to a point along a vector?
player.ship.orientation
is your friend. But it's a quaternion, not a vector.Note, however, that the player can change the orientation of their ship any time, with just a fingertip.
- Rese249er
- ---- E L I T E ----
- Posts: 647
- Joined: Thu Jun 07, 2012 2:19 pm
- Location: Well, I WAS in G3...
Re: Scripters cove
Distance is a greater concern for my purposes.
If I wanted just orientation, I'd use Target Tracker and be done with it.
I'm actually wanting to keep the script from doing anything with player.ship.orientation. My intention is for the player to be able to yaw, pitch and roll while keeping a set distance from the target. The name of the OXP will be Grapple Beam.
If I wanted just orientation, I'd use Target Tracker and be done with it.
I'm actually wanting to keep the script from doing anything with player.ship.orientation. My intention is for the player to be able to yaw, pitch and roll while keeping a set distance from the target. The name of the OXP will be Grapple Beam.
Got all turned around, lost my nav connection... Where am I now?
- 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
Seems I misread the question.
If you want to position the player ship, then it's
If you want to position the player ship, then it's
player.ship.position
(reading the documentation helps, by the way).- Rese249er
- ---- E L I T E ----
- Posts: 647
- Joined: Thu Jun 07, 2012 2:19 pm
- Location: Well, I WAS in G3...
Re: Scripters cove
... I see... Now to figure out how to translate that into an OXP equipment...
Got all turned around, lost my nav connection... Where am I now?
- Wildeblood
- ---- E L I T E ----
- Posts: 2454
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: Scripters cove
The easiest way would be to grab Okti's tractor beam equipment (not Thargoid's tractor beam which works differently), which keeps the target at a position fixed relative to the player, and reverse the polarity of the plasma conduits.
- Rese249er
- ---- E L I T E ----
- Posts: 647
- Joined: Thu Jun 07, 2012 2:19 pm
- Location: Well, I WAS in G3...
Re: Scripters cove
Link please? Seems just about all the code I use is ripped off his work.Wildeblood wrote:...grab Okti's tractor beam equipment...
Got all turned around, lost my nav connection... Where am I now?
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Scripters cove
Okti's tractor beam is awarded during the Coyote's Run mission.
Commander Smivs, the friendliest Gourd this side of Riedquat.