Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > Star Wolves

Star Wolves 3D space RPG with deep strategy and tactical elements

View Poll Results: What should I Prioritize on?
Basebuilding! 1 25.00%
Balancing! 0 0%
The Mod Manager! 0 0%
Asteroid ore-dropping! 0 0%
Intensive Bugfixing! 3 75.00%
Voters: 4. You may not vote on this poll

Reply
 
Thread Tools Display Modes
  #1  
Old 07-28-2016, 11:06 PM
nocalora29's Avatar
nocalora29 nocalora29 is offline
¯\_ ͯ‿ ͯ_/¯
 
Join Date: Dec 2011
Posts: 518
Default

Game Install order would be the following:

The Game (1.12) -> 0.6.1B(Resources) -> 0.6.1B(Main) -> 0.6.1.9P-Update.

oh and the stormcrow_mk3 is (IIRC) a left over from older versions from Nanaki's Fleet Mod, at a time it was included.
__________________
Discord: Nocalora#6847 | SW3.Expansion Thread | SWX.MouseMovementFix | SWX.TUVMark+Src (.tuv editing Tool) | SWX.SLOTMark+Src (.ini Slots editing Tool)

Last edited by nocalora29; 07-28-2016 at 11:14 PM.
Reply With Quote
  #2  
Old 07-29-2016, 02:41 AM
nocalora29's Avatar
nocalora29 nocalora29 is offline
¯\_ ͯ‿ ͯ_/¯
 
Join Date: Dec 2011
Posts: 518
Default SW3.Expansion - RCFF - Tutorial

Heres a bit of a Updated RCFF Table: -OLD- See the newest at the bottom of this post.

I really hope some of you creative minds will create your own Table by using this framework and post here or also at pastebin.

Also feel free to request any Events or Options to this script.

I may have rushed through the explanation and purpose of RCFF, so here:
RCFF - Random-Contacts Flights Framework is a script written by me to make all kinds of custom-made Random Contacts EzPz.

From Dependencies of other RCFF-Table Flights to just Radio call outs every X Minutes, you will be able to customize your flight in many several and different ways.

I have added 3 Main Fleet Configuration Options, firstly the "PreGen" one, it doesn't really have a name... lets just call it that, so PreGen gets to create your Custom Flight when the other 2 Config Options are both off, this is probably the easiest one to create and understand, since basically everything you have at variables are in this case:
"FMinStrength" - Minimal Strength of the flight (See Create_Flight_2.script)
"FMaxStrength" - Self explanatory.
"FCapital" - This is a Table of several Ship_Description names of your desired Flights Main Carcass which where one gets randomy chosen, this Carcass will get Escorted by either PreGen, "ManualEscort"'s or "FullManualEscorts".
"FEscortMin" - Only relevant if PreGen is selected, this value sets the minimal amount of Escort Flights to Spawn.
"FEscortMax" - Self explanatory.
"FFaction" - The Faction id of your Flight, "Vks" or "uft"=FTU or "pat", you get it.
"FTeam" - You might set it to the same as your id above.
"FTeamGroup" - usually you might just put your id in there and add "Group" to it.

"InitialWait" - Initial wait after this flight is allowed to Spawn.
"IntervalWait" - This value controls which every X Seconds the flight is able to spawn.



And here we get to the "Properties" or rather the MAIN Configuration of the Flights.

I will just not include "Prop_" in all my examples here, since im lazy.
"AllHostile" - Controls wether this flight is hostile to all Teams/Groups/Factions it encounters INCLUDING the player.

"SpawnRelationState" - The Spawning relation state of this Flight, "RELATION_WAR" or "RELATION_NEUTRAL", or "RELATION_FRIEND".

"HostileTable" - Here you can specify a Table of your desire which includes the Factions which you want to have this Flight be in War with.

"AllowMultiInstances" - This allows or disallows this Flight being able to Spawn multiple times in the same system.

"AllowDespawn" - This tells the game if this flight is to be Despawned in a couple of X Seconds, although it needs to be Enabled by replacing the FALSE with TRUE.

"PermVisible" - If set to TRUE, the player will permanently see where this flight is headed

"PermVisibleEscort" (I KNOW IT ISNT IN THE LIST, SORRY, BUT IT WILL BE IN THE FUTURE!). - The same as the original, but this one is solely for the Escorts, both of the PermVisible Properties can be set to True independently.

"AllowRadio" - If set to TRUE the game will each X Seconds drop a Message to the player (or more realistically to the whole system) with X Content in the Message.

