Jump to content

Using variable names as strings?


Fredas

Recommended Posts

Posted

Looking for ways to speed up some scripts.

 

Say I have variables: Frog01blah, Frog02blah, Frog03blah, etc.  They're not an array and there's nothing that can be done to change that.  But of course the systematic naming potentially allows the same kind of functionality.  Is there a way to access the variables as such?  Something like:

 

int Frogvalue = 2

Frogfinal = "Frog0"+FrogValue+"blah"

 

Obviously that wouldn't work but it should illustrate what I'm after here.

 

Posted

Papyrus isn't the language I'm most familiar with, but I'm about 99% sure you can't do that - and if you could, it'd involve some -very- creative workarounds, and a hell of a lot more work than merely copy-pasting variable names.

Posted

 

They're not an array and there's nothing that can be done to change that

Why? Are they from another mod?

 

An insightful guess.  In fact they're part of a mod that I'm modifying, and in the interest of transparency, I'm avoiding unneeded modifications.  Specifically they're a series of individual message and/or variable forms that just happen to be named in sequences as described above.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...