OK, I've been having some serious trigger troubles the last couple of days. I'm at the end of my tether, so I could really use some help here:
Here's the setup: I've got three abbeys (Leno, Bobbio, Nonantola, under the constants of "brother_towns"). The game starts off with the abbey hospices empty. In the course of the first day, there is a trigger which selects one abbey, places a pilgrim in the abbey hospice awaiting an escort. When you find her & agree to escort her, the abbey_pilgrims_active turns to 1, a "pt_abbey_pilgrims" (= abbey_pilgrims_id) is generated which you then escort to the destination.
The debate about the destination, the escorting, etc. is all done & works.
The problem I'm having is abbey selection to place the pilgrim in the hospice. I wrote up the following trigger text:
Now, this text does select the abbey and places the pilgrim there. The problem is it doesn't seem to deactivate after that. Instead, it continues selecting more abbeys and placing pilgrims. And, of course, if two pilgrims are placed in the same abbey, we get an assertion error.
Let me be clear: I only want one pilgrim in the game. I want the hospice she's at to be random to force the player to look for her. I want no more pilgrims created in the hospices until that first pilgrim is taken care of.
["pt_abbey_pilgrims" (=$abbey_pilgrims_id) is merely the spawned pilgrims once the escorting thing is agreed to, "$abbey_pilgrims_active" is the string once the escorting is activated. ]
My trouble seems to be that "$pilgrim_at_abbey" string doesn't seem to do its job. It should start off at 0, and once the first pilgrim is placed, click to 1 and prevent the addition of more pilgrims.
Methinks it's the first line that has the problem. The conditions are continuously evaluated as true even after a pilgrim is placed.
Can anybody help?
Here's the setup: I've got three abbeys (Leno, Bobbio, Nonantola, under the constants of "brother_towns"). The game starts off with the abbey hospices empty. In the course of the first day, there is a trigger which selects one abbey, places a pilgrim in the abbey hospice awaiting an escort. When you find her & agree to escort her, the abbey_pilgrims_active turns to 1, a "pt_abbey_pilgrims" (= abbey_pilgrims_id) is generated which you then escort to the destination.
The debate about the destination, the escorting, etc. is all done & works.
The problem I'm having is abbey selection to place the pilgrim in the hospice. I wrote up the following trigger text:
(0.5, 0, 0.0, [[store_num_parties_of_template, reg(2), "pt_abbey_pilgrims"], [lt,reg(2), 1],
[eq, "$pilgrim_at_abbey", 0],
[eq, "$abbey_pilgrims_active", 0]],
[[store_random,reg(5),num_brother_towns],
[val_add,reg(5),brother_towns_begin],
[assign, "$next_abbey", reg(5)]]),
(0.02, 0, 0.0, [[eq, "$next_abbey", "p_bobbio_abbey"],
[eq, "$pilgrim_at_abbey", 0]],
[[add_troop_to_site, "trp_bobbio_pilgrim", "scn_bobbio_hospice", 4],
[assign,"$pilgrim_at_abbey",1]
]),
(0.02, 0, 0.0, [[eq, "$next_abbey", "p_nonantola_abbey"],
[eq, "$pilgrim_at_abbey", 0]],
[[add_troop_to_site, "trp_nonantola_pilgrim", "scn_nonantola_hospice", 4],
[assign,"$pilgrim_at_abbey",1]
]),
(0.02, 0, 0.0, [[eq, "$next_abbey", "p_leno_abbey"],
[eq, "$pilgrim_at_abbey", 0]],
[[add_troop_to_site, "trp_leno_pilgrim", "scn_leno_hospice", 4],
[assign,"$pilgrim_at_abbey",1]
]),
Now, this text does select the abbey and places the pilgrim there. The problem is it doesn't seem to deactivate after that. Instead, it continues selecting more abbeys and placing pilgrims. And, of course, if two pilgrims are placed in the same abbey, we get an assertion error.
Let me be clear: I only want one pilgrim in the game. I want the hospice she's at to be random to force the player to look for her. I want no more pilgrims created in the hospices until that first pilgrim is taken care of.
["pt_abbey_pilgrims" (=$abbey_pilgrims_id) is merely the spawned pilgrims once the escorting thing is agreed to, "$abbey_pilgrims_active" is the string once the escorting is activated. ]
My trouble seems to be that "$pilgrim_at_abbey" string doesn't seem to do its job. It should start off at 0, and once the first pilgrim is placed, click to 1 and prevent the addition of more pilgrims.
Methinks it's the first line that has the problem. The conditions are continuously evaluated as true even after a pilgrim is placed.
Can anybody help?