"EnableChanceTrigger" - If Enabled, this Trigger has a certain amount of Chance (see second variable) to activate AFTER x Seconds (third variable), and then its triggering a Function which is the 4th Variable as a String.

"AllSystems" - This basically tells the rcff script if its to be spawned in all Systems in the game.

"SystemTable" - Awaits a Table with specified systems where this Flight is able to Spawn.

"PlayerInteraction" - This is just a condition for some Events.

"CallsSOS" - Triggers the SOS Function when this flight gets attacked by the Player.

"CapitalFlees" - If Enabled, the Capital will escape to the nearest portal when its escort has Died.

"EscortFlees" - The same as above only with the Escort.

"SpecificPortals" - If Enabled, the script will ONLY spawn the flight in the specified Systems at "SpecificPortalsTable"
"SpecificPortalsTable" - Requires "SpecificPortals" to be TRUE, has the Portal Names which are allowed.



And now we get to the "ManualEscort" which I have talked about earlier.

"ManualEscort" - If Enabled, will automatically disable "PreGen" or "FullManualEscort" Methods.

To use this Method, we firstly we need to understand what
Code:
{
      "1",
      "11",	
      "16",
      "default"
},
Actually Means!, don't we?.

Well the "1" represents the Type of the Flight, since YES. this whole structure above is enough to make a Flight with RCFF, if you ever have had some experience with modding SW, you should know there are 3 main types of ships in scripting, theres "1" which are Interceptors, "2" which are Bombers and lastly "3" which are Capital Ships, or "BigShips" if you want to call em by their coding name.

The "11" which you see above is the Minimal Strength (Can you allready guess what "16" ? ;), I hope this doesn't need an explanation also :D. B
ut im still going to write what it is: its the Maximal Strength.

and then we have the "default" string, this is actually a very useful thing which I would have almost NOT included, but luckily here we are with me talking about this great thing, so what is it? DRAGONS?! No. Far more simple, its the Object which this Flight needs to Escort.
the main RCFF-Script allready does it for you IF you leave it at "default", but you can modify it by simple typing a number of your desired ESCORT flight which this one will escort (Escort-ception o.O?).

This works like so in a Table:
Code:
{--0
      "1",
      "11",	
      "16",
      "default"
},
{--1
      "1",
      "5",	
      "8",
      "0"
}
The Second flight which I have marked with --1 will now Escort the Escort with number "0", can you guess why ;) ?.
It will Escort 0, and 0 is the first Escort Flight which is defined up there, then it goes from 0 - to whatever amount of escorts you have/add.


So... that was Easy!, wasn't it?, sadly FullManualEscort is a bit more Complex, but it is also waaaay more customizable.

So lets get into it, firstly we have again the FullManualEscort Variable itself, this can either be TRUE or FALSE, and it tells the main script if you want to use this method and ignore all other 2 methods.

"FullManualEscortTable" - I Hope you can see some similarities to ManualEscortTable, since its the same thing mostly, only with more variables.

So lets decode everything, shall we?
NOTE: The Current RCFF FullManualEscort Table has a bit different formatting, but if you understand this, you will also understand the new format.
Code:
{
	F_Carcass1 	=	"StoneArrow_vksR10",
	F_Carcass2	=	"disabled",
	F_Carcass3	=	"disabled",
	F_Carcass4	=	"disabled",
	F_Carcass5	=	"disabled",
	F_Carcass6	=	"disabled",
	F_Pilot1	=	"VksOfficer",
	F_Pilot2	=	"disabled",
	F_Pilot3	=	"disabled",
	F_Pilot4	=	"disabled",
	F_Pilot5	=	"disabled",
	F_Pilot6	=	"disabled",
	F_Roles1	=	"ROLE_LEADER",
	F_Roles2	=	"disabled",
	F_Roles3	=	"disabled",
	F_Roles4	=	"disabled",
	F_Roles5	=	"disabled",
	F_Roles6	=	"disabled",
	F_Formation =	"default",	
	F_EscortObj	=	"0"
},
As you can see, most of the vars go from 1 to 6, which is the max Ships inside a Flight, without the AI going apeshit.
I will replace all numerical Names inside those functions with X from now on.

"F_CarcassX" tells the script what kind of Carcass you want Ship Number X to be, you can take one from Carcasses.xml or ShipDescriptions.xml if you wish so.

"F_PilotX" is the Pilot which will be used for X Ship, see Pilots.xml for names.

