Author Topic: TUTORIAL: Solo Combat  (Read 117 times)

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9631
TUTORIAL: Solo Combat
« on: May 25, 2017, 01:56:17 PM »
Advanced Tutorial: Solo Combat

To use a GPDL function to have a single PC combat when playing with a party of two or more.

   1)   In Event placement mode, choose the cell for combat to occur in.

   2)   From the Event Type menu, select "Who Tries". This allows the player to pick which party member participates in the combat.

   3)   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
   4)   Click OK to move on to the next step.
   5)   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
   6)   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 (...).
   7)   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.

   8)   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.
Code: [Select]
$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);
};
   Click "OK" to exit the Script Editor, and "OK" again to exit the Logic Block event.
   9)   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.
   10)   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.
   11)   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.

Code: [Select]
$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.
   12)   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.

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3061
Re: TUTORIAL: Solo Combat
« Reply #1 on: May 25, 2017, 11:42:23 PM »
Very interesting. I will have to try it :) soon :)

Offline Uatu

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1036
    • World's Edge
Re: TUTORIAL: Solo Combat
« Reply #2 on: July 17, 2017, 05:19:41 AM »
Kind of similar, but would it be possible to have the party let only one person go around for a while, until he/she comes back to have everyone join again?  (For example, a thief climbing up a wall to walk around for a while, and then come back down to rejoin everyone else.)
More Dungeon Craft Art at my Web Page: http://dhost.info/uatu

Offline Dinonykos

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2213
    • Dinonykos Dungeon Craft
Re: TUTORIAL: Solo Combat
« Reply #3 on: July 17, 2017, 07:34:40 AM »
Kind of similar, but would it be possible to have the party let only one person go around for a while, until he/she comes back to have everyone join again?  (For example, a thief climbing up a wall to walk around for a while, and then come back down to rejoin everyone else.)

Manikus is the expert, but I guess this is quite different.
I assume this would be easy if you use a pre-generated party, because then you could easily use the NPC events (add/remove). But I guess it is more complicated for play-generated characters.
Find four contributions to the Pre-Generated Character Mini-Module Design Contest on my homepage.
New: THE AMBASSADOR'S LETTER, my contribution to the 7-day-challenge.
DINONYKOS DUNGEON CRAFT DESIGN HOMEPAGE

Offline Uatu

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1036
    • World's Edge
Re: TUTORIAL: Solo Combat
« Reply #4 on: July 17, 2017, 07:40:45 AM »
I was hoping to give thieves a bit more utility - for example, if they could use their climbing skill to go to places that others cannot (but of course the paladin in full plate armor should not be able to follow him).

Actually, I do not even know how to check if thief skills work though!  (Or backstabbing - I cannot get it to happen in combat, but maybe I do not know how to set it up correctly.)
More Dungeon Craft Art at my Web Page: http://dhost.info/uatu

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9631
Re: TUTORIAL: Solo Combat
« Reply #5 on: July 17, 2017, 02:15:27 PM »
The "solo combat" idea does carry over to other things. ;)
This tutorial was made possible via scripts, not the Combat event.
At some point, I had decided to do a biggish demo of "solo", particularly for training characters - thieves need to train in the local guild house, where only thieves are allowed. A fighter must train with weapons master (or beat him/her in single combat). Etc. You just write a script to see if the selected player is of a certain class and if they have enough points to reach the next level.
This is just as easy with play-created PCs as it is with pre-gen PCs.

To test thief skills, take a look at the Who Tries event. ;)

Offline Uatu

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1036
    • World's Edge
Re: TUTORIAL: Solo Combat
« Reply #6 on: July 18, 2017, 09:21:05 AM »
Hmmm - great, it is possible!  But I guess it is one step at a time...  (Time to learn how to do more simple things first, like thief skills or magic spells for events!)
More Dungeon Craft Art at my Web Page: http://dhost.info/uatu

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9631
Re: TUTORIAL: Solo Combat
« Reply #7 on: July 18, 2017, 01:14:47 PM »
If you find something that you ant to do, but aren't sure how, let me know. I can help and I have been after people for ideas for tutoials... :D

In case you need a reminder, here is the tutorial page from the help docs:
http://manikus.reonis.com/Help/DesignTutorials.html