Author Topic: Making things happen only when the player's ship jumps  (Read 1197 times)

0 Members and 1 Guest are viewing this topic.

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Making things happen only when the player's ship jumps
Hi, a scripting newbie here. I've been trying to figure out a couple of things for quite long enough now without too much luck, so I'll try seeking some solutions here. I'll try to keep my questions as simple and straightforward as possible, so here's the first one:

I have this pleasantly simple hook here, which works very nicely, except of course it sets that variable whenever any ship jumps out. So my problem is, how exactly do I make that variable be set only when it's the player's ship that jumps out?

Code: [Select]
$On Warp Out: [

player_jumping_out = true

]

I've figured that I might be able to somehow check it using the hv.Player hook variable, but the exact details I have little idea about.

EDIT: Thanks to Wanderer, I now have this, which seems to do the job:

Code: [Select]
$On Warp Out: [

if hv.Self:isValid() and hv.Player:isValid() then
    if hv.Self == hv.Player then
        jumping_out = true
    end
end

]
« Last Edit: August 19, 2009, 04:05:15 am by zookeeper »