"F_RolesX" is the Role this ship is Assigned.
Here are all Relevant Roles: "ROLE_LEADER", "ROLE_ATTACK", "ROLE_CLOACKER", "ROLE_MISSLEDEFENCE", "ROLE_DEFEND", "ROLE_REPAIR".
I know there are spelling errors inside there, but you can thank Elite games team for that, not my fault ^^.

So now we have the "F_Formation" variable, which you can leave at "default" or change it to a Formation, umm look around inside the Scripts/AI/group_formation.script for Valid Names.

Lastly we have the "F_EscortObj" Variable, its the exact same thing like with "ManualEscort"'s 4th Variable, this variable expects a number which represents a Escort Flight, because it will Escort that specified Escort Flight(Which it gets by this Number).

Heres sample Code where the 2nd Escort Escorts the first Escort (never thought im going to speak that out loud while typing, it feels veerry... mh... akward!)

Code:
{--0
	F_Carcass1 	=	"StoneArrow_vksR10",
	F_Carcass2	=	"disabled",
	F_Carcass3	=	"disabled",
	F_Carcass4	=	"disabled",
	F_Carcass5	=	"disabled",
	F_Carcass6	=	"disabled",
	F_Pilot1	=	"VksOfficer",
	F_Pilot2	=	"disabled",
	F_Pilot3	=	"disabled",
	F_Pilot4	=	"disabled",
	F_Pilot5	=	"disabled",
	F_Pilot6	=	"disabled",
	F_Roles1	=	"ROLE_LEADER",
	F_Roles2	=	"disabled",
	F_Roles3	=	"disabled",
	F_Roles4	=	"disabled",
	F_Roles5	=	"disabled",
	F_Roles6	=	"disabled",
	F_Formation =	"default",	
	F_EscortObj	=	"default"
},
{--1
	F_Carcass1 	=	"StoneArrow_vksR10",
	F_Carcass2	=	"disabled",
	F_Carcass3	=	"disabled",
	F_Carcass4	=	"disabled",
	F_Carcass5	=	"disabled",
	F_Carcass6	=	"disabled",
	F_Pilot1	=	"VksOfficer",
	F_Pilot2	=	"disabled",
	F_Pilot3	=	"disabled",
	F_Pilot4	=	"disabled",
	F_Pilot5	=	"disabled",
	F_Pilot6	=	"disabled",
	F_Roles1	=	"ROLE_LEADER",
	F_Roles2	=	"disabled",
	F_Roles3	=	"disabled",
	F_Roles4	=	"disabled",
	F_Roles5	=	"disabled",
	F_Roles6	=	"disabled",
	F_Formation =	"default",	
	F_EscortObj	=	"0"
},
By now you should figured out how this works, so what are you waiting for?, create some cool stuff with it and send so I can debug RCFF more efficiently! :D.

BUT W8 M8!!!!!!1111, WHY IS THERE "disabled" inside those Vars and WHAI??!.
I forgot to mention that, but you can write "disabled" into one of "F_Carcass", "F_Pilot" and "F_Roles" if you don't need 1 or a few more of them.

PRO TIP: If you want to be REEALY space efficient, you can just put "" into "F_Pilot" and "F_Roles", as long the COUNTER-PART "F_Carcass" is set to "disabled" the script won't look for these Pilots/Roles.

Reminder: Please be aware of your "," placement, it can be a pain if you aren't careful.


