Shiplog Captains Log

A place to discuss mods in development and concepts for new mods.
Post Reply
Militia Captain
Militia Captain
Posts: 846
Joined: Tue Nov 05, 2013 9:56 am

Mon Jul 31, 2017 7:01 am

Great mod by Bobby. Useless in 1.8a2 as it causes lag.

Worked fine in 1.5.
Somewhere between then and 1.6b4 (I don't have any of the in-between versions) it started to go wrong. (Note: bump archive topic again)
Main sign was an inability to remain in the Eridani system log unless you were in Eridani at the time. The mod flicked automatically back to the current system if you selected the Eridani system when you weren't in Eridani.
Dockscreen scrDescs vanish as well after a brief initial appearance.

A possible culprit is the change of order for <GetGlobalDockscreen> which now takes place after the <OnObjDocked> event (API 26 and higher).
Floating point support
The engine undefines all <Globals> at the start of a new game or when loading an old game.
(Thanks, digdug, for the changelog, very helpful.)

One thing I've noticed:
The <Canvas> code updating continuously rather than on entering the screen or on cursor movement although this happens in 1.5 as well.

Anyone had a go at fixing it, got any clues or seen anything else that might determine how to fix it?. Awesome mod and pretty much necessary for playing large adventures.
Stupid code. Do what I want, not what I typed in!

Fleet Admiral
Fleet Admiral
Posts: 2515
Joined: Wed Sep 01, 2010 12:54 am

Mon Jul 31, 2017 3:12 pm

I have considered doing something like this, but I am backlogged right now. I have yet to update multiple mods. It will be a while before I can think about writing a log mod.
Download and Play in 1.9 beta 1...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!
Playership Drones: Buy or restore exotic ships to command!

Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.

Militia Captain
Militia Captain
Posts: 561
Joined: Tue Mar 05, 2013 8:26 am

Tue Aug 01, 2017 8:52 am

I'm taking a look at this. So far I've:

- Standardized indentation in some places.
- Improved names and keys of some actions.
- Changed order of actions on some screens.
- Removed stSystemLogStation, which was causing severe performance impact, apparently by registering lots of objects for events. This removes some event logging functionality, but I don't feel like trying to restore it with less performance impact at the moment.
- Disabled playing sounds on dockscreen actions, since they're irritating and the game now plays a sound at the same time anyway.
- Added APIVersion 37, extends unidRPGLibrary, and ENTITY declarations, so it can work in other adventures.
- Fixed duplicate UNIDs.

Bugs not fixed yet:
- Screen descs disappearing.
- Some actions not working, including finding items.
- Inability to select Eridani unless the system list has been reordered.

I think some, if not all, of these could be caused by bad use of global variables clSystem and clNode.
Captain's log - NMS.xml
(91.09 KiB) Downloaded 120 times

Militia Captain
Militia Captain
Posts: 846
Joined: Tue Nov 05, 2013 9:56 am

Fri Aug 11, 2017 5:48 am

Nice work. And getting rid of those sounds is great. They were something you had to get used to.

The find action is working for station names just not items. This is (probably) because the stationlog has been removed.

In the station log screen the station inventories aren't available so the mod probably can't find items in them, if that's how the mod does it.

Also, if it helps, when selecting Eridani when not in Eridani it appears as if the log scrolls back through all the systems to the current system rather than jumping directly to the current system. It's also possible that selecting the last system in the game (possibly Heretic) with the mod also results in the log scrolling back to the current system, but this is from memory so I can't be sure.
Stupid code. Do what I want, not what I typed in!

Militia Captain
Militia Captain
Posts: 846
Joined: Tue Nov 05, 2013 9:56 am

Tue Jul 10, 2018 3:20 pm

I noticed a couple of crash reports from toxicfrog which had Captain's log loaded and... well... one thing led to another :!: .

Here's a version which sorta works in 1.8b2. I found the source of the crashes and bypassed it so the game shouldn't crash anymore. Still has the vanishing scrDescs but only in Eridani and 'Find' is a bit glitchy but the Station Inventory works. Eridani still skips back to the current system too.

But it seems somewhat usable. Still I recommend playing in debug mode just in case.
Here is the changelog so far.
Captains log changelog updating for 1.8b2

Removed unused code.
API to 41
Added HumanSpaceLibrary
All Globals to one block.
Changed duplicate UNIDs
Bypassed 'clCenterObjectImage' as it was causing crashes.
Updated dockscreen language.
Changed stClMapper to <Type>and renamed 'evClMapper'.
Updated "shpIsTargetingComputerInstalled" code.
Lambda 'clSetActions' updated to action ids.
Changed 'item' to '@'

Changed <GetGlobalDockscreen> qualifier from just (not (objHasAttribute 'shipwreck) to:
(if (and (not (objHasAttribute gSource "shipwreck"))
(shpGetDockObj gPlayerShip)
(clUpdateStation gSource)
This stops the hundreds of NPC dockings appearing in the event log.
Note: multiple dockscreens still causing multiple events to appear for the same station. Eg: dock at Sisters in Eridani and the Benedict screens cause another event or two. Possibly adding "<Main> dockscreen only" qualifier will fix this.

Changed typGet/SetGlobalData to typGet/SetData.
Here's some notes I made during the updating. Not all are relevant anymore.
Additionally commenting out all the <Events> didn't stop the vanishing scrDescs. I was thinking that an event was updating the screen somehow but it still happened.
Also the <OnUpdate> event is being run by another event "Reset". Possibly (thanks digdug, for the changelog) this happens now automatically so this isn't needed.
And <GetGlobalDockscreen> has changed since the mod was written too.
Commenting out the third 'switch' option in <OnScreenInit> of dsCaptainsLog did stop the scrDesc disappearing (this was the only way I found to stop this from happening). But also stopped the list from being reset for other systems.

Code: Select all

(block Nil
	(setq clShownSystem clSystem)
TODO captains log

Multiple (3) events on docking with Sisters in Eridani. Possibly event is registered on different dockscreens. GetGlobalDockscreen?

The first two are related. They only happen in Eridani. Something is updating the screens. Must be one of the events?
1. Fix skipping system display.
System display will skip back to the current system if you scroll back to Eridani.

2. Screen Descs
Fix vanishing scrDescs. Possibly only happens with no items in list?
Screen "Filter" has a vanishing scrDesc. As does mark map.
In "Find" scrDesc appears for 1/2 a second or so.
There is an event "Reset" which is run in <OnCreate> after 30 ticks.
"Reset" runs an <OnUpdate> event but doesn't <OnUpdate> happen anyway?

Adding a scrDesc to pane "Default" shows for a fraction of a second then blank. How can the pane show without the scrDesc? scrGetScreen says dsCaptainsLog and pane "Default".

3. Find in Captains Log doesn't find items sometimes. Erratic.

4.Find Items in Station Log
Find items isn't clearing on exit.
The search term is also carried over from Find in Captains Log

5. "More data" action isn't disabled on Destroyed events. Cant exit screen without getting More data from a real station.

6. Getting an invalid action ID error for 'actionStationLog in 'clLogSetUpScreen'. Only after events visited or something.



Adjust scrSetActionLabels to show action keys.
Change Mark Map to Enter/Esc, Has text input.
Work out if prevKey="true" is needed.
Change dockscreen to target log and mark map and show optionally in dsCaptainsLog

Item lists at Starton Eridani have normal list format then ammo. Possibly the station restocking is doing this.
Somehow have station item lists resorted to standard format after items have been added.
EDIT:Random thought posted before I forget.

The vanishing screen descs are vanishing because the <Display> is being updated but not the screen, or possibly the pane. That could be how the <Display> is changing but the scrDesc isn't being added. Need to check what resets the <Display>. This could be causing the flickering. Maybe refreshing or showing the pane before or after the <Display> reset will stop the flickering. Only happens in Eridani so far.

2ND EDIT: The scrDesc is vanishing because of (scrSetDesc gScreen stations) code in one of the lambdas.
(279.78 KiB) Downloaded 73 times
Stupid code. Do what I want, not what I typed in!

Post Reply