Right now the ships logs that we can attach to derelicts in Lua scripts are limited to 100 characters which doesn't leave much room for detailed story telling. This limitation is enforced in two places (at least). The first place is in derelict_set_ships_log(), which uses strndup() to copy the log and truncate it to 100 chars + terminating NUL byte. I think the only place to view the ships log is via comms transmissions (i.e. while communicating with the mining bot, which is how the ships logs are recovered.) The comms transmissions are limited to 100 bytes apiece as well in send_comms_packet() and send_enciphered_comms_packet().
But, we could break up longer logs into multiple 100 byte comms transmissions, with something like this:
char *text = "some very long string longer than 100 bytes ... ";
char buf[100];
int start = 0;
do {
int count = snprintf(buf, sizeof(buf), "%s", &text[start]);
printf("%s", buf); // replace with call to e.g.: send_packet_to_all_clients().
if (count < (int) sizeof(buf))
break;
start += sizeof(buf) - 1;
} while (1);
although the comms transmission uses vnsprintf(), and then snprintf to accommodate dynamic formatting, so it would be a little more complicated and might need a large buffer for the vnsprintf, then use something like the above code to break that up for transmission.
Right now the ships logs that we can attach to derelicts in Lua scripts are limited to 100 characters which doesn't leave much room for detailed story telling. This limitation is enforced in two places (at least). The first place is in derelict_set_ships_log(), which uses strndup() to copy the log and truncate it to 100 chars + terminating NUL byte. I think the only place to view the ships log is via comms transmissions (i.e. while communicating with the mining bot, which is how the ships logs are recovered.) The comms transmissions are limited to 100 bytes apiece as well in send_comms_packet() and send_enciphered_comms_packet().
But, we could break up longer logs into multiple 100 byte comms transmissions, with something like this:
although the comms transmission uses vnsprintf(), and then snprintf to accommodate dynamic formatting, so it would be a little more complicated and might need a large buffer for the vnsprintf, then use something like the above code to break that up for transmission.