We are Nearing towards the end!
Now we have the Objective handling
"Objective" - you can currently choose from 0 to 4 Objective modes.
0 = Default(Patrols X AMOUNT RANDOM Vector3's and leaves the system)
1 = Escort Object, example: mothership, Be sure the specified object exists in the system this flight gets called in.
2 = Attack Object, same as above, only with the Flight attacking the Object.
3 = Fly to Vector3 Coordinates and return to any portal (This needs Table of Vector3s, which means you have to manually input Coordinates for this flight to fly to)
4 = Visit Random Stations (Visits random available stations and returns to portal)

Objective_Object - The Object talked about above.
Objective_Vector3 - Specifically for Objective #3, this is a Table with Vector3's.
Objective_VRandStMax - Max number of Stations to visit, specifically for Objective #4
Objective_VRandVMax - Max number of Random Vector3's to Visit, specifically for Objective #0
Objective_VRandVMax_YMax - Maximal Y value difference, example: if you would input 50, a Vector3 would have its Y Coordinate to be somewhere from -50 to 50. - Since in all honesty tho, it would be a CLUSTERFUCK if you would put the number too high, how would ever any flight get to meet any other one :D?

Here we get to the Events.
OnSpawn - If Enabled, it will trigger a Function by String in the 2nd Variable when the Flight spawns.
OnLeave - Same as above, only this time when the flight Leaves.
OnDeath - Same as above, only this time when the CAPITAL ship Dies.
OnEscortDeath - Same as above, only this time when the ESCORTS Die.

Conditional Events
C_OnArrival - If Objective 3 or 4 have been Selected, and also if enabled, it will Trigger a function by string when the flight has reached ANY Vector3 Coordinates. (This trigger will get triggered MULTIPLE times)
C_FirstPoint - same as above, only this time it will get triggered ONCE and only for the First Vector3.
C_LastPoint - samer as above, only this time on the last point.
C_PlayerNear - If PlayerInteraction is set to TRUE, and if enabled, this will trigger a function when the player gets too close.

The End.

Note: C_PlayerNear will get a third Variable, which will define the size of the trigger which the player needs to be in, it will be a simple integer value.



Dear god what a Textwall!.
TL;DR: Theres no way to make this a one liner....
PS: A Working version of RCFF will be included in RC-2, so be prepared :).
PSS: Feel VERY free to write me some Requests about new Properties and Events or C_Events!.

Quick Q/A:
Does This Replace Random Contacts?: No, it will work with it, since this acts as a Seperate Layer.

Does it break Fleet Mod?: No.

What can I do with it?: You really can't be bothered to read the post, cant ya?.

Why should I use it?: At the current state, you can't create something like the for example Market Caravans, but in the future you will surely be able to.
This script is also much more useful to work around with than creating a new event/RC from scratch.

Where and how can I show you my Awesome creation?: Pastebin

============================================
Oh and don't mind The 'todo in the pastebin, I forgot to remove that one note.
I allready have have a Function which reads the Table Values.

By the way: Tell me if you like the shown FullManualEscort Table Layout, or this one Better: (Please ignore the Lines)
Code:
--{
--	F_Carcasses	=	
--				{
--					"Wyvern_nav2",
--					"Wyvern_nav2",
--					"Wyvern_nav2",
--					"Wyvern_nav2",
--					"Trident_nav",
--					"Trident_nav"
--				},
--	F_Pilots	=	
--				{
--					"VksOfficer",
--					"VksOfficer",
--					"VksOfficer",
--					"VksOfficer",
--					"VksOfficer",
--					"VksOfficer"
--				},
--	F_Roles		=	
--				{
--					"ROLE_LEADER",
--					"ROLE_ATTACK",
--					"ROLE_ATTACK",
--					"ROLE_ATTACK",
--					"ROLE_MISSLEDEFENCE",
--					"ROLE_DEFEND"
--				}
--	F_Formation =	"default",
--	F_EscortObj	=	"default
--}
EDIT 2: Here a updated Table: http://pastebin.com/iznxrfKf

New Stuff:
Prop_PermEscortVisible - Same as PermVisible, only for the Escorts.
Prop_StackVectorMode - If enabled, this will "push" the next flight that gets generated by the specified first variable's Coordinate unit, either X, Y or Z. the value of the "push" is the second variable, in this cae its a 10.

InFlight Generation:
The ESCORT-FLIGHT Table formatting has changed a little bit, but you should be fine, the concept is the same!.
F_OverrideSpawnVector3 - if enabled, you can Override the Spawning Vector3 of this specific Flight, the second variable is the Vector3.
Use it like so: "TRUE", Vector3(X Coordinate, Y Coordinate, Z Coordinate).
__________________
Discord: Nocalora#6847 | SW3.Expansion Thread | SWX.MouseMovementFix | SWX.TUVMark+Src (.tuv editing Tool) | SWX.SLOTMark+Src (.ini Slots editing Tool)

Last edited by nocalora29; 07-29-2016 at 06:15 PM.
Reply With Quote
  #3  
Old 08-01-2016, 05:36 AM
nocalora29's Avatar
nocalora29 nocalora29 is offline
¯\_ ͯ‿ ͯ_/¯
 
Join Date: Dec 2011
Posts: 518
Default @All

Im going to stop hosting all my uploaded files/links at Mega in the next few days, due to it being just hilarious having one of TOP MOST WANTED criminals in china having ownership of it.
I am not quite sure where to host to be honest, but im going to find something eventually.

So expect some links to get broken and whatnot.

