6637c50fc8591

6637c50fc8ccf
1 Guest is here.
 

Topic: Mark searched containers as searched Read 439 times  

6637c50fc920fZylonBane

6637c50fc92a4
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.

6637c50fc95bfsarge945

6637c50fc9621
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 2 takes place on the star ship named ...:
1 Guest is here.
James Bond is an operative, not a spy.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
6637c50fc974c