6646ef8d1bcbc

6646ef8d1c0cc
1 Guest is here.
 

Topic: Mark searched containers as searched Read 448 times  

6646ef8d1c500ZylonBane

6646ef8d1c56c
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.

6646ef8d1c7desarge945

6646ef8d1c84e
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:

In which year was System Shock released:
1 Guest is here.
from a TriOp commercial: The Face Slimmer Exercise Mouthpiece slips over the wearers natural lips to enhance the natural pout without the need for injections
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
6646ef8d1c943