NathanKell
...
I've had an idea on how to redo the models choice for landenc (i.e. `tavern-hired`) officers.
{And NB this won't affect either quest officers, or the new `from-walker` officers (I changed walker dialog so the "enlist me please" dialog works and makes them a random officer, but with a bump up in skills as reward for their rarity)}.
That is, instead of doing a separate list of models and then in enc_officer_dialog a list of what types those models would be, we add officer types to the models in the Models[] array and then simply fill landenc init from that for all models which can be officers and on officer creation check available types.
I.e. instead of
1. List of models in models[]
2. List of model choices for le officers in landenc_init
3. List of the types those models can be in enc_officer_dialog
We would have:
1. Append to each `can-be`-officer model in Models[] what officers said model can be
2. fill lenc list from there
3. get type from there.
So the model definition would look like:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->makeref(model,Models[n]);
model.description = "A sailor's dress uniform, maybe a little old, with room for a big guy. And a `watch-cap`, please!";
model.model = "Fawn";
model.price = 250;
model.assigned = true;
model.officer.type0 = OFFIC_TYPE_BOATSWAIN;
model.officer.typesqty = 1;
n++;<!--c2--></div><!--ec2-->
And would be added to lenc officer case typesqty times (to preserve the `equal-chance`-`for-each`-type), and then in enc_officer_dialog, we'd get type from string attr = "type" + Rand(sti(Models[GetModelIndex(NPChar.model)].officer.typesqty)-1); NPChar.quest.officertype = Models[GetModelIndex(NPChar.model)].officer.(attr);
Whatcha think?
And eventually we should probably port the other stuff over into the models array too, so when you add a model you can just add a bit of code there and it'll be used elsewhere.
{And NB this won't affect either quest officers, or the new `from-walker` officers (I changed walker dialog so the "enlist me please" dialog works and makes them a random officer, but with a bump up in skills as reward for their rarity)}.
That is, instead of doing a separate list of models and then in enc_officer_dialog a list of what types those models would be, we add officer types to the models in the Models[] array and then simply fill landenc init from that for all models which can be officers and on officer creation check available types.
I.e. instead of
1. List of models in models[]
2. List of model choices for le officers in landenc_init
3. List of the types those models can be in enc_officer_dialog
We would have:
1. Append to each `can-be`-officer model in Models[] what officers said model can be
2. fill lenc list from there
3. get type from there.
So the model definition would look like:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->makeref(model,Models[n]);
model.description = "A sailor's dress uniform, maybe a little old, with room for a big guy. And a `watch-cap`, please!";
model.model = "Fawn";
model.price = 250;
model.assigned = true;
model.officer.type0 = OFFIC_TYPE_BOATSWAIN;
model.officer.typesqty = 1;
n++;<!--c2--></div><!--ec2-->
And would be added to lenc officer case typesqty times (to preserve the `equal-chance`-`for-each`-type), and then in enc_officer_dialog, we'd get type from string attr = "type" + Rand(sti(Models[GetModelIndex(NPChar.model)].officer.typesqty)-1); NPChar.quest.officertype = Models[GetModelIndex(NPChar.model)].officer.(attr);
Whatcha think?
And eventually we should probably port the other stuff over into the models array too, so when you add a model you can just add a bit of code there and it'll be used elsewhere.