Thanks guys, I was wondering too if there was a way to call functions from a struct, and this was exactly what I needed. Got it working now

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menudialogue dlg[49999]; //4 categories, 99 characters and 99 possible topic slots
int GetIndex(int action, Character *cha, int topic) {
return action*10000 + (cha.ID-1)*100 + topic;
}
int GetIndex(charID, int action, int topic) {
return charID.ID-1*100 + action*10 + topic;
}
//Dialog.ash:
struct dialogue {
String Text;
bool Enabled;
String Response;
};
import dialogue dlg[444];
import dialogue dlg[444]; //main dialogue
import dialogue GIRL[444];
import dialogue JOHN[444];
if (index == 100) { //option 1 column 1
player.Say("Something.");
dlg[index].Enabled = false;
}
//SetTxt excerpt:
if (column1word == "ASK") {
if (column2word == cGirl.Name) {
btn[9].txt = "FOR HER NAME.";
btn[10].txt = "WHAT SHE IS DOING HERE.";
btn[11].txt = "WHERE SHE IS FROM.";
btn[12].txt = "FOR DIRECTIONS";
}
int i = Button9.ID;
int charindex = 0; //sets starting point for character ID list
while (i < (Button9.ID + 4)) {
if (charindex < Game.CharacterCount) { //if the current index does not exceed the total number of characters
Character* cha; //create a dummy character to store the real character
cha.ID = charindex; //dummy character becomes real character when given an ID
if (cha.Room == player.Room) { //if the character is in the same room as the player
gDialog.Controls[i].AsButton.Text = cha.Name; //put character name on button
i++;
charindex++;
}
else charindex++; //check the next character for the SAME button
}
else {
gDialog.Controls[i].AsButton.Text = ""; //otherwise leave button blank
i++;
}
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.062 seconds with 14 queries.