various questions and stuff

Freeform discussion about anything related to modding Transcendence.
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

Is there a way of determining with code if an object is highlighted? As in 'setShowAsDestination'ed with the green or red circles showing around the object.
Stupid code. Do what I want, not what I typed in!
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 am

relanat wrote:
Mon Jun 04, 2018 2:29 am
I commented out the Exclude nil code in AP's example and it works just as I needed. Those pesky little variables pop up everywhere in my code. But not for long!
Ah, good. AP's addition of showing the values is nice, but you probably don't want to exclude the variables whose value is Nil. The 'excludeNil in my version was to strip the Nils from the list that resulted from the (if) returning Nil when the condition is met.
relanat wrote:
Thu Jun 14, 2018 1:56 am
Is there a way of determining with code if an object is highlighted? As in 'setShowAsDestination'ed with the green or red circles showing around the object.
Apparently not. You'll have to keep track of them some other way. Probably add their IDs to a list stored as data on a type when you call objSetShowAsDestination, then remove them when you call objClearShowAsDestination. If this won't work and you really need the feature, you could open a ticket.
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

Thanks. The highlighting stuff isn't critical, just easier. Its only for 'modding' mods which highlight "Find Objects". I'm optionally highlighting all objects of a type and then clearing the highlights by 'enum'ing all objects in a system on system exit. Not ideal but good enough. Eventually I'll store the station IDs as they are highlighted but it has a low priority.

How does "the greying out of shipwrecks after the playership has docked with them" work? Is there a way to make this happen with code?
As in you destroy a ship and it appears as a hollow green square on the LRS. But then will appear as a greyed-out square on the LRS after you dock the playership with it.
It would be very handy if this could happen when an auton docks with the wreck to loot it instead of needing the playership to do it.
Stupid code. Do what I want, not what I typed in!
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 am

There is not currently a way to interact with this in TLisp. When the player docks with something, the SetExplored() function is called and sets m_fExplored to true. It's only used for determining the color of wrecks. It seems like it would be fairly simple to add this as an object property that could be checked and set.

I've been considering trying to make some other SRS improvements. See this ticket and the first two related ones (Archcannon implemented the third, but George didn't like it). It's also worth considering if stations should change color when looted and if the colors should depend on whether there were items left when the player undocked.
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

I'll request that 'setExplored thingy' since it should be fairly easy. Thanks.
And I really wish that containers were still a hollow green square on the LRS. It makes sense and really helps in gameplay if objects that you want to loot all appear the same and all change color after looting/docking. Your idea of having abandoned stations change color after looting is a good one. As is the different sizes of icons; a Cryson Magister (sp?) would probably returns a larger scanning signal than a Hornet!
The changing of the nav beacons to a solid green dot from the previously confusing hollow square was excellent.

And that gives me an idea for a mod that leaves a marker if you want to return and loot more gear later. I've already tried setting wrecks to 'don't let NPCs or Salvagers loot them' but it didn't work very well.


Is there a way of filtering for weapons that fire in dual configuration? Multishot looked good but returns TK10, IM90, etc which fire from a single point. Looking to set weapon slots that fire dual weapons from a point on the ship where it doesn't look really odd!

'typGetDataField' and 'itmGetProperty' both return the same thing for 'configuration on dual weapons but it is a hideous string of numbers which I can't decipher or work out how to use.
Stupid code. Do what I want, not what I typed in!
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 am

relanat wrote:
Sat Jul 07, 2018 1:49 am
I'll request that 'setExplored thingy' since it should be fairly easy. Thanks.
https://github.com/kronosaur/Mammoth/pu ... 231d2c7351

relanat wrote:
Sat Jul 07, 2018 1:49 am
And I really wish that containers were still a hollow green square on the LRS. It makes sense and really helps in gameplay if objects that you want to loot all appear the same and all change color after looting/docking. Your idea of having abandoned stations change color after looting is a good one. As is the different sizes of icons; a Cryson Magister (sp?) would probably returns a larger scanning signal than a Hornet!
The changing of the nav beacons to a solid green dot from the previously confusing hollow square was excellent.
Agreed, but unfortunately they're the same change, and separating various containers from other small stations is a little tricky. It would be relatively simple to check for an attribute in the attributes list, but it seems like these are generally not supposed to have effects on the engine. So it would be better to add an XML attribute, but this is a bit more complicated. I'll probably try to do it soon though.

