664726195187e

6647261951fed
1 Guest is here.
 

Topic: Mark searched containers as searched Read 450 times  

6647261952486ZylonBane

66472619524e9
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.

6647261952782sarge945

66472619527d9
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:

An evil mega-corporation with 3 branches:
1 Guest is here.
If anyone asks, Sarah is the spirit of the companion cube!
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
66472619528c4