Andddd, RC-2 is going a lil' slow right since I just can't figure out the problem with the saving ternie mission, but other than that its going just fine, another thanks to Szpacky.

also I hoped atleast one person would take a try in doing a custom rcff table and posting it here/pastebin, hm oh well.
__________________
Discord: Nocalora#6847 | SW3.Expansion Thread | SWX.MouseMovementFix | SWX.TUVMark+Src (.tuv editing Tool) | SWX.SLOTMark+Src (.ini Slots editing Tool)
Reply With Quote
  #4  
Old 08-20-2016, 11:28 AM
Lotrek Lotrek is offline
Approved Member
 
Join Date: Jan 2012
Posts: 312
Default

Quote:
Originally Posted by nocalora29 View Post
Im going to stop hosting all my uploaded files/links at Mega in the next few days, due to it being just hilarious having one of TOP MOST WANTED criminals in china having ownership of it.
I am not quite sure where to host to be honest, but im going to find something eventually.
MOD DB has a SW3 page but no one has loaded a mod there, you could be the first!
http://www.moddb.com/games/star-wolves-3-civil-war

You could also look into Bitbucket or Dropbox
Reply With Quote
  #5  
Old 08-21-2016, 04:19 PM
nocalora29's Avatar
nocalora29 nocalora29 is offline
¯\_ ͯ‿ ͯ_/¯
 
Join Date: Dec 2011
Posts: 518
Default

Thanks Lotrek, ModDB Seems to be what im looking for

Lets see if their Staff cares enough to approve my stuff.

EDIT: Anyone have some Fancy or fun Screenshots while playing the mod?, I would glady accept any kind of user created Screenshots for the mods representational images!
__________________
Discord: Nocalora#6847 | SW3.Expansion Thread | SWX.MouseMovementFix | SWX.TUVMark+Src (.tuv editing Tool) | SWX.SLOTMark+Src (.ini Slots editing Tool)
Reply With Quote
  #6  
Old 08-22-2016, 07:24 AM
Lotrek Lotrek is offline
Approved Member
 
Join Date: Jan 2012
Posts: 312
Default

I see you are there now that's great. You do have one issue though. I logged in over there and was able to upload an old patch file with only the mod db authorization needed. I would look into locking out the ability to upload files by another member.

I am glad to see you still fighting the good fight when so many other modders have moved on. If I had any coding skill I would help. Best I can do is to continue to beta test.

May the Pandas be with you my friend
Reply With Quote
  #7  
Old 08-22-2016, 12:44 PM
nocalora29's Avatar
nocalora29 nocalora29 is offline
¯\_ ͯ‿ ͯ_/¯
 
Join Date: Dec 2011
Posts: 518
Default

Thanks for the hint, im going to look into it

And I don't really plan to stop the development of this mod until im Finished, the main thing im working on right now is basically the Path-finding for the CPU-Players, I have found a way to do that, but that would require me to write 120x120 paths from systems to systems, since I will never write that amount of code by hand I am currently writing a additional program with VB.NET to automatically index all systems in Star wolves and using an algorithm to create lua code which represent table's with the shortest way to a possible system

like so:
{"_AI_IN_THIS_SYSTEM", "AI_NEEDS_TO_GO_TO_THIS_SYSTEM", {"Shortest way from Neighbor of THIS_SYSTEM to AI_TARGET_SYSTEM"}};

Im struggling to do that tbh, but I won't give up!.

-----------------------------------------------
Also, I tweaked the "Repair" function at the maintance stations, so you won't immediatley have 100% HP, instead you will have to wait a certain amount of time until your HP Completely recharges, increments are at 10% of total Hull HP each 0.1s

BUT like with all of my "Plugins" it is completely customizable, see the "InitTeamScript" Section.

