I would like to be able to keep track of sector tags and whether they have already been acted upon.
As I described in this post, I want to trigger a monster trap. Well, actually SEVERAL traps. Therefore, I have several sets of bars flagged with different sector tags. I would like to be able to build, at runtime, a programmatic object (initially empty) that will hold the tag numbers and whether they have been triggered (basically a dynamic array or list). This should reduce the code and also allow flexibility of adding arbitrary additional traps of the same kind.
According to the docs, this is not possible with ACS so I came up with this rather clunky script:
Now, this works fine, but does mean that I need to add more test flags and case clauses if I add more cage traps - which is programmatically uuugleeee...
What I would like to do is conceptually something like this (pseudocode):
//PSEUDOCODE
obj _tracker ={};//or `arr _tracker = [];
script 3(int tag){//test if passed tag has already been actioned: if(!_tracker[tag]){//if not, set a property on the tracker that passed tag has now been actioned
_tracker[tag]=1;//or `_tracker.push({tag:1})` if an array-type object//the hardcoded cruft should now reduce to something like this:
floor_lowerbyvalue(tag,16,56);}}
Yes, I know that there is no concept of this data type for ACS, but I was wondering if I could spoof it somehow - by utilising a hidden line with setLineSpecial, CREATING map elements to use as variables, utilising a dummy actor somehow?
I'd love to hear any thoughts on this as I am sure that something like this is entirely possible. Thanks in advance.
Question
smeghammer
I would like to be able to keep track of sector tags and whether they have already been acted upon.
As I described in this post, I want to trigger a monster trap. Well, actually SEVERAL traps. Therefore, I have several sets of bars flagged with different sector tags. I would like to be able to build, at runtime, a programmatic object (initially empty) that will hold the tag numbers and whether they have been triggered (basically a dynamic array or list). This should reduce the code and also allow flexibility of adding arbitrary additional traps of the same kind.
According to the docs, this is not possible with ACS so I came up with this rather clunky script:
Now, this works fine, but does mean that I need to add more test flags and case clauses if I add more cage traps - which is programmatically uuugleeee...
What I would like to do is conceptually something like this (pseudocode):
Yes, I know that there is no concept of this data type for ACS, but I was wondering if I could spoof it somehow - by utilising a hidden line with setLineSpecial, CREATING map elements to use as variables, utilising a dummy actor somehow?
I'd love to hear any thoughts on this as I am sure that something like this is entirely possible. Thanks in advance.
Share this post
Link to post
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.