Can I change the behavior just by hacking the scripts?

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
wades
Above Average
Above Average
Posts: 29
Joined: Wed Feb 03, 2010 11:04 pm

Can I change the behavior just by hacking the scripts?

Post by wades »

This is probably a question I could answer by dredging through the forums but I'm lazy and anyway, the best way to get an answer is to ask someone who knows, says me.

Anyway, I'm looking at the Lave Academy OXP and would like to nerf the difficulty of the gunnery course temporarily. I'm guessing that I can edit shipSpawned() in laveAcademy_targetDrone.js to something like

Code: Select all

this.destructTimer = new Timer(this, this.selfDestruct, 90);
to make all of the drones last 90 sec. before they self-destruct. Am I right?
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

You could do it that way, or alternatively if you look at the top of laveAcademy_targetBuoy.js, right at the top in the function this.examStart is the line:

missionVariables.laveAcademy_droneLifetime = 30;

Change the 30 to whatever lifetime you want to give the drone. Personally I found 30s to be plenty for the early ones, and just the right kind of challenge for the latter ones.

Oh, and remember what happened to Cadet Kirk after the Kobayashi Maru ;)
wades
Above Average
Above Average
Posts: 29
Joined: Wed Feb 03, 2010 11:04 pm

Post by wades »

Is there some kind of build step I have to do?

After editing the script, I just launch Oolite and my changes don't seem to be taking effect. I added a

Code: Select all

player.commsMessage("Using hacked drone lifetime", .5);
and I'm not seeing that. This is still in laveAcademy_targetDrone.js!shipSpawned() btw.
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

Hold shift key while starting to make sure it reloads OXP data.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

after editing files inside an oxp, then next time you start Oolite you have to hold down the Shift, press it straight after clicking on it's icon and keep it pressed down untill the spinning cobra comes up on the title screen. this gets Oolite to clear out its cache of oxp files and makes it reload them all in again

edit: i got ninja'd!
wades
Above Average
Above Average
Posts: 29
Joined: Wed Feb 03, 2010 11:04 pm

Post by wades »

OK, clearing the cache worked. Thanks.

I'm still finishing the test in about the same time (11 min or so) but I'm killing most of the drones now.
Post Reply