663abc8076cf1

663abc807730b
1 Guest is here.
 

Topic: Mark searched containers as searched Read 440 times  

663abc80777a9ZylonBane

663abc8077811
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.

663abc8077a5bsarge945

663abc8077abf
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:

A familiar door code with 3 digits:
1 Guest is here.
You are standing in an open field west of a white house, with a boarded front door. There is a small mailbox here.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
663abc8077be8