Hi, new to using VScript, but I have experience scripting with other game engines. In Unity, when attaching a script to a GameObject, we can assign values to various properties on the object. This way, we don't have to hardcode the values within the script, allowing us to re-use the script for several instances within the level, each with slightly different values. Is there an equivalent in Hammer, or a best practice for setting constants or references to objects for logic_script to access?
For some background, I am working on a surf map where the player must shoot multiple targets while surfing to have the end gate appear. In reality, the player just gets teleported to the same spot they are at in an identical room that has the end gate in it, making it seem as if the end gate appeared, example attached. I'd like to re-use this script for multiple rooms with a different number of targets, and a different offset the player needs to be moved to teleport. Ideally, I can configure these values in the Hammer editor.
My current workaround is to have a lookup table within my .nut script that houses the total number of targets required for each stage, as well as the offset needed to teleport into the identical room. The breakable objects then additionally send their stage ID within the function called so the script knows how many targets need to be shot and where to teleport to. While this works, it has the drawback that the script must be modified for each new level/stage, which makes it less friendly to share with other mappers. Is there an alternative for storing this data elsewhere that I am missing?