NPBruce / valkyrie

Valkyrie GM for Fantasy Flight Board Games
Apache License 2.0
506 stars 105 forks source link

Is there a way of executing all events in a list of next events? #633

Closed eorahil closed 6 years ago

eorahil commented 7 years ago

Is there a way of executing all events in a list of next events? Neither Random nor Ordered. I need an "all option"

Y have a father event and I want to excecute 3 child events A, B and C

but A cant be linked with B neither B with C because B are executed from other event and its not always chained with B and C. only this case.

I'm creating non linear map where starting point is a random spot and exploration can start from north to south and from south to north (or even east to west and west to east) so the tiles and sight tokens must be casted from various events, not only one...

NicolaZee commented 7 years ago

If you have a look at my scenario 'In the Dark' you will find examples of using Variable Triggers to call up Events that are not part of the chain of events.

For example, when testing I use an Event called [EventTestMode]

[EventTestMode] trigger=VarTestMode

[EventPlaceInvestigators] ... event1=EventPlaceRitualSiteTokens ... operations=@TestMode,=,0

By setting the trigger variable @TestMode to 1, the event [EventTestMode] is triggered and I can jump straight to the thing I want to test.

I, also, use trigger variables to work out the placement of sight tokens,

e.g. To work out if the Sight Token for going from the Porch Tile to the Shack Tile should be placed, I use the following to check if the Shack Tile is already visible.

[EventPlacePorchTile] ... operations=PorchVisible,=,1 @PorchToShack,=,1

[EventPorchToShack] display=false buttons=0 add=TokenPorchToShack trigger=VarPorchToShack operations=countPorchSights,+,1 conditions=ShackVisible,==,0

I hope some of this helps! : )

eorahil commented 7 years ago

Ok. so if I set a variable to 1, every event triggerd with this variable are activated. I will try, thanks

NicolaZee commented 6 years ago

To be more exact (and pedantic), if you set a trigger variable to 1, all events triggered with this variable are activated. : ) Trigger Variables start with an '@' symbol.

eorahil commented 6 years ago

The bug in #635 makes this not to work no?

NicolaZee commented 6 years ago

I've not tried out the multiple triggers - so I can't say. Trigger Variables can lead to odd effects - so I've used them only for very specific and limited circumstance.

I believe the bug #635 stops the text from the second event from being displayed but does not stop the two events from being triggered. Sometimes with Valkyrie the easiest way of finding out is trying it out! : )

eorahil commented 6 years ago

Ok, will try. thanks

NicolaZee commented 6 years ago

If you have a look at my scenario 'In the Dark' there is the following event [EventPlaceShackTile] buttons=1 event1=EventPlaceShackTileTokens add=TileShack remove=TokenPorchToShack TokenCellarToShack operations=ShackVisible,=,1 @ShackToCellar,=,1 @ShackToPorch,=,1

This gives an example of two trigger variables been set off at the same time and the two events (EventShackToCellar and EventShackToPorch) are run concurrently to determine if the corresponding sight tokens need to be placed.

I hope this helps.

NicolaZee commented 6 years ago

To download the scenario 'In the Dark' run Valkyrie and click the 'Start Scenario' button. Then click download. Then find the scenario 'In the Dark' from the list of scenarios. It has a picture of standing stones, Once downloaded the code can be viewed using the Scenario Editor from the Main Menu.

For the placement of sight tokens, I use a technique LordPyrex kindly taught me.

  1. Create Sight Tokens for all ways into the Tile and all ways out of the Tile. This means that each entrance\exit has two tokens - one on top of each other.
  2. When the tile is placed remove all the Sight Tokens for going in
  3. Then place all Sight Tokens for going out (to Tiles that have not yet been placed)

My enhancement of LordPyrex's technique is in regards to step 3 (placing Tokens for going out). I fire off trigger variables for events to place these Sight Tokens.

[EventPlaceShackTile] buttons=1 event1=EventPlaceShackTileTokens add=TileShack remove=TokenPorchToShack TokenCellarToShack operations=ShackVisible,=,1 @shacktocellar,=,1 @shacktoporch,=,1

The above code handles the placement of the Shack Tile. The two Sight Tokens for causing the placement of the tile are TokenPorchToShack and TokenCellarToShack. These two tokens are removed when the tile is placed. To determine if the Cellar and Porch Tiles are already visible, two trigger variables are fired off concurrently (and if the tile has not been placed already the corresponding Out Sight Token is placed).

eorahil commented 6 years ago

sorry, Wrote the comment and deleted after finding the scenario. Thanks a lot, it was really useful. I think I finished my exploration events.

NicolaZee commented 6 years ago

You may, also, find my test mode technique really useful. With a complex scenario the event chain becomes extremely long and complex and it will take many clicks to get to what you want to test. What is needed is a way of turning off a chain and jumping to the event to be tested - without modifying the existing (tested) chain and so potentially accidently adding another bug.

So that EventA -> EventB -> EventC -> EventD -> EventE Becomes (without without changing the event chain) EventA -> EventTestMode -> EventE This can be done using a trigger variable.

On the subject of the original issue (as you seem to be happy) can your issue be closed?

eorahil commented 6 years ago

thanks. Yes. You can close it, or should I?