relanat wrote:
Sat Jul 07, 2018 1:49 am
And that gives me an idea for a mod that leaves a marker if you want to return and loot more gear later. I've already tried setting wrecks to 'don't let NPCs or Salvagers loot them' but it didn't work very well.
I'm not sure how you'd do that other than making them radioactive.

relanat wrote:
Sat Jul 07, 2018 1:49 am
Is there a way of filtering for weapons that fire in dual configuration? Multishot looked good but returns TK10, IM90, etc which fire from a single point. Looking to set weapon slots that fire dual weapons from a point on the ship where it doesn't look really odd!

'typGetDataField' and 'itmGetProperty' both return the same thing for 'configuration on dual weapons but it is a hideous string of numbers which I can't decipher or work out how to use.
Yes, I want to fix this too. Something like 'dualConfiguration (dual or alternating) or 'multiOrigin (also including any other configuration where the shots don't all come from the same point) would be useful. Also see http://ministry.kronosaur.com/record.hexm?id=77653.
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

Wow. Thanks for the Mammoth - explored work. That's excellent.

RE looting; I'm pretty hazy on the details, it was a couple of version ago, but obj data is added to wrecks after they have been looted, something like '0000c100_marked', to stop NPCs and, I think, salvagers from relooting them. System traffic/ship controller stuff or similar.
I was adding this data but if the other ships had already been ordered to loot the wrecks before this was added they ignored it. I figured it needed either an event or a change in ship orders to prevent this and I still struggle with those. One day!
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

I was using scrAddAction inside <OnGlobalPaneInit> in a <Type> UNID recently.

It seemed that having this sort of code

Code: Select all

(scrShowScreen gScreen &dsWhicheverDockscreen {
	thisData: (codeGetWhatever info)
	})
in the code section of scrAddAction wouldn't carry the info to the destination dockscreen from a <Type> UNID. So the info couldn't be found using (@ gData 'thisData).
It works fine in Dockscreen UNID <Events>.

Could someone check this please. I'm not sure whether it is a bug , I have messed up the code or it was never meant to transfer the info in this situation.
Stupid code. Do what I want, not what I typed in!
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 am

Are you sure the only difference is whether it's in a Type or Dockscreen?
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

NMS wrote:
Fri Aug 03, 2018 6:33 pm
Are you sure the only difference is whether it's in a Type or Dockscreen?
Nope. That's why I posted here and didn't ticket it. If you can get the info transferred then it was errors in my code, a not uncommon event!
I worked around it using type data but didn't have the time to do a great deal of further testing. Thanks for checking.
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

Attached is a text doc of minor stuff I was going to put on git. Time constraints prevent me from doing this so if someone wants to use them feel free. Otherwise I'll get them done eventually.
Attachments
git commits.txt
(3.71 KiB) Downloaded 297 times
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

NMS wrote:
Fri Aug 03, 2018 6:33 pm
Are you sure the only difference is whether it's in a Type or Dockscreen?

OK. Second go. Wrong XML element. You had already spotted it. It's <OnGlobalPaneInit> doing it.
https://ministry.kronosaur.com/record.hexm?id=56455
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

Looking at the 'angry' functions.

Code: Select all

(objGetProperty theObj 'angry)
sometimes returns a number regardless of theObj being angry/not angry at the player. I can't detect any pattern.

Is this meant to be a countdown? And if so is it broken? Many versions ago stations would return to being friendly after a while, but I haven't seen this happen in quite a while.

Any clues on what the number means and how to use it?
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

I really like the Taipan image (by Xephyr) in the GodShip mod but also like the Scorpion too!
Greedily, I thought "How about having both!".

Is there a way of having a ship image be randomly selected from 2 or more images? So there could be a 50/50 chance of using the Taipan or Scorpion images on creation.

Possibly a table in the image XML? Or a way of randomly using ShipClassOverride? Some other way?
Stupid code. Do what I want, not what I typed in!
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 am

Stations can use <ImageVariants>, but I'm not sure about ships.
Post Reply