Re: Scripters cove
Posted: Fri Feb 08, 2013 7:30 am
I believe it does still work, but will confirm later on and give it a severe thrashing if it doesn't...
For information and discussion about Oolite.
https://bb.oolite.space/
No, that's just simple ball turrets.Rorschachhamster wrote:The black monk gunships have moveable cannons, that point into the direction of a target. Could help, too.
Oh. OK.Commander McLane wrote:No, that's just simple ball turrets.Rorschachhamster wrote:The black monk gunships have moveable cannons, that point into the direction of a target. Could help, too.
This can attract surprising amounts of unwanted attention, as I discovered that even unarmed stations that target other ships can be "viewed" and treated as a hostile.Rorschachhamster wrote:Oh. OK.Commander McLane wrote:No, that's just simple ball turrets.Rorschachhamster wrote:The black monk gunships have moveable cannons, that point into the direction of a target. Could help, too.
I just thought: "Well, could you make ball turrets that don't shoot?". Would be nifty for navigational arrays, that follow the target...
Fixed in r5634. Porcupine captains everywhere now can engage in combat without a few thousand in repair bills for their engine casings...cim wrote:But I'm inclined to think this is a bug: those rare ships that have both frangible subents and shields should obviously have the shields cover the subents too.
Great! But how can I get that newest version? I've tried "oolite-update", but it didn't seem to work (subentities are still hit before the shields)...cim wrote:Fixed in r5634. Porcupine captains everywhere now can engage in combat without a few thousand in repair bills for their engine casings...cim wrote:But I'm inclined to think this is a bug: those rare ships that have both frangible subents and shields should obviously have the shields cover the subents too.
Code: Select all
// startup - called when OXP is loaded (on game start, load game,...)
this.startUp = function () {
// setup "subentity died" functions
$log("startup:", "running startUp...");
var x=0;
for (x=0; x < player.ship.subEntities.length; x++) {
$log("SubentityModified:", "setting up subEnt: " + player.ship.subEntities[x]);
$log("SubentityModified:", "player.ship.subEntities[x].shipBeingAttacked b4: " + player.ship.subEntities[x].shipBeingAttacked); // returns undef (as expected)
player.ship.subEntities[x].shipBeingAttacked = function(whom) {
message = this + " being attacked!";
log("SmellySubEnt", message);
player.consoleMessage(message, 1);
}
$log("SubentityModified:", "player.ship.subEntities[x].shipBeingAttacked: " + player.ship.subEntities[x].shipBeingAttacked); // returns the above function => seems it worked
player.ship.subEntities[x].shipDied = function(whom, why) {
message = this + " died!!";
player.commsMessage(message, 3);
log("SmellySubEnt", message);
player.consoleMessage(message, 1);
}
}
}
Try:GGShinobi wrote:I'm getting no messages / log-entries when a subentity is being attacked or destroyed...
So here my question How can I run code when a subentity has been destroyed?
Code: Select all
player.ship.subEntities[x].script.shipDied = function(whom, why) {
message = this + " died!!";
player.commsMessage(message, 3);
log("SmellySubEnt", message);
player.consoleMessage(message, 1);
}
ship.script
, not the ship
itself. You can either wait until we release 1.77.1 and thenGGShinobi wrote:Great! But how can I get that newest version? I've tried "oolite-update", but it didn't seem to work (subentities are still hit before the shields)...
oolite-update
will work, or you can download a nightly build (links in a sticky thread at the top of the forum for your OS), or you can build Oolite from SVN yourself.Oooh man! *slaps his face* Eric Walch, thanks a million times! This works like charm!!Eric Walch wrote:Try:GGShinobi wrote:So here my question How can I run code when a subentity has been destroyed?You must add the code to theCode: Select all
player.ship.subEntities[x].script.shipDied = function(whom, why) { var message = this + " died!!"; player.commsMessage(message, 3); log("SmellySubEnt", message); player.consoleMessage(message, 1); }
ship.script
, not theship
itself.
Yeah, I actually already found this out "the hard way" before I read your post, but thanks anyway!Eric Walch wrote:And youprobablymust not only use the code on startUp, but also on restoration of the subs.
cim, thank you very much for the info. It's good to know - but now that my "Ship Entity Repair System" is about to become reality, I'll stick with 1.77, because the buggy behaviour is actually good for testingcim wrote:You can either wait until we release 1.77.1 and thenGGShinobi wrote:Great! But how can I get that newest version? I've tried "oolite-update", but it didn't seem to work (subentities are still hit before the shields)...oolite-update
will work, or you can download a nightly build (links in a sticky thread at the top of the forum for your OS), or you can build Oolite from SVN yourself.
As we are currently in a "fixing bugs" part of the release cycle, you should be fairly safe using the nightly version. Once 1.78 is released we will move back to the "creating bugs" part of the release cycle and you should switch back to using official releases.
Excuse me, kind sir, in the fine ship, I've got two more questions!cim wrote:Surround would be easier, and a Visual Effect is probably the easiest way to do that. Again, frame callbacks to position and orient.GGShinobi wrote:
- it is possible to replace the ship/surround it with a comet tail when it activates the jump drive, so that it looks like a real comet?
1) Yes. All models are transparent from the inside, unless you've built them inside-out. So as long as the model's shape is purely convex and the internal camera positions are inside the model (and the external ones outside it) you'll be fine.GGShinobi wrote:
- Is it possible to create Visual Effects which are "transparent" from within (so I can see through the comet effect when looking out of the cockpit) but appear "solid" from the outside? If so, how?
- Can Visual Effects also be used as the model that is shown on the mission screen?