Legacy Local Variables and JS
Posted: Tue Nov 03, 2009 9:05 am
I am in the middle of writing an OXP when I hit a snag.
My OXP is an injection system for Visas and I will have Visas appear temporarily as equipment. My OXP does not provide the Visa itself but allows other OXPs to register them with my OXP and let my code do most of the work.
To do this I am wanting to support the adding of a piece of equipment based on the value a few of mission variables such as VisaName_in_possession, VisaName_Eligibility, VisaName_Availability, etc . Adding the appropriate conditions to the equipment for this would be no issue but this then means that every visa ends up creating many mission variables each. I thought this was inelegant so I wanted to compact all the many mission variables into one single mission variable for each visa and then uncompact them into local mission variables (they start "local_" under legacy scripting) and use the local mission variables in the equipment conditions. This where I hit the snag. There is a JS method called "missionVariables" to modify mission variables from but nothing to modify legacy local mission variables. (Lets be honest, the normal reason for using local mission variables is as plain local variables so for this purpose they are replaced by Javascript's inbuilt local variables)
Is there a way to do this or do I have to go back to using multiple mission variables each?
My OXP is an injection system for Visas and I will have Visas appear temporarily as equipment. My OXP does not provide the Visa itself but allows other OXPs to register them with my OXP and let my code do most of the work.
To do this I am wanting to support the adding of a piece of equipment based on the value a few of mission variables such as VisaName_in_possession, VisaName_Eligibility, VisaName_Availability, etc . Adding the appropriate conditions to the equipment for this would be no issue but this then means that every visa ends up creating many mission variables each. I thought this was inelegant so I wanted to compact all the many mission variables into one single mission variable for each visa and then uncompact them into local mission variables (they start "local_" under legacy scripting) and use the local mission variables in the equipment conditions. This where I hit the snag. There is a JS method called "missionVariables" to modify mission variables from but nothing to modify legacy local mission variables. (Lets be honest, the normal reason for using local mission variables is as plain local variables so for this purpose they are replaced by Javascript's inbuilt local variables)
Is there a way to do this or do I have to go back to using multiple mission variables each?