6647c9c7a89f0

6647c9c7a9926
1 Guest is here.
 

Topic: Mark searched containers as searched Read 454 times  

6647c9c7a9d58ZylonBane

6647c9c7a9dc5
This is a little experiment I whipped up. It appends "(searched)" to the display name of any container you've searched and emptied out, as a QoL feature for players so they can tell just by looking whether they've already searched a thing.
Code: [Select]
class containerscript extends SqRootScript {
function OnFrobWorldEnd() {
if (!Quest.Get("HideInterface")) {
checkEmpty();
Sound.PlayEnvSchema(self, "Event Activate",  self, 0, eEnvSoundLoc.kEnvSoundAmbient);
ShockGame.Container(self);
}
}

function OnContainer() {
checkEmpty();
}

function checkEmpty() {
if (!IsDataSet("Searched") && !Link.AnyExist("Contains", self)) {
local suffix = " (searched)";
SetProperty("ObjName", ": \"" + Data.GetObjString(self, "objname") + suffix + "\"");
SetProperty("ObjShort", ": \"" + Data.GetObjString(self, "objshort") + suffix + "\"");
SetData("Searched", true);
}
}
}
Just copy/paste into any .nut file in your sq_scripts folder.

Unfortunately this doesn't work with hackable crates or creatures. They have their own, much more complex scripts that manage opening the container interface, and would need to be completely re-implemented in Squirrel to extend this feature to them.

Anyway, I'm not sure if there would even be any interest in a fully implemented version of this. I'd thought maybe it could be incorporated into SCP, but it would be a somewhat major change.

6647c9c7aa042sarge945

6647c9c7aa09b
I was going to do something similar, congrats on doing it first.

If you decide to make it part of SCP, it might be worth also sending a message (maybe OnSearched) when the player closes the container for the first time, so that people can make addons,  off the top of my head I can think of porting the container animations from Secmod as a submod that just responds to the message, staying open if it's searched.

I guess that could just be done on frob, though. I dunno. Maybe it's not that useful after all.
« Last Edit: 16. July 2023, 06:15:31 by sarge945 »

Your name:
This box must be left blank:

System Shock takes place on a space station named ...:
1 Guest is here.
You can’t go back. But you can attain a kind of peace.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
6647c9c7aa193