Advanced Tutorial: Solo Combat
To use a GPDL function to have a single PC combat when playing with a party of two or more.
- In Event placement mode, choose the cell for combat to occur in.
- From the Event Type menu, select "Who Tries". This allows the player to pick which party member participates in the combat.
- In order for this event to work the way that I want, which is to always result in a combat, I have checked the box for "Always Succeeds". I then selected "Chain Event" under the Successful Event box
- Click OK to move on to the next step.
- Since we have set the Who Tries event to always succeed, we are interested in the "Try Success Chain" to place our next event which will be a Logic Block event. (2) in the event chain
- The Logic Block event can seem daunting, but in our case it is quite simple to use, as we're only interested in using the "First Action" box in the lower lefthand of the dialogue.
Select the "Always" option from the three radial buttons. In the drop-down menu, select "GPDL Function" and in the box below that, click the button with the elipses (...).
- In the Script Editor that is now open, we will write our script that will allow the combat to proceed with only the selected party member.
- What we want this script to do is to examine each party member and determine if they were the one chosen, and if not to set their status to 'TempGone' so that they will not appear in the combat.
- Now we can add our combat to the "Normal Chain" underneath our Logic Block event. (3) in the event chain.
These are the settings I used to create a combat versus one goblin.
Click "OK" twice to get back to the event chain. - After the party member successfully defeats the goblin, we need to bring the rest of the party members so they can congratulate him. To accomplish this feat, we will add another Logic Block in the "Normal Event Chain" for the Combat event. This is (4) in the event chain.
As with the previous Logic Block event, we are only concerned with the "First Action" box. Again, choose "Always" from the radial buttons and "GPDL Function" from the dropdown menu. Click the elipses to open the Script Editor.
- In this script we want to reverse the actions of the previous script by returning all of the "TempGone" party members to "Okay", which will return them to the party.
$VAR party; $VAR active; $VAR stts; party = $PARTYSIZE(); active = $GET_PARTY_ACTIVECHAR(); $WHILE (party ># 0) { $IF ($GET_CHAR_STATUS(party -# 1) ==# 7) { stts = $GET_CHAR_ASL(party -# 1,"soloCmbt"); $SET_CHAR_STATUS(party -# 1), "0"); $DELETE_CHAR_ASL(party -# 1,"soloCmbt"); }; party = (party -# 1); };
Click "OK" to exit the Script Editor, and "OK" again to exit the Logic Block event. - Finally, I want to add on a Text Statement event to show the party congratulating the goblin slayer. Add the event as (5) in the event chain to the "Normal Chain Event" of the Logic Block event.
Click "OK" to close the event, and "Close" to exit the Event Editor.
Completed Event Chain
Click "OK" to exit the Script Editor, and "OK" again to exit the Logic Block event.$VAR party; $VAR active; $VAR stts; party = $PARTYSIZE(); active = $GET_PARTY_ACTIVECHAR(); $WHILE (party ># 0) { $IF ((party -# 1) != active) { stts = $GET_CHAR_STATUS(party -# 1); $SET_CHAR_ASL(party -# 1,"soloCmbt",stts); $SET_CHAR_STATUS(party -# 1), "7"); // 7 = TempGone }; party = (party -# 1); };