The Final Strike

A place to discuss mods in development and concepts for new mods.
AdmiralZo
Militia Lieutenant
Militia Lieutenant
Posts: 142
Joined: Wed Feb 11, 2015 10:32 am
Location: Scouring Dantalion System for CSC Antarctica...

Re: The Final Strike

Post by AdmiralZo » Wed Jan 11, 2017 12:49 pm

How do we get the name of the system a particular station is in? I've looked in Benedict03.xml but I don't understand it.

Code: Select all

<OnAttackedByPlayer>
		(block (inbound)
			(objSendMessage gPlayerShip gSource "They've found us!")

			(setq inbound (sysFindObject Nil "G:Inbound; N"))

			(sysAddObjTimerEvent 65 gSource "Escape")

			(shpCancelOrders gSource)
			(shpOrder gSource 'dock inbound)
			)
</OnAttackedByPlayer>
This ship does nothing when I attack it...

User avatar
JohnBWatson
Fleet Officer
Fleet Officer
Posts: 1267
Joined: Tue Aug 19, 2014 10:17 pm

Re: The Final Strike

Post by JohnBWatson » Wed Jan 11, 2017 6:56 pm

I believe this is what you're looking for. Understanding what happens in Benedict03 is pretty trivial once you get through the complexity of unvFindObj.

Regarding your code, if it's getting called at all the text should be showing. You can test this by noting everything out but the message. I imagine your issue is related to the notorious unreliability with onAttackedByPlayer.

If you can't get it to call at all, you should either ask in the IRC for someone who understands that function or try to use a more roundabout way of accomplishing what you'd like to accomplish.

NMS
Militia Commander
Militia Commander
Posts: 342
Joined: Tue Mar 05, 2013 8:26 am

Re: The Final Strike

Post by NMS » Thu Jan 12, 2017 7:28 am

You might have to use objRegisterForEvents or objRegisterForSystemEvents after creating the object for that type of event to work.

AdmiralZo
Militia Lieutenant
Militia Lieutenant
Posts: 142
Joined: Wed Feb 11, 2015 10:32 am
Location: Scouring Dantalion System for CSC Antarctica...

Re: The Final Strike

Post by AdmiralZo » Thu Jan 12, 2017 12:30 pm

I managed to get the code working by using <OnAttacked> and objHasAttribute.

Code: Select all

<OnAttacked>
			(block (status)
				(setq status (typGetGlobalData &stSindikatController; "status"))
				(switch
					(eq status 'inSystem)
						(block Nil
							(switch
								(objHasAttribute aAttacker "00200000_PlayerShip")
									(block (inbound)
										(objSendMessage gPlayerShip gSource "They've found us!")

										(sysCancelTimerEvent gSource "OnUpdate")

										(typSetGlobalData &stSindikatController; "status" 'leaving)

										(setq inbound (sysFindObject Nil "G:Inbound; N"))

										(sysAddObjTimerEvent 65 gSource "Escape")

										(shpCancelOrders gSource)
										(shpOrder gSource 'goto inbound)
										)
									)
								)
							)
						)
</OnAttacked>

But I still can't work out the sysGetName thingy. Where would I use:

Code: Select all

(map (unvFindObj "s +sindikatLord;") theEntry (sysGetName (@ theEntry 2)))

NMS
Militia Commander
Militia Commander
Posts: 342
Joined: Tue Mar 05, 2013 8:26 am

Re: The Final Strike

Post by NMS » Thu Jan 12, 2017 7:49 pm

Where you use it depends on what you're trying to do with the information. That particular code returns a list containing the names of the systems that each Black Market station is in. (Some will be duplicates if there's more than one in a system.)

User avatar
JohnBWatson
Fleet Officer
Fleet Officer
Posts: 1267
Joined: Tue Aug 19, 2014 10:17 pm

Re: The Final Strike

Post by JohnBWatson » Fri Jan 13, 2017 2:14 am

AdmiralZo wrote:I managed to get the code working by using <OnAttacked> and objHasAttribute.
That's what I was thinking of - glad it worked out well.

But I still can't work out the sysGetName thingy. Where would I use:

Code: Select all

(map (unvFindObj "s +sindikatLord;") theEntry (sysGetName (@ theEntry 2)))
The link I gave you should cover that - the return value of the function in parenthesis is a list containing the name of the system of every station with the +sindikatLord attribute.

sysGetName takes a node ID and returns the corresponding name. Node IDs are used heavily in topology, so look in there if you're curious as to how they work.

AdmiralZo
Militia Lieutenant
Militia Lieutenant
Posts: 142
Joined: Wed Feb 11, 2015 10:32 am
Location: Scouring Dantalion System for CSC Antarctica...

Re: The Final Strike

Post by AdmiralZo » Fri Jan 20, 2017 7:00 am

UPDATE

Player ships
Instead of beginning with an Aquila, you start with one of the original classes (with endgame equipment) but get the opportunity to switch to it midgame.


CSC missions
I'm currently redoing all the CSC missions to incorporate more unique ones. So far completed 5 out of ~20 missions.


Fuel
Since the Ares are becoming both more ruthless and strategical, free fuel from CSCs are no longer available. Ways to obtain fuel:

-Looting from Ares refineries

-'Buying' fuel from CSCs and Fleet installations with Fleet fuel tokens (FFT). These can be collected from completing missions and donating pteracnium ore (and possibly hadron archeolith and hyperonic ore which I think can be used to make hadron-vacuum fuel cells) to them. Ore can be looted from Ares mines.

Post Reply

Who is online

Users browsing this forum: Shrike and 1 guest