The Final Strike

A place to discuss mods in development and concepts for new mods.
AdmiralZo
Militia Lieutenant
Militia Lieutenant
Posts: 152
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: 1323
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: 374
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: 152
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: 374
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: 1323
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: 152
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.

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

Re: The Final Strike

Post by AdmiralZo » Mon Apr 03, 2017 11:45 am

In the pane <Explored3>, instead of the Svalbard 'following' the player, it gates from the system. However, other orders such as 'attack' and 'orbit' work fine there. Does anyone know why??
Attachments
SideQuestDarkNebula.xml
(14.11 KiB) Downloaded 10 times

shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1373
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska

Re: The Final Strike

Post by shanejfilomena » Mon Apr 03, 2017 5:12 pm

AdmiralZo wrote:
Mon Apr 03, 2017 11:45 am
In the pane <Explored3>, instead of the Svalbard 'following' the player, it gates from the system. However, other orders such as 'attack' and 'orbit' work fine there. Does anyone know why??
I looked it up and your order is correct.....if anything I would space between the two orders so your oders, per line are clear to the engine ( I learned spacing sometimes does matter to this game engine )

Code: Select all

							<Action name="Continue" key="C" default="1" cancel="1">
								(block Nil
									(shpCancelOrders gSource)
									
									(shpOrder gSource 'follow gPlayerShip)

									(scrExitDock gScreen)
									)
							</Action>
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..

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

Re: The Final Strike

Post by AdmiralZo » Tue Apr 04, 2017 4:27 am

shanejfilomena wrote:
Mon Apr 03, 2017 5:12 pm
I looked it up and your order is correct.....if anything I would space between the two orders so your oders, per line are clear to the engine ( I learned spacing sometimes does matter to this game engine )
It still doesn't seem to work. It's got something to do with 'escort' and 'follow'. If I replace it with 'attack', the Svalbard attacks as ordered.

relanat
Militia Commander
Militia Commander
Posts: 383
Joined: Tue Nov 05, 2013 9:56 am

Re: The Final Strike

Post by relanat » Tue Apr 04, 2017 5:41 am

shpOrder really needs a tutorial or more documentation. I'm still struggling with it but here's some stuff that might help (or at least generate discussion that helps).

I think 'follow' only works if the object that is to follow is an auton or possibly only a mule auton. It could need something in the controller code to make this work.

Possibly/similarly/maybe 'escort' needs a wingman or auton controller thingy too, or something in the ShipClass code to make it work, or sovereign/disposition clashes can cause this gating behaviour too. Others will have to confirm or deny this because I'm not really sure (the wingmen I'm working on are, unfortunately, quite independent :lol: ).

If that gets too hard maybe a recurring event that puts the Explorer 30ls behind the playership using 'goToPos' or something.

Not relevant here because you are escorting the playership, but if you want an object to escort something other than the playership, I've had success by 'setq'ing the escort target as escortTarget or some similar value and using that in the shpOrder code rather than creating or finding the object in the shpOrder code.

And thanks for the teaser too. I always get excited when I see another post by you in this topic (and then get mildly disappointed when it isn't the mod being released :( :D ).

PS: scrExitDock has been deprecated and in some circumstances can cause problems (credit to AP for that maybe?). scrExitScreen is the new code.

shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1373
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska

Re: The Final Strike

Post by shanejfilomena » Tue Apr 04, 2017 8:03 am

relanat wrote:
Tue Apr 04, 2017 5:41 am
shpOrder really needs a tutorial or more documentation. I'm still struggling with it but here's some stuff that might help (or at least generate discussion that helps).

I think 'follow' only works if the object that is to follow is an auton or possibly only a mule auton. It could need something in the controller code to make this work.

Possibly/similarly/maybe 'escort' needs a wingman or auton controller thingy too, or something in the ShipClass code to make it work, or sovereign/disposition clashes can cause this gating behaviour too. Others will have to confirm or deny this because I'm not really sure (the wingmen I'm working on are, unfortunately, quite independent :lol: ).

If that gets too hard maybe a recurring event that puts the Explorer 30ls behind the playership using 'goToPos' or something.

Not relevant here because you are escorting the playership, but if you want an object to escort something other than the playership, I've had success by 'setq'ing the escort target as escortTarget or some similar value and using that in the shpOrder code rather than creating or finding the object in the shpOrder code.

And thanks for the teaser too. I always get excited when I see another post by you in this topic (and then get mildly disappointed when it isn't the mod being released :( :D ).

PS: scrExitDock has been deprecated and in some circumstances can cause problems (credit to AP for that maybe?). scrExitScreen is the new code.
too many words for my glasses to focus on at one time :()

The "Problem" with the orders has always been like the Panes running between
"OnInit" & " Initialize" : they keep changing around when what was already there
and worked just fine.

'forceUndock used to be <Exit/> ( sometimes it still works )

Code: Select all

(scrExitScreen gScreen 'forceUndock)
'followPlayer is an Old order, used on NPC ships & some Autons. ( example )

Code: Select all

 (block Nil
				(if (not aTargetObj)
						(setq aTargeObj gPlayerShip)
						)
										  'followPlayer
								  
								)


I do believe the engine will still obey the old commands if they are set out right :
all this "depreciating" going is just insane Leave-it-to-beaver nonsense.
they aren't even posting alternatives to the orders they think they have a better plan over.

Anyway : sometimes you have to make things up : remember the ships can "detect" the Player , etc at distances : (ls (objGetDistance gPlayerShip gSource) 25) +++ make up a line that tells the ship to maintain that distance to the player, if the player hits a distance to a gate. order it to escort and hit the gate with the player....so ..basically you will be building a custom behavior
where you can tail the Player but without escorting them.

another way to do it is not to use the PlayerShip : but something ON the PlayerShip : I once had a ship that locked onto an item in the Player's cargo hold.....if the player had the item, the ship would guard the Item ( but not the PlayerShip )...kind of like Gollum with his Precious...
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..

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

Re: The Final Strike

Post by AdmiralZo » Wed Apr 05, 2017 4:16 am

I finally got it to work. It seems like it will not escort the player when the player is already ordered to escort that ship. You need to do (shpCancelOrders gPlayerShip) first. :D

relanat wrote:
Tue Apr 04, 2017 5:41 am
And thanks for the teaser too. I always get excited when I see another post by you in this topic (and then get mildly disappointed when it isn't the mod being released :( :D ).
Sorry for disappointing you Relanat... :( :( It is taking much longer than I had expected and hoped for; especially since I'm very busy this year.

shanejfilomena wrote:
Tue Apr 04, 2017 8:03 am
I do believe the engine will still obey the old commands if they are set out right :
all this "depreciating" going is just insane Leave-it-to-beaver nonsense.
they aren't even posting alternatives to the orders they think they have a better plan over.
Yeah, right now it only works on the alpha versions. There are a lot of things to fix before it will work on the current version...

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest