wiki typo or really the case?

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

Moderators: winston, another_commander

Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Cloaking is wasted on the npc...

Post by Switeck »

"EQ_SHIELD_ENHANCER" is not useful enough for what I desire.

The npc ship cannot even be forced to cloak unless it is near max energy. Below ~75%, and it decloaks and stays decloaked.
Giving them a lot higher energy (max) only buys them a few extra seconds unless their total energy regen rate is over 10 energy/second...and even that isn't enough if it's firing away with laser/s and/or plasma turrets.

So unless a npc ship is scripted to only use cloaking in short bursts, there's almost no point in it being able to cloak. A script that can get it to cloak for 1 second every time a missile is fired at it would be pretty slick, but it would still have to fall back to ECM if it lacks enough energy to cloak or inject away.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Cloaking is wasted on the npc...

Post by Capt. Murphy »

Switeck wrote:
"EQ_SHIELD_ENHANCER" is not useful enough for what I desire.

The npc ship cannot even be forced to cloak unless it is near max energy. Below ~75%, and it decloaks and stays decloaked.
Giving them a lot higher energy (max) only buys them a few extra seconds unless their total energy regen rate is over 10 energy/second...and even that isn't enough if it's firing away with laser/s and/or plasma turrets.

So unless a npc ship is scripted to only use cloaking in short bursts, there's almost no point in it being able to cloak. A script that can get it to cloak for 1 second every time a missile is fired at it would be pretty slick, but it would still have to fall back to ECM if it lacks enough energy to cloak or inject away.
OK, have to ask - what exactly is it you desire or want to happen? Is is a specific scenario for a specific ship, or is it the general cloaking behaviour you want to change? If the former, don't forget that although you can't directly alter maxEnergy or recharge rate via script, you can alter energy on the fly, so in effect you can script an alternative cloak discharge rate using either timers or frameCallBacks from a shipScript. If the latter it is also doable via worldScript and can explicitly not affect the player if that is the intention.

Cloaking parameters are the same for the NPC and the player AFAIK. It looks to me that the parameters are 1) need 75% of max energy to activate the cloak (whether via cloak_automatic or script. 2) But it stays active until energy drops below 128 absolute value (subject to the cloak_passive shipdata key for NPCs). 3) Energy use rate 12.8 / second.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: wiki typo or really the case?

Post by Switeck »

Having a npc ship that can stay cloaked indefinitely (at least as long as nothing is shooting at it and it's not shooting as well) but without giving it an atrociously high energy regeneration rate if it's not cloaked might be useful. I don't know what frameCallBacks are. What/where do I need to read to find out about them?

I neither confirm nor deny using cloaked npc ships in my unreleased OXPs. :P
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: wiki typo or really the case?

Post by Capt. Murphy »

frameCallBacks basically allow you to set up a function that is run once every single frame. I think initially it was intended for animations, but they have a lot of potential uses beyond fancy graphics.

The wiki entry is here http://wiki.alioth.net/index.php/Oolite ... meCallback.

Having thought about about what you want to do a timer from the NPC's shipScript is probably the simplest way to go. When the NPC is cloaked it runs once per second to add to the NPC's energy an amount somewhere between 0 and 12.8, which in effect reduces the rate that energy is used by the cloak by that amount. Just remember to be careful with the condition checks/triggers so it only runs when the NPC is cloaked.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: wiki typo or really the case?

Post by Thargoid »

If you want an example of this (not quite for cloaking, but same overall effect) look at the Navy Station in TCAT. Normally it has a timer increasing its energy, except when the big bugShip attacks during the middle segment. During that sequence the timer is stopped, so that the regen rate is low enough that the station could actually get nuked.

But at other times, the combined energy recharge is enough to make the station tough enough to seem like a normal station. Your ship would do something very similar, using being cloaked or not as the trigger to start/stop the timer.
Post Reply