struct MyStruct
{
static const String MyConstantArrayOfStrings[] = //Requires initialization assignment.
{
"This is one string",
"This is another"
};
String MyLocalArrayOfStrings[4]; // No initialization assignment here. Must be when declared, not defined.
}
MyStruct holder;
holder.MyLocalArrayOfStrings[0] = "I'm setting the index of 0 to have this string!";
// Assemble the arrays only if we succeed. This first array
// contains the actor's hard names.
static const Class<Actor> KeyName[] =
{
"D4RedCard",
"D4YellowCard",
"D4BlueCard",
"D4RedSkull",
"D4YellowSkull",
"D4BlueSkull"
};
// Contains the nice names for logging.
static const String NiceKeyName[] =
{
"Red Card",
"Yellow Card",
"Blue Card",
"Red Skull",
"Yellow Skull",
"Blue Skull"
};
// In the event someone decides to screw with the keys, check the base class.
for (int index = 0; index < 6; index++)
{
if (mo.CheckClass(KeyName[index], DefPtr, true))
{
//Concatenate a string with .. (two periods)
A_Log(NiceKeyName[index].." Found");
break;
}
}
Kinsie wrote:If this feature is primarily aimed at people who know Real Big Boy Programming, wouldn't they just get better results from editing the engine source code to get what they want with less restrictions?
Kinsie wrote:So, what's the point of this whole endeavour, then? If this feature is primarily aimed at people who know Real Big Boy Programming, wouldn't they just get better results from editing the engine source code to get what they want with less restrictions?
Some information on the necessary basic concepts to get a loose grasp on ZScript - or some well-curated links to more professional guides to such concepts - will stop the same "WHATS A STRUCTS"-tier questions from being asked over, and over, and over again. Probably by me. Almost certainly by me.
Graf Zahl wrote:It all depends on what you want to achieve.
To do Decorate with less restrictions you should know how Decorate works, of course. You can do a lot of things without learning the fundamentals of programming
But if you want to access the full power, you will have to dig deeper. And this goes way beyond the scope of a language documentation. Read up on how C++ or Java documentation looks. They assume that the reader is familiar with the basic concepts of programming.
Graf Zahl wrote:Now, there's two choices here: Should the Wiki link to some external but well written resources or regurgitate all the info in a less concise manner because the people writing it are not professionals? There has been so much stuff written about the subject of programming that it's basically a waste of time to write up something inferior trying to convey the same information. But no matter how you twist it: If you expect this to work without putting in some learning effort you will fail.
I did a semester or so of Java and PHP in University. It taught me that I'm an abysmal programmer and should stay as far away from a compiler as possible.Graf Zahl wrote:But if you want to access the full power, you will have to dig deeper. And this goes way beyond the scope of a language documentation. Read up on how C++ or Java documentation looks. They assume that the reader is familiar with the basic concepts of programming.
Now, there's two choices here: Should the Wiki link to some external but well written resources or regurgitate all the info in a less concise manner because the people writing it are not professionals? There has been so much stuff written about the subject of programming that it's basically a waste of time to write up something inferior trying to convey the same information. But no matter how you twist it: If you expect this to work without putting in some learning effort you will fail.
Users browsing this forum: Martinoz and 5 guests