FL hook is needed here?
-
is it possible to make one type of the solar objects regain it’s full health faster than time in server.dll(60 seconds by default)?
For example, if station is destroyed it regains health, say in 60 seconds(or whatever is set in server.dll), and hazard buoys regain health in 30 seconds.
Is it possible with FLHook?
-
You may try to use on of the Dev’s Limit Breaking 101 Techniques.
Take a look to http://the-starport.net/index.php?option=com_smf&Itemid=26&topic=403.0
String:
– 60d in server.dll, 0x???, 0x85530 = respawn time for any solar object to regain full health once destroyed ~w0dk4 -
Yeah, but he wants to change that dynamically based on what kind of solar it is, which should be possible with FLHook.
Ahhh sorry, i think all possible with FLHook
-
>i think all possible with FLHook
yea, you just need to have M0tah around ;DTHis should be possible with HkBaseDestroyed timer and SetRelativeHealth.
Although i don’t know how those checks in the timer will do with performance…PS sorry if i name some functions wrong, i just cut many features off my hook and don’t remember correct names
-
Well, with normal FLHook the HkBaseDestroyed timer only goes through the bases, not all the solar objects, which is a problem if you’re implementing custom solar repair code. The way I solved this problem is by adding the solars selected by players to a binary tree in the IServerImpl callback SetTarget (look at my FLHook’s source for details). I then added a new timer, HkTimerSolarRepair, where the solars are repaired gradually. It shouldn’t be too difficult to modify the code to immediately repair the solars a certain time after death, if that’s what you want.
For changing the time based on what type of solar it is, you could probably use pub::SpaceObj::GetArchetypeID to figure out what type it is and then look up what value should be used for that type using your data structure of choice.
-
Thanks guys, hopefully i won’t need that thing, found out a bit easier way to solve this. I am trying to interrupt npcs going in circles in cruise for long time before they dock.
One more question: is it possible to replace piece of equipment that a player has with another piece of equipment?
For example, player kills npc, npc drops countermeasuredropper, player tractors it in and it is replaced by another cm dropper or minedropper(immediately or when the player lands)? Kinda cargo replacement.
This is needed for npc cm use