Hello all again.
I'm trying to build somekind of SMS application for my game in which the main character will be able to read all the incomming messages other charaters may send to him.
To achieve this I have defined an struct in a script header in order to have two strigs, one with the sender, and another one with the text message.
Code: ags
Following the struct documentation in the following link https://www.adventuregamestudio.co.uk/manual/ags43.htm#struct
Following the recommendation I am trying to combine it with an array.
Code: ags
My intention is to call this array from any room. But I don't know where I need to place each part of the code, as I am receiving
My questions:
Thanks and regards.
I'm trying to build somekind of SMS application for my game in which the main character will be able to read all the incomming messages other charaters may send to him.
To achieve this I have defined an struct in a script header in order to have two strigs, one with the sender, and another one with the text message.
struct MsgPDA {
String Sender;
String Msg;
};
Following the struct documentation in the following link https://www.adventuregamestudio.co.uk/manual/ags43.htm#struct
Following the recommendation I am trying to combine it with an array.
MsgPDA msg[10];
msg[0].Sender = "Sara";
msg[0].Msg = "Hello, its me.";
My intention is to call this array from any room. But I don't know where I need to place each part of the code, as I am receiving
My questions:
- The struct I guess it goes in the header of the script. Is that right?
- Where I should place the array definition? If I enter in the body of the script it says that msg is unexpected.
- Do I need to do something else to call this array from any room?
Thanks and regards.