Hi all!
I'm excited to begin scripting in Armed Assault. With the new Join in Progress, and continuous server features, I feel like we're way less limited. I'm not very good at scripting, and I do have a few questions. I am very sorry if these have been asked before. I've found some information on some of these, but I just don't get it.
1. I am trying to add money to my game. I've been thinking about describing a private variable in an initialization script, say "Personalmoney", that I want to start out as 0. Each soldier runs the same script, call it soldierinit.sqs. Could I say
Private personalmoney = 0 ?
If I did, and made Personalmoney = 5 for player 1, and Personalmoney = 10 for player 2, would Arma see that as 2 seperate variables? If so, in a seperate script, say buycar.sqs, how would I make sure that if Player1 is executing buycar.sqs, it executes it with his personalmoney? [this] exec buycar.sqs? That's always been a bit confusing to me.
2. Dialogs are also a bit confusing. I'm using the wonderful, but bit archaic dialog maker: "OPERATION FLASHPOINT DIALOG MAKER". It works pretty well after changing font names. I'm just receiving a few errors with my working dialogs that I don't know how to avoid. Here is a copy of a dialog example from my description.ext file:
class BuyCar : RscButton
{
x = 0.35625
y = 0.24704
idc = -1
w = 0.2
h = 0.03004
style = ST_CENTER
colorBackground[] = {0, 0, 0, 0};
colorText[] = {0, 0, 0, 1};
font = "TahomaB"
SizeEX = 0.025
text = "Buy Car"
action = "[Car1] exec ""PurchaseCars.sqs""";
default = false
};
When running the overall dialog, I get the following error:
No entry: ....Buycar.colorDisabled
So I added:colorDisabled[] = {0.3, 0.3, 0.3, 1};
That gets rid of that error, but a bunch of other noentry errors come up:
No entry: ... Buycar.BackgroundActive
So I added: colorBackgroundActive[] = {0, 0, 0, 0};
... To make a long story short, these errors continued.. I am wondering if there is a way to let Arma use default values, or let it know that default values are okay.
3. With the persistent server, I wanted to make variables save themselves. Is this a server side thing? I wanted to use the new saveVar thing on the BIS wiki. For example.. Could I have "OnPlayerDisconnected........... saveVar Player PersonalMoney" or something? And then "OnPlayerconnected.... loadVar Player PersonalMoney"? I know it'd be quite more complicated than that, but I can try to find more about that out myself after learning if such a thing is even possible so that the server can save specific variables and recall them for specific/unique players.
If this scripting language is as powerful as I think it is.. We're in for a lot of really cool Arma maps in the upcoming years...