I named it ASRS:
Code:
--      /\          /\\ \\  /\\/\\       /\\/\\\\\\\  /\\      /\\\\\\\\
--     /\ \\      /\\    /\\/\\/\ /\\   /\\\/\\    /\\/\\      /\\      
--    /\  /\\      /\\      /\\/\\ /\\ / /\\/\\    /\\/\\      /\\      
--   /\\   /\\       /\\    /\\/\\  /\\  /\\/\\\\\\\  /\\      /\\\\\\  
--  /\\\\\\ /\\         /\\ /\\/\\   /\  /\\/\\       /\\      /\\      
-- /\\       /\\  /\\    /\\/\\/\\       /\\/\\       /\\      /\\      
--/\\         /\\   /\\ \\  /\\/\\       /\\/\\       /\\\\\\\\/\\\\\\\\
--                                 -  =   V E R S I O N   1 . 1   =  -                              
--/\\\\\\\    /\\\\\\\\/\\\\\\\        /\       /\\/\\\\\\\      /\\ \\   /\\\ /\\\\\\      /\       /\\\ /\\\\\\/\\    /\\\\     /\\\     /\\
--/\\    /\\  /\\      /\\    /\\     /\ \\     /\\/\\    /\\  /\\    /\\      /\\         /\ \\          /\\    /\\  /\\    /\\  /\ /\\   /\\
--/\\    /\\  /\\      /\\    /\\    /\  /\\    /\\/\\    /\\   /\\      	   /\\        /\  /\\         /\\    /\\/\\        /\\/\\ /\\  /\\
--/\ /\\      /\\\\\\  /\\\\\\\     /\\   /\\   /\\/\ /\\         /\\          /\\       /\\   /\\        /\\    /\\/\\        /\\/\\  /\\ /\\
--/\\  /\\    /\\      /\\         /\\\\\\ /\\  /\\/\\  /\\          /\\       /\\      /\\\\\\ /\\       /\\    /\\/\\        /\\/\\   /\ /\\
--/\\    /\\  /\\      /\\        /\\       /\\ /\\/\\    /\\  /\\    /\\      /\\     /\\       /\\      /\\    /\\  /\\     /\\ /\\    /\ \\
--/\\      /\\/\\\\\\\\/\\       /\\         /\\/\\/\\      /\\  /\\ \\        /\\    /\\         /\\     /\\    /\\    /\\\\     /\\      /\\
--                                                                                                                                        
--  /\\ \\      /\\   /\\\\\\\    /\\/\\\\\\\  /\\\ /\\\\\\
--/\\    /\\ /\\   /\\/\\    /\\  /\\/\\    /\\     /\\    
-- /\\      /\\       /\\    /\\  /\\/\\    /\\     /\\    
--   /\\    /\\       /\ /\\      /\\/\\\\\\\       /\\    
--      /\\ /\\       /\\  /\\    /\\/\\            /\\    
--/\\    /\\ /\\   /\\/\\    /\\  /\\/\\            /\\    
--  /\\ \\     /\\\\  /\\      /\\/\\/\\            /\\    
--Author: Nocalora29

--Replaces:
--Data\Scripts\Include\DockStation.script -> DialogR_fin()

--This Plugin disables the INSTANT 100% HP Recovery from Repair Stations
--Instead of magically repairing your hull to 100% in a sec, this Plugin -
--will Repair your Mothership over time, but only if your mothership isn't moving.
Default_ASRS_Name = "ASRS";
Default_ASRS_Error_InProg = "ASRS: Repair allready in Progress!";
Default_ASRS_Error_MoveDetect = "ASRS: Repair Cancelled!, you need to stand still!";
Default_ASRS_Fin = "ASRS: Successfully Repaired!";

__ASRS_InProgress = FALSE;
function _ASRS_RepairMS_Init()
	local AllowASRS = GetQuestLabel("__ASRS@Config_Allow");
	if (AllowASRS=="True") then
		_ASRS_RepairMS();
	else
		local N=GetPlayerCredits();
		if (N>=1000) then
			RepairBase();
			SubPlayerCredits(1000);
			OutputToScreenLog("#UI_TradeStationOkRepair",7);
		else	
			OutputToScreenLog("#UI_TradeStationNotRepair",7);
		end;
	end;

end;

function _ASRS_RepairMS()
	if (__ASRS_InProgress==FALSE) then
		__ASRS_InProgress = TRUE;
		local _ASRS_Allow = GetQuestLabel("");
		local PCash = GetPlayerCredits();
		local RepCost=1000;
		local _PCarc = GetPlayerMotherShip();
		local _PMSMaxHP = _PCarc:GetMaxHP();

		if (PCash>=RepCost) then
			SubPlayerCredits(RepCost);
			--Begin Repair Process
			local MSPos = _PCarc:GetPosition();
			setglobal("_ASRS_MSPos", MSPos);
			
			_ASRS_RepairMS_2(_PMSMaxHP);
		else	
			OutputToScreenLog("#UI_TradeStationNotRepair",7);

		end;
	else
		OutputToScreenLog(Default_ASRS_Error_InProg,7);
	end;
end;

