LarryG on 18/8/2017 at 03:00
Here is another enhancement request for a standard script, this time for StdButton. I would like a dStdButton which recognizes the Engine Features > Locked flag. My thought is that the button should only function when unlocked. When locked, it could be frobinert or make a locked sound when frobbed.
I recently was reminded that making a button frobinert doesn't prevent it from being pushed by physical contact, it just stops one from frobbing it. An arrow or a bump will still push the button. I've worked around this problem in my mission by putting a RAT between the button and the device it is to turnon, with the othe link to the RAT being from the process that "unlocks" the button. I also had to get the button to send a TurnOff after having been pushed while "locked" to keep the RAT from firing immediately when the button is unlocked. Clumsy, but it works. Having StdButton recognize the Lock flag would be better.
R Soul on 18/8/2017 at 19:14
You could use NVRelayTrap, activated by FrobWorldEnd and sending its message down a ScriptParams link (or any other flavour except CD).
LarryG on 18/8/2017 at 21:01
But then you would also have to add in NVJointControl to activate the joint on FrobWorldEnd and NVimpleSchemaPlayerTrap to activate the button sound on FrobWorldEnd. And maybe a whole 'nother set of stuff if you want a "locked" sound when frobbed and locked ...
If you mean, leave StdButton on the object for the sound and joints, but don't hook the button up to anything via CD. I guess that would work too, but I would find it confusing, coming back to it 6 months later trying to figure out what was going on.
I solved my need for this, as I said above, using a RAT and and NVRelayTrap with a delay for the TurnOff. It works, and is self explanatory, but it is clunky. A general use StdButton that recognizes the Lock flag would be a whole lot cleaner. That's all.
R Soul on 18/8/2017 at 22:42
Quote Posted by LarryG
If you mean, leave StdButton on the object for the sound and joints, but don't hook the button up to anything via CD. I guess that would work too, but I would find it confusing, coming back to it 6 months later trying to figure out what was going on.
That was indeed my suggestion. Potential confusion in the future can be alleviated with the Editor Comments property. I also think your RAT solution is equally good.
LarryG on 19/8/2017 at 14:53
Here's another script request that has been bubbling in my brain for a few years: weighing scripts. One script to multiply the mass and gravity of things placed on a platform object and placing the resulting weight into a qvar. Similar to TrigPPlate script, but filling in a qvar also, and only optionally activating a joint. (There's a PressurePlateActive message which might be of use.) Then a simple qvar subtraction operation between two qvars (from different platform objects) could be used to set the joint tweqs of the scale object associated with the platforms.
Or something like that. I'm sure there are any number of ways to deal with this problem. Again, just a useful script idea to think about.
Daraan on 20/8/2017 at 19:36
Quote Posted by LarryG
Here's another script request that has been bubbling in my brain for a few years: weighing scripts. One script to multiply the mass and gravity of things placed on a platform object and placing the resulting weight into a qvar. Similar to TrigPPlate script, but filling in a qvar also, and only optionally activating a joint. (There's a PressurePlateActive message which might be of use.) Then a simple qvar subtraction operation between two qvars (from different platform objects) could be used to set the joint tweqs of the scale object associated with the platforms.
I haven't seen anything that tracks the current mass on a PressurePlate so you would have to do that manually by tracking Phys Messages and then especially when stacking items it gets ugly.
I think the only 'simple' workarround is in calculating the mass in a Room on top of the PressurePlate/Scale.
-------------------
Quote Posted by LarryG
Here is another enhancement request for a standard script, this time for StdButton. I would like a dStdButton which recognizes the Engine Features > Locked flag. My thought is that the button should only function when unlocked. When locked, it could be frobinert or make a locked sound when frobbed.
Should not be that hard. Interesting that they implemented locked levers but not Buttons.
And it's done -> 0.28a
Quote:
DStdButton (DRelayTrap)
DStdButton has all the StdButton features- even TrapControlFlags work. Once will lock the Object - as well as the DRelayTrap features, so basically this can save some script markers which only wait for a Button TurnOn
Additional:
If the button is locked the joint will not activate and the Schema specified by DStdButtonLockSound will be played, by default "noluck" the wrong lockpick sound.
Quote:
DAddScriptCan be used as Root -> D[Add/Remove]ScriptFunc
Adds the Script specified by DAddScriptScript to the objects specified by DAddScriptTarget, by default &ControlDevice.
Additionally it sets the DesignNote via DAddScriptDN.. If Script parameter is not set only the DesignNote is added/changed.
On TurnOff will clear the Script 4 slot.
NOTE:
• It will try to add the Script in Slot 4. It will check if its empty or in case if it's not if the Archetype has it, else you will get an error and should use a Metaproperty.
• It is possible to only change the DesignNote with this script and so change the behavior of other scripts BUT this only works for non-squirrel scripts!
• Using Capacitor or Count for will not work for newly added DScripts. As these are created and kept clean in the Editor.
Quote:
Changes•DHitScanTrap
Renamed Parameter!!!. There is the option that only special objects should trigger a TurnOn these not have to be specified by DHitScanTrapTriggers
before DHitScanTrapTarget.
•DGoMissing
More reliable
--> Kinda strange sometimes when you change a Property which is not present for example "Locked" it gets added automatically but for others you first have to add it and then change it.
Until now was undocumented:
Quote:
Squirrel AdditionsI know marked Scripts which can be used as a Root via extends ....
Their special functions and parameters can also be used if your script in named otherwise.
Most useful is the DRelayTrap with these two message sending functions:
Quote:
DSendMessage(Target, Message)Will send a single
Message to a single
Target and check if the
Message should be a Stim. If so it will stimulate the Target.
Quote:
DRelayMessages("On" or "Off", DesignNote)Will relay the Message
s in [ScriptName]T[On/Off] to the objects in [ScriptName][On/Off]TDest via DSendMessage.
EnYB0La on 26/12/2017 at 14:26
Hey Daraan, is your GitHub repository updated?
Daraan on 28/12/2017 at 12:21
Quote Posted by EnYB0La
Hey Daraan, is your GitHub repository updated?
hmmm
The documentation definitely not^^
I didn't do much on the normal script during the last months but I have a minor updated not released version.
@LarrySorry that I kinda ignored you(r request). It was a little hard to imagine how it should look like. Let's see if I got it right:
Base is the ModelByCount and there are multiple Objects A around.
Stack1->Model1
Stack2->Model2...
So now lets say you got 3 Stacks and Model3 and you drop one what shape should it have?
And the others revert back to 2?
What's coming next?SafeLever
--Makes an object FrobInert unis it's Tweq is complete. To prevent multiple TunOn/Offs by triggering the lever midway again. -> Potential to destroy certain setups.
TimetravelSave&LoadMaybe you have seen it in this (
http://www.ttlg.com/forums/showthread.php?t=148516&p=2379841&viewfull=1#post2379841) thread. It is possible to create data(simple true/false) which are save game independent so an action performed by a the player in the 'future' can affect old save games and vice versa. You can create a net of multiple layers of story telling, a little like Life Is Strange gameplay or a enable a complete new game after it has been finished once.
Editor ToolsThe major part of the update. Scripts which are designed to help you in the editor or with organizing.
DDumpModels (already included)
In short: Automatically creates all models in your /obj folder and if enabled takes also screenshots of them ->
Create your own small object library. See a few posts above for more info.
DAutoTxtRepl (beta available (
http://www.ttlg.com/forums/showthread.php?t=148485) here)
Automatically fills the texture replacement slots based on the (Shape->)Model and a provided database (or a manually chosen list or category).
For example you got a picture frame and 20 fitting replacement textures. At creation the script chooses one randomly so no more hassle by manually choosing them.
DImportObj&DAutoImportSimilar to dmls but with this script and a corresponding .css spreadsheat/.str file you can batch import&change objects in your hierarchy. Where the important part is the automatically creation of Archetypes.
This could become a new standard for model creation as you can provide the archetype, links and properties in an extra file instead of a long ReadMe. The user(or you) will load a .vbr, everything will be imported into the hierarchy and at wish also directly created for display.
This script is also already done just need to test if the Link creation works correctly.
At release I will also provide you with some import lists of my objects as well as CoSaS loot, keys and what you might like most Purgator's AIs. No slow one by one creation of archetypes anymore!
LarryG on 28/12/2017 at 13:29
Quote Posted by Daraan
@LarrySorry that I kinda ignored you(r request). It was a little hard to imagine how it should look like. Let's see if I got it right:
Base is the ModelByCount and there are multiple Objects A around.
Stack1->Model1
Stack2->Model2...
So now lets say you got 3 Stacks and Model3 and you drop one what shape should it have?
And the others revert back to 2?
A stack count of 1 always displays the 1st model (Model 0 in the Tweq > Models parameter)
If a 2nd model is defined, a stack count of 2 always displays the 2nd model (Model 1 in the Tweq > Models parameter), otherwise the highest model defined is displayed (which could be 6, with 3, 4 and 5 not defined).
If a 3rd model is defined, a stack count of 3 always displays the 3rd model, otherwise the highest model defined is displayed as above.
If a 4th model is defined, a stack count of 4 always displays the 4th model, otherwise the highest model defined is displayed as above.
And so on, up to the 6 possible models in the Tweq > Models parameter
A stack count of 7 or more displays the same model as a stack count of 6.
Does that make it clearer? Each object instance displays the model appropriate top its current stack count according to the Tweq > Models parameter. If that parm is not defined, then the model defined by Shape > Model name is used.
For example, if you have dice scattered about your mission, and pick up one, a single die is displayed. If you pick up a 2nd, inventory shows 2 dice. If you pick up a third, three dice. If you pick up 6 or more, a pile of dice is displayed. This all because you have 6 different models, one with just one die, one with two, and so on up to the pile of dice.
If you, the editor, place a die with a stack count of three, a three dice model is shown in the world.
Daraan on 1/1/2018 at 17:47
So just a prerelease version on GitHub (
https://github.com/Daraan/Dark-Squirrel-Scripts)
In my test everything seams to work but under harder conditions I don't know.
Quote:
Version 0.30aQuote:
DRelayTrapNew parameter DRelayTrapToQVar=QVarName
Saves the triggering object to the given QVar.
In 99% of all cases with NVScript or mine you get the triggering object and can use [source] to perform actions. In the rare case your setup does not allow it (or you want to simply safe an object) you can use this option to access the object via Target=$QVarName. This also allows some compatibility with the Scripts of other authors.
Quote:
SafeDeviceOn FrobWorldEnd adds M-FrobInert to the object and on TweqComplete removes it.
Basically designed for levers which can be double triggered and send 2xTurnOn without an TurnOff in between.
NOTE: Does not support any DScript features.
Quote:
DStackToQVarOn Contained, Create or Combine will save the current stacks of the object of the
same type held by the player to the QVar DStackToQVarVar
Not tested for arrows.
Quote:
DModelByCount extends DStackToQVar (does not set a QVar)
On Contained, Create or Combine and script reload. Will give the
item held by the player of this type the
Shape->Model Name based on the stack count and the Models specified in in
Tweq->Models whereby Model 0 represents a Stack of 1.
If an item is dropped it will get the Model 0 object. Objects not held by the player will also be updated on every script_reload based on their stack.