__ASRS_MS_CompleteP = 0;
__ASRS_MS_MaxSpeed = 0;
__ASRS_MS_MaxSteeringPower = 0;
__ASRS_ILShowTime = 0.4;
__ASRS_OutOfSphere = FALSE;
function _ASRS_RepairMS_2(_PMSMaxHP)
	setglobal("_ASRS_PMSMaxHP", _PMSMaxHP);
	local RepDelay = tonumber(GetQuestLabel("__ASRS@Config_RepairDelay"));
	local RepAmount = tonumber(GetQuestLabel("__ASRS@Config_RepairAmount"));
	local UsePerc = GetQuestLabel("__ASRS@Config_UsePercentageRepair");
	local Perc = tonumber(GetQuestLabel("__ASRS@Config_Percentage"));
	local Req_StandStill = GetQuestLabel("__ASRS@Config_Require_StandStill");
	local DisDrives	= GetQuestLabel("__ASRS@Config_DisableDrive");
	local CRadius = tonumber(GetQuestLabel("__ASRS@Config_StandStill_Radius"));
	local _PCarc = GetPlayerMotherShip();
	local _PCurHP = _PCarc:GetCurHP();
	local PercRAND = GetQuestLabel("__ASRS@Config_PercRAND");
	local PercRANDMin = tonumber(GetQuestLabel("__ASRS@Config_PercRAND_Min"));
	local PercRANDMax = tonumber(GetQuestLabel("__ASRS@Config_PercRAND_Max"));

	--Options
	-- // Disable Drives
	if (DisDrives=="True") then
		__ASRS_MS_MaxSpeed = _PCarc:GetMaxSpeed();
		__ASRS_MS_MaxSteeringPower = _PCarc:GetSteeringPower();
		_PCarc:SetMaxSpeed(0);
		_PCarc:SetSteeringPower(0);
	end;
	--Repair
	if (Req_StandStill=="False") then
		--Does not need to stand still
		if (UsePerc=="False") then
			--Value Repair
			if (_PMSMaxHP >= _PCurHP) then
				_PCarc:SetHP(_PCurHP + RepAmount);
				Timer_Seq(RepDelay, _ASRS_RepairMS_Loop);
			end;
		else
			--Percentage Repair
			if (_PMSMaxHP >= _PCurHP) then
				local PercVal = 0;
				if (PercRAND=="False") then 
					PercVal = ((_PMSMaxHP / 100) * Perc); 
				else 
					PercVal = ((_PMSMaxHP / 100) * random(PercRANDMin, PercRANDMax)); 
				end;
				_PCarc:SetHP(_PCurHP + PercVal);
				
				__ASRS_MS_CompleteP = (_PMSMaxHP / _PCurHP) * 100
				OutputToScreenLog("ASRS: "..format("%.2f", __ASRS_MS_CompleteP).."% Completed", RepDelay+__ASRS_ILShowTime);
				
				Timer_Seq(RepDelay, _ASRS_RepairMS_Loop);
			end;
		end;
	else
		--Does need to stand still
		--_ASRS_OutsideRange_Trigger = CreateTrigger();
		--_ASRS_OutsideRange_Trigger:AttachEvent(_EVENT_INSIDEVOLUME);
		--_ASRS_OutsideRange_Trigger:SetObject(_PCarc);
		--_ASRS_OutsideRange_Trigger:SetVolume(_PCarc:GetPosition(), CRadius);
		--_ASRS_OutsideRange_Trigger:AttachCondition(TrueCondition);
		--_ASRS_OutsideRange_Trigger:AttachAction(_ASRS_RepairMS_LeaveRadius);
		--_ASRS_OutsideRange_Trigger:Activate();
		_ASRS_OutsideRange_Trigger = NewTrigger("outside", TrueCondition, _ASRS_RepairMS_LeaveRadius, _PCarc, _PCarc:GetPosition(), CRadius, FALSE);
		_ASRS_OutsideRange_Trigger:Activate();
		
		if (__ASRS_OutOfSphere==FALSE) then
			if (UsePerc=="False") then
				--Value Repair
				if (_PMSMaxHP >= _PCurHP) then
					_PCarc:SetHP(_PCurHP + RepAmount);
					Timer_Seq(RepDelay, _ASRS_RepairMS_Loop);
				end;
			else
				--Percentage Repair
				if (_PMSMaxHP >= _PCurHP) then
					local PercVal = 0;
					if (PercRAND=="False") then 
						PercVal = ((_PMSMaxHP / 100) * Perc); 
					else 
						PercVal = ((_PMSMaxHP / 100) * random(PercRANDMin, PercRANDMax)); 
					end;
					_PCarc:SetHP(_PCurHP + PercVal);
					
					__ASRS_MS_CompleteP = (_PCurHP / _PMSMaxHP) * 100
					OutputToScreenLog("ASRS: "..format("%.2f", __ASRS_MS_CompleteP).."% Completed", RepDelay+__ASRS_ILShowTime);
				
					Timer_Seq(RepDelay, _ASRS_RepairMS_Loop);
				end;
			end;
		else
			--Movement Detected
			OutputToScreenLog(Default_ASRS_Error_MoveDetect,7);
			__ASRS_InProgress = FALSE;
			__ASRS_OutOfSphere = FALSE;
			_ASRS_OutsideRange_Trigger:Delete();
		end;
	end;
	--Finish
	if (_PCurHP>=_PMSMaxHP) then 
		__ASRS_InProgress = FALSE;
		__ASRS_OutOfSphere = FALSE;
		_ASRS_OutsideRange_Trigger:Delete();
		
		_PCarc:SetHP(_PMSMaxHP); 
		OutputToScreenLog(Default_ASRS_Fin,7);
		
		--Options
		-- // Enable Drives
		if (DisDrives=="True") then
			_PCarc:SetMaxSpeed(__ASRS_MS_MaxSpeed);
			_PCarc:SetSteeringPower(__ASRS_MS_MaxSteeringPower);
		end;
		
	end;
end;

function _ASRS_RepairMS_LeaveRadius()
	__ASRS_OutOfSphere = TRUE;
end;

function _ASRS_RepairMS_Loop()
	local _PMSMaxHP = getglobal("_ASRS_PMSMaxHP");
	_ASRS_RepairMS_2(_PMSMaxHP);
end;
You could in theory allready use this, only be sure to load it by any system.lst and Place Replace this COMPLETE Function in scripts\dockstation.script
Code:
function DialogR_fin0()

end;
with
Code:
function DialogR_fin0()
-- > @Plugins\ASRS.lua
	_ASRS_RepairMS_Init();
end;
-InitTeamScript-
Code:
	SetQuestLabel("__ASRS@Config_Allow", 				"True");		-- ASRS Plugin - Boolean - Allow ASRS? [True = Use ASRS, False = Use Vanilla Repair System]
	SetQuestLabel("__ASRS@Config_RepairDelay", 			0.1);			-- ASRS Plugin - Repair Rate (Seconds)
	SetQuestLabel("__ASRS@Config_RepairAmount", 		100);			-- ASRS Plugin - Repair amount per RepairDelay
	SetQuestLabel("__ASRS@Config_UsePercentageRepair",  "True");		-- ASRS Plugin - Repair depending on Percentage of Max HP
	SetQuestLabel("__ASRS@Config_Percentage",			3);				-- ASRS Plugin - Percentage Value
	SetQuestLabel("__ASRS@Config_PercRAND",				"True");		-- ASRS Plugin - Eanble Random Repair Percentage
	SetQuestLabel("__ASRS@Config_PercRAND_Min",			3);				-- ASRS Plugin - Random Percentage Min
	SetQuestLabel("__ASRS@Config_PercRAND_Max",			7);				-- ASRS Plugin - Random Percentage Max
	SetQuestLabel("__ASRS@Config_DisableDrive",			"False");		-- ASRS Plugin - Disable Mothership Drives (No Movement Possible until Completion)
	SetQuestLabel("__ASRS@Config_Require_StandStill", 	"True");		-- ASRS Plugin - Require - Standing Still (Mothership)
	SetQuestLabel("__ASRS@Config_StandStill_Radius",	5);			    -- ASRS Plugin - Max Range before Cancel of Repair
Just paste the above code ANYWHERE in the InitTeamScript file
If anyone feels like it, feel free to install it and tell me how it feels like.

-System.lst- Section
IF you use Expansion Mod: use the plugins\system.lst and write it in there, also place the file you created with the code at top of this post and you're good to go.
IF you use the vanilla game: use the scripts\system.lst and write in in there also, watch out that you place the file where you have pointed at it in the system.lst

=This works for a vanilla game and a modded game=
__________________
Discord: Nocalora#6847 | SW3.Expansion Thread | SWX.MouseMovementFix | SWX.TUVMark+Src (.tuv editing Tool) | SWX.SLOTMark+Src (.ini Slots editing Tool)

Last edited by nocalora29; 08-22-2016 at 05:02 PM.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:37 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.