home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1996 December / CD_shareware_12-96.iso / DOS / Comunic / RPGSPC09.ZIP / RSD.TXT < prev    next >
Encoding:
Text File  |  1996-07-26  |  62.5 KB  |  1,271 lines

  1. // Hexen RPG specs v1.0 -- NOT! This was the old opening.
  2. Hexen RPG specs v0.8 -- and this is the new one.
  3. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4. Table of Contents:
  5. ------------------
  6. 1.0 Introduction
  7.   1.1 Credits
  8. 2.0 The RPG
  9.   2.1 Basics
  10.     2.1.1 Experience
  11.     2.1.2 Gold
  12.     2.1.3 Stats
  13.     2.1.4 Spells
  14.     2.1.5 Levels
  15.     2.1.6 Advancement
  16.     2.1.7 Treasure...
  17.     2.1.8 Artifacts, etc.
  18.     2.1.9 Weapons
  19.   2.2 NPCs
  20.     2.2.1 Interaction
  21.     2.2.2 Merchants
  22.     2.2.3 Misc
  23. 3.0 Programmer's Corner
  24.   3.1 Architecture
  25.   3.2 The Adventure Introducer
  26.   3.3 Compression
  27.   3.4 API
  28.     3.4.1 API: Compression
  29.     3.4.2 API: Speech
  30.     3.4.3 API: Interaction
  31.     3.4.4 API: Experience & Gold givers
  32.     3.4.5 API: Stat testers
  33.     3.4.6 API: Misc
  34.   3.5 The Reserved Vars/Scripts
  35.   3.6 Misc
  36. 4.0 Programmers Perspective, or the How-Tos
  37.   4.1 Basics
  38.     4.1.1 Experience
  39.     4.1.2 Gold
  40.     4.1.3 Stats
  41.     4.1.4 Spells
  42.     4.1.5 Levels
  43.     4.1.6 Advancement
  44.     4.1.7 Treasure...
  45.     4.1.8 Artifacts, etc.
  46.     4.1.9 Weapons
  47.   3.2 NPCs
  48.     3.2.1 Interaction
  49.     3.2.2 Merchants
  50.     3.2.3 Misc
  51. 5.0 Closing Remarks
  52.  
  53. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  54. 1.0 - Introduction
  55. ------------------
  56.  
  57.    This package contains tools and standards that will allow willing WAD authors
  58. to build RPGs with merchants, NPCs, spells, gold, and experience! How would it
  59. feel to haggle with a merchant over the price of that Firestorm? Now you've
  60. actually got a REASON to kill that last monster. The awesome possibilities are
  61. limitless.
  62.  
  63.    The docs can be seperated into two sections: Player Docs and Programmer Docs.
  64.    The player docs include the following:
  65.          RPGSPC10.TXT: sections 1.0 and all of 2.0 - info on playing a Hexen RPG
  66.          README.TXT: all - info on the various utils included
  67.  
  68.    The Programmer Docs include the Player Docs and everything else. :)
  69.  
  70.    Note to programmers: Before you start working on ANY RPG WADs, READ THIS
  71.    DOCUMENT FROM BEGINNING TO END. I am not much of a spec writer, and although
  72.    I tried to include as much information in here as possible, it is not very
  73.    organized and if you, say, skip reading through the API you may miss some
  74.    important information.
  75.  
  76. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  77. 1.1 - Credits
  78. -------------
  79.    Mike Murtha - for introducing me to D&D (tm)
  80.    Mike Reichers - for helping me, umm... in general. Yeah! In general.
  81. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  82. 2.0 - The RPG
  83. -------------
  84.                                  \\Plotline//
  85.    The gods created your soul, but allow you a chance to choose what you want to
  86. be in your life, be it mage, warrior, or cleric. After you speak your choice,
  87. you are born.
  88.    Years later, you have shown much improvement. Some stats are naturally higher
  89. then others, and others are low due to lack of devotion. But that doesn't stop
  90. you from planning to improve them later... Your training is of the best, and you
  91. can use every single weapon made by your class, and of those not of your class
  92. you can scavage for ammo! Yes, life is good.
  93.    Until one day, the gods decide that you are ready to embark on your mission.
  94. You fall asleep, drunk in a tavern... but awaken in a strange land. You hear the
  95. gods whisper that if you prove yourself to them, they may give you their
  96. powers...
  97.                                 //End Plot\\
  98. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  99. 2.1 - Basics
  100. ------------
  101.    These are nine basic concepts that you should understand before playing a
  102. Hexen RPG.
  103. @@@@ 2.1.1 - Experience
  104.    Experience is a "score" given to you by the gods. For every monster you kill,
  105. every charector you save, every mission you complete, you get experience. You
  106. need experience to advance to greated levels of power. You can gain
  107. experience... or lose it!
  108.  
  109. @@@@ 2.1.2 - Gold
  110.    The mint of the day. You can get gold in almost any way imagionable and can
  111. by just about anything!
  112.  
  113. @@@@ 2.1.3 - Stats
  114.    This is a subject not to be taken lightly. You have several "stats" which
  115. make up your charector. Each class has its own "primary" and "secondary" stats.
  116. When your charector is made, each stat is generated by rolling four electronic
  117. dice and (with the additions of special rules) three of which are added to form
  118. a stat between 3 and 18. Primary (most important) stats get 1 added to them.
  119.      -INT- Intelligence - How smart you are. This stat is used extensively in
  120.            your search for secret doors. This is the most important stat for
  121.            mages.
  122.      -WIS- Wisdom - How wise you are. Your level of enlightenment. If you ever
  123.            pray to the gods, you will want plenty of this! This is the most
  124.            important stat for clerics.
  125.      -STR- Strength - Don't try to move large bolders without it! How strong
  126.            you are. For fighters THIS is the most important stat.
  127.      -DEX- Dexterity - Your hand-eye coordination, if you will. How well you can
  128.            keep balence, aim well, etc. This is the Mage's secondary stat.
  129.      -CON- Constitution - Stamina & ability to heal quickly. Fighter's 2nd stat.
  130.      -CHR- Charisma - How charming you are. With this, you can get better
  131.            prices, more support, etc. People tend to like you more. Mage's #2.
  132.  
  133. @@@@ 2.1.4 - Spells
  134.    With the exception of the Fletchett, this includes practically every artifact
  135. in Hexen. You automatically know all of the spells of your MAGIC level (see
  136. Levels). You can use any spell in your inventory. To put a spell into your
  137. inventory, you need to "rememorize" it. To do this, you need to rest for the
  138. night. At the penalty of not being able to heal (normally you would be healed to
  139. 100 life), you can choose to rememorize a spell. It then will become part of
  140. your inventory. You choose to rest for the night by stepping through the
  141. porthole. You choose to rememorize by stepping into the fire.
  142.    In general, in the Hexen RPG, an artifact is something that is loaded with
  143.    spells, and everything in your inventory that is not a puzzle item or
  144.    treasure is a spell.
  145.  
  146. @@@@ 2.1.5 - Levels
  147.    As you gain experience, you will gain more power in the form of "levels".
  148. See GIVAWAYS.ACS for the experience you need for each level.
  149.    There are two kinds of levels: Normal levels, and MAGIC levels. You start out
  150. at MAGIC level 1, Normal level 0.
  151.  
  152.      -Normal Levels- This is your rank, from 0 to IMMORTAL(21), on the ladder to
  153.                      power. The experience required increases exponantially with
  154.                      each level.
  155.      -Magic Levels-  This is your level when it comes to magic. Most spells
  156.                      require you to be at least a certain MAGIC level. See
  157.                      GIVAWAYS.ACS for the MAGIC level required by each spell.
  158.  
  159. @@@@ 2.1.6 - Advancement
  160.    As you gain levels, you also become more skilled. At LEAST every other level
  161. you can cast a new spell as your MAGIC level rises. For mages, this happens more
  162. quickly then for fighters and clerics.
  163.    Although with each level you become more powerful, your missions also become
  164. more difficult so that you can earn the experience you need for the next level.
  165.  
  166. @@@@ 2.1.7 - Treasure...
  167.    Treasure, for the most part, is in the form of gems (sometimes called
  168. "planets") You can sell gems almost anywhere that there is a merchant. Blue gems
  169. usually sell for 500gp (Gold Pieces), green for 1000gp, red for 2000gp, and big
  170. red gems (so valuable as to be deemed D'Speril's heart!) at 5000GP!!
  171.    Note: Before you get dreams about getting rich in the gem trade, remember
  172.          that even blue gems ARE VERY RARE AND USUALLY HIDDEN IN SECRET ROOMS!!!
  173.    Also, some gems are special enough to be set apart from the normal set...
  174.  
  175. @@@@ 2.1.8 - Artifacts, etc.
  176.    Artifacts have spells stored in them. Some artifacts have more charges* then
  177. others...
  178. * x charges equals the ability to cast x of the spell
  179.  
  180. @@@@ 2.1.9 - Weapons
  181.    One of the centers of the game. Fighters, mages & clerics each are only
  182. skilled in certain weapons. Although you can find weapons, it is often easier
  183. to buy them, with one exception: You can buy the most powerful weapon already
  184. assembled ONLY AT A VERY HIGH PRICE!!! Your only other option is to buy the
  185. first (and most common piece) at a VERY discount price, at one 60th of the cost
  186. of the pre-assembled weapon.
  187.    The Frost Shards, Arc of Death, and Firestorm can usually only be bought at
  188. a magic shop, while the Timon's Axe, Hammer of Retribution, and Serpant Staff
  189. can usually only be bought at a weapon shop.
  190. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  191. 2.1 - NPCs
  192. ----------
  193.    NPCs are a central part of a good RPG. They represent just about every
  194. monster in the game. Think of the monsters you kill, as evil monsters. Other
  195. monsters (you can tell them apart because they won't attack you) are neutral,
  196. and some are even good! Most monsters in the game are referred to as "NPC"s
  197.  
  198. @@@@ 3.2.1 - Interaction
  199.    If you want to talk to an NPC, walk right up to him/her and press the
  200. spacebar. You should then back up. The NPC often has an opening remark, such as
  201. "Hello", and then, one by one, several switches start to rise. As each switch
  202. rises the option it represents appears. After all of the switches have risen,
  203. --and its often a good idea to wait, although in theory you don't HAVE to wait
  204. before you choose--flip the switch that is the option you want. If you miss
  205. reading one of the options, you can usally assume that the last switch will
  206. end the conversation.
  207.    NOTE: You MUST end a conversation before starting a new one.
  208.  
  209. @@@@ 3.2.2 - Merchants
  210.    Merchants are the shopkeepers who will sell you things. Not all merchants
  211. will sell you their product in the same way, but what you need to do to buy is
  212. usually intuitive. Often, you can even haggle over a price!
  213.    You interact with merchants just as you do with other NPCs.
  214.  
  215. @@@@ 3.2.3 - Misc
  216.    NPCs represent the "good, bad, and the ugly". They can talk to you, you can
  217. talk to them. Remember: That skeleton on the floor might not just be some dead
  218. remnants...
  219. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  220. 3.0 - The Programmer's Corner
  221. -----------------------------
  222.    For all of you WAD authors out there, this may seem like a lot of work, but
  223. I have taken the liberty of creating, authoring, and programming code to do
  224. nearly everything shown in the RPG section. For explanations as to each feature,
  225. see 4.0 - Programmer's Perspective.
  226.  
  227.    If you are going to take advantage of this code, then, before any of your
  228. code, include the following lines of code:
  229.  
  230.    #define X_MapID [insert map number here]
  231.    #include "rpglib.acs"
  232.  
  233.    RPGLIB.ACS already includes the COMMON.ACS file (included), so you should not
  234. include it a second time.
  235.  
  236. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  237. 3.1 - Architecture
  238. ------------------
  239.    A key feature of the RPG system is that the player can reuse his charector,
  240. and so a definate architecture exists so that the player can switch between
  241. WADs. First off, it is important to understand that Hexen only saves the level
  242. CLUSTER. Therefore, if the player was to load a game using a WAD with the exact
  243. same cluster thay the player started in, the player can, in essence, jump from
  244. WAD to WAD. Here is a diagram to illustrate how the system works:
  245.  /-----------------\          /------------------------\
  246.  |Charector Creator|________\ |RPG Base (swapout level)|<---------\
  247.  |  RPGCREAT.WAD   |        / |       RPGBASE.WAD      |          |
  248.  |cluster 1 -MAP01 |          |    cluster 8 -MAP60    |------\   |
  249.  \-----------------/          \------------------------/      |   |
  250.                                     |           / \           |   |
  251.                                     |            |            |   |
  252.                                    \ /           |            |   |
  253.                               / - - - - - - - - - - - - \     |   |
  254.                                   Adventure Introducer        |   |
  255.                               |       ????????.WAD      |     |   |
  256.                                     cluster 1 -MAP01          |   |
  257.                                _ _ _ _ _ _ _ _ _ _ _ _ _      |   |
  258.                                     |           / \           |   |
  259.                                     |            |            |   |
  260.                                    \ /           |            |   |
  261.                               /-------------------------\     |   |
  262.                               |       RPG Adventure     |<----/   |
  263.                               |       ????????.WAD      |         |
  264.                               |cluster 1/2 -MAP01/-MAP??|---------/
  265.                               \-------------------------/
  266.    Mentioned in the diagram is the existance of a "Adventure Introducer." This
  267. is an optional WAD that would be a form of "town" setting on which several
  268. adventures could be introduced (e.g. a new-comer in the Tavern could ask for
  269. your assistance.)
  270.    As the diagram shows, after the player has created his charector, he
  271. proceeds to the RPG Base area. In this area, the player can save the game,
  272. quit, load Hexen with RPGBASE.WAD and the RPG WAD that the player wishes to
  273. play through, and load his charector. He then steps through the porthole and
  274. proceeds to either the Adventure Introducer or the actual RPG Adventure first.
  275. No matter which of the two is chosen, the level must be in cluster 1, MAP01.
  276. If the player went to the Adventure Introducer, the Adventure Introducer then
  277. has the responsibility of introducing the plot to the adventurer and
  278. eventually taking the player to the actual RPG Adventure which may reside on
  279. any level.
  280.    A player can complete an adventure by three means: Completion (a.k.a.
  281. he succeeded), Exit (a.k.a. he gives up and leaves the adventure by walking
  282. out of it, etc.), or he is Thrown Out (needs no explanation). Either way, the
  283. player returns to the last WAD he came from. If he entered the RPG Adventure
  284. from an Adventure Introducer, then that is where he returns. If he entered
  285. from the RPG Base, then that is where he returns to. If the Adventure
  286. Introducer needs to be replaced with either a different version of itself, or
  287. a completely new "Introducer", then the player will return to the RPG Base
  288. and "swap out" the "Introducer" for a new one. Otherwise, the player can stay
  289. in the "Introducer" and "swap out" for another RPG Adventure compatable with
  290. it.
  291. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  292. 3.2 - The Adventure Introducer
  293. ------------------------------
  294.    Lets say that you are creating a series of RPG WADs for Hexen that are
  295. based on a single, definate town setting that does not need to be changed from
  296. RPG WAD to RPG WAD. You can use it as an Adventure Introducer.
  297.    Picure this: You want your RPGs to be based on a series of quests all based
  298. on a town. You can create a seperate WAD that is ONLY THE TOWN. Then, when in
  299. the docs to your add-ons to the town, you can tell the player what to do in
  300. the town to start the adventure. Maybe the player needs to talk to a guy in
  301. the Taven that has a quest for him. In fact, you can base several adventures
  302. on a town, and then continuously update and change the town (through use of
  303. world vars) until the player "completes" the town! And the best part is that
  304. the player would never have to leave the town and return to the RPG Base! THIS
  305. is the purpose of an Adventure Introducer.
  306. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  307. 3.3 - Compression
  308. -----------------
  309.    Hexen has many, many limits on scripts, levels, variables, etc. Even more
  310. are placed on the RPG WAD author by the RPG spec. For information on these
  311. limits, see 3.5 - Reservations.
  312.    Hexen has a limit of 64 world vars, 32 map vars, and only 3 parmater vars
  313. per script. The worst part is that at not only are all variables 31bit (the
  314. 32nd tells whether the number is negative), but scripters RARELY use all 31
  315. bits! However, with a small sacrifise on speed, I believe I have temporarily
  316. solved this problem by creating 6 compression routines. (For more information,
  317. see 3.4.1 - API: Compression) For example, I managed to compress all 6 stats
  318. (5 bits apiece for a range of 0-31) in a single world variable, easily saving
  319. five world variables for open use. In another case, I needed to fit four parms
  320. into a script call, so I was able to compress two into one. This breakes down
  321. several barriers to script writers. Why use 31 Map Vars for 31 flags?
  322. Why not just one and COMPRESS THEM!
  323.    There are only two major drawbacks.
  324.     A) There is a fairly minor sacrifice of speed.
  325.     B) Care must be taken so that two scripts won't accidentally call the
  326.        compression and decompressino scripts AT THE SAME TIME. This
  327.        involves padding your code with several scriptwaits.
  328. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  329. 3.3 - API
  330. ---------
  331.    IF YOU USE THE API, YOU MUST MUST MUST INCLUDE A 
  332.         #define X_MapID ## (where ## is the map number of the file)
  333. BEFORE YOUR
  334.         #include "rpglib.acs"
  335. STATEMENT. YOU DO NOT, REPEAT, DO NOT HAVE TO INCLUDE COMMONS.ACS!!!
  336.    That having been said, now to explain what the API is.
  337.    The API is a collection of about 20 scripts that are designed to make your
  338. RPG scripting life easier. Every script has a name which you can call instead
  339. of always calling the number. By "calling" I refer to the use of ACS_Execute
  340. and or scriptwait(), of course.
  341.    I have divided the scripts into six groups. Each script name either begins
  342. with a C_, for Call, or an I_, for Internal. In general, it is not a good idea
  343. to directly call the Internal scripts. Here is an example of a script
  344. definition...
  345.  
  346. -=- ACS_Execute(C_SampleCall(3), X_MapID, int sampleParm, int anotherParm, 0);
  347. -=-       C_Result <--- int garfaParm
  348. -=-                ---> int garfaReturn
  349. -=-
  350.  
  351. The C_Result variable is a map variable that has two uses. If the script
  352. requires a 4th parameter, it is placed in C_Result. If the script needs to
  353. return a result, the result is placed in C_Result.
  354.    In this case, sampleParm & anotherParm are the arguments you specify in
  355. ACS_Execute, 0 means that you don't need an argument there and should put 0 in
  356. its place, and X_MapID is the number of the map (it is recommended you use the 
  357. X_MapID define in all of your script calls to make your scripts more
  358. portable). C_SampleCall(3) refers to the script name (C_SampleCall) and the
  359. script number (3). For portability reasons (a.k.a. if I renumber the API
  360. calls), it is recommended that you use the NAME instead of the NUMBER. Also,
  361. if this script name began with an I_, as in I_Proccessor, it is reccomended
  362. that you NEVER CALL IT UNLESS YOU KNOWN WHAT YOU ARE DOING.
  363.    After the definition shown above, each of the declared variables is
  364. explained, as well as the function of the script. 
  365. Note: the variable following the <--- is the value you put INTO the C_Result
  366. variable before calling the script, and the variable following the ---> is the
  367. value that is returned in C_Result AFTER the script finishes. You should
  368. probably use a scriptwait() before reading the return value. Also, because the
  369. C_Result variable is often used by several scripts at one, you need to COPY
  370. ITS VALUE INTO ANOTHER VARIABLE IMMIDIATELY AFTER USE, LEST IT CHANGE!!!!!!!!
  371.  
  372. @@@@ 3.3.1 - API: Compression
  373.    There are six routines, shown from lowest-level to highest-level, that
  374. allow you to compress your variables and flags. (see 3.1 - Compression)
  375. Unfortunately, these only compress integers, not strings.
  376.  
  377. -=- ACS_Execute(C_EncodeBit(14), X_MapID, int var, int bitNum, int newBit);
  378. -=-       C_Result <--- 0
  379. -=-                ---> int newVar
  380. -=-
  381. .The C_EncodeBit script sets an individual bit of var to either 1 or 0.
  382. .
  383. .    -var-    The variable you wish to change.
  384. .    -bitNum- The number of the bit you wish to change.
  385. .    -newBit- The new bit, either 1 or 0, that you wish to change the old
  386. .         bit to
  387. .
  388. .    -newVar- The resulting variable with the changed bit.
  389. .
  390. .
  391. .
  392. -=- ACS_Execute(C_DecodeBit(15), X_MapID, int var, int bitNum, 0);
  393. -=-       C_Result <--- 0
  394. -=-                ---> int bit
  395. -=-
  396. .The C_DecodeBit returns the bit number bitNum in variable var.
  397. .
  398. .    -var-    The variable you wish to know the bit of.
  399. .    -bitNum- The number of the bit you wish to know.
  400. .
  401. .    -bit-    The bit that is returned, either 1 or 0.
  402. .
  403. .
  404. .
  405. -=- ACS_Execute(C_EncodeVar(12), X_MapID, int var, int bitCount, int varNum);
  406. -=-       C_Result <--- int newVar
  407. -=-                ---> 0
  408. -=-
  409. .The C_EncodeVar encodes that variable newVar into the variable var.
  410. .C_EncodeVar also needs to known how many bits each variable is in var (e.g.
  411. .in my stats_1 variable, each stat is 5 bits), which is specified in bitCount,
  412. .and the number of the place that variable will be encoded into (e.g. at 5
  413. .bits each, I managed to fit 6 vars into one. The first var is 1, 2nd 2, etc.)
  414. .
  415. .    -var-    The variable you want to compress newVar into.
  416. .    -bitNum- The number of the bits per compressed variable in var.
  417. .    -varNum- The number of the place in var, the first place being 1, that
  418. .         you want to encode newVar into.
  419. .    -newVar- The variable you want to encode into var.
  420. .
  421. .
  422. .
  423. -=- ACS_Execute(C_DecodeVar(13), X_MapID, int var, int bitCount, int varNum);
  424. -=-       C_Result <--- 0
  425. -=-                ---> int uVar
  426. -=-
  427. .C_DecodeVar retrieves the variable uVar from the variable var.
  428. .
  429. .    -var-    The variable you want to retrieve uVar from.
  430. .    -bitNum- The number of the bits per compressed variable in var.
  431. .    -varNum- The number of the place in var, the first place being 1, that
  432. .         you want to retrieve uVar from.
  433. .
  434. .    -uVar-   The variable that was retrieved from var.
  435. .
  436. .
  437. .
  438. -=- ACS_Execute(C_GetVar(16), X_MapID, int varNum, 0, 0);
  439. -=-       C_Result <--- 0
  440. -=-                ---> int uVar
  441. -=-
  442. .In order to make it easier to retrieve commonly used variables, I created the
  443. .C_GetVar script. The C_GetVar script will automatically retrieve the variable
  444. .as defined by varNum. (see RPGLIB.ACS for a list of the variable this script
  445. .can retrieve) Go ahead and add your own variables to the list.
  446. .
  447. .    -varNum-    The variable number you want to retrieve (see RPGLIB.ACS
  448.             for the list)
  449. .
  450. .    -uVar-   The variable that was retrieved.
  451. .
  452. .
  453. .
  454. -=- ACS_Execute(C_SetVar(17), X_MapID, int varNum, int newVar, 0);
  455. -=-       C_Result <--- 0
  456. -=-                ---> 0
  457. -=-
  458. .In order to make it easier to encode commonly used variables, I created the
  459. .C_SetVar script. The C_SetVar script will automatically encode the variable
  460. .defined by varNum. (see RPGLIB.ACS for a list of the variable this script can
  461. .retrieve) Go ahead and add your own variables to the list.
  462. .
  463. .    -varNum-    The variable number you want to encode (see RPGLIB.ACS for
  464. .            the list).
  465. .    -newVar-    The variable that you want to encode.
  466.  
  467. @@@@ 3.4.2 - API: Speech
  468.    There are three scripts that make it easier for you to have the charectors
  469. speak.
  470.  
  471. -=- ACS_Execute(C_Speech(7), X_MapID, int wait, 0, 0);
  472. -=-       C_Result <--- 0
  473. -=-                ---> 0
  474. -=-
  475. .Before running the C_Speech script, put the name of the charector into TalkC,
  476. .and what he/she says into TalkL. Lets say you want "Rinkydink" to say "oy!":
  477. .   TalkC = "Rinkydink";
  478. .   TalkL = "oy!";
  479. .   ACS_Execute(C_Speech, X_MapID,0,0,0); scriptwait(C_Speech);
  480. .And the output is - RINKYDINK: 'OY!' - in gold letters
  481. .This script allows you to have a charector say multiple lines of dialogue by
  482. .simply changing the TalkL variable and calling C_Speech. The script will wait
  483. .for wait ticks before terminatin. (If wait is 0, it waits 35 ticks)
  484. .Note: You might worry that the status display on the top of the screen will
  485. .      disrupt anything you write up there. WELL DON'T! C_Speech will auto-
  486. .      matically disable that display until it terminates.
  487. .
  488. .   -wait-      How long * 1/35 sec you want C_Speech to pause before
  489. .               terminating. (don't forget the scriptwait()!) If you put 0 as
  490. .               this parameter, it waits for two seconds.
  491. .
  492. .
  493. .
  494. -=- ACS_Execute(C_SpeechFromLineNum(8), X_MapID, int wait, int lineNum, 0);
  495. -=-       C_Result <--- 0
  496. -=-                ---> 0
  497. -=-
  498. .Yet another easy way to display multiple lines of dialogue. There are five
  499. .variables, TalkL_1 through TalkL_5, that basically act as a TalkL. Run this
  500. .script on each of the 5 lines, and you've got something like this:
  501. .  TalkC = "Rinkydink";
  502. .  TalkL_1 = "42 is"
  503. .  TalkL_2 = "the meaning"
  504. .  TalkL_3 = "of life,"
  505. .  TalkL_4 = "the universe,"
  506. .  TalkL_5 = "and everything."
  507. .  ACS_Execute(C_SpeechFromLineNum, X_MapID,1,0,0); scriptwait(8);
  508. .  ACS_Execute(C_SpeechFromLineNum, X_MapID,2,0,0); scriptwait(8);
  509. .  ...
  510. .You get the point.
  511. .In essense, C_SpeechFromLineNum simply runs C_Speech on the TalkL line you tell
  512. .it to display, so assume the same features listed in C_Speech apply to
  513. .C_SpeechFromLineNum.
  514. .
  515. .Note: If you run low on map vars, you can comment out some of the TalkL_x vars,
  516. .      but make sure you comment out the corrisponding code that refers to them!
  517. .      (Don't worry, you'll see.) Same goes for adding more TalkL_x vars.
  518. .      Remeber: This code is for YOUR benefit. Fine tine these little details
  519. .      as much as you want as long as you don't go against the RPG v1.0 spec!
  520. .
  521. .   -wait-      How long * 1/35 sec you want C_Speech to pause before
  522. .               terminating. (don't forget the scriptwait()!) If you put 0 in
  523. .               this parameter, it waits for two seconds.
  524. .   -lineNum-   The number of the TalkL that you want displayed.
  525. .
  526. .
  527. .
  528. -=-ACS_Execute(C_Dialogue(11), X_MapID, int wait, int lineStart, int lineCount);
  529. -=-       C_Result <--- 0
  530. -=-                ---> 0
  531. -=-
  532. .  TalkC = "Rinkydink";
  533. .  TalkL_1 = "42 is"
  534. .  TalkL_2 = "the meaning"
  535. .  TalkL_3 = "of life,"
  536. .  TalkL_4 = "the universe,"
  537. .  TalkL_5 = "and everything."
  538. .Remember this example from C_SpeechFromLineNum? Here is the TRUE power of the
  539. .speech API...
  540. .  ACS_Execute(C_Dialogue, X_MapID, 0, 1, 5);
  541. .There you go, all five lines displayed with only one line of code!
  542. .
  543. .Note: This script basically runs C_SpeechFromLineNum several times for you.
  544. .      Read the notes, features, benefits, etc. of C_SpeechFromLineNum before
  545. .      you use this script.
  546. .
  547. .   -wait-      How long * 1/35 sec you want to pause between each line.
  548. .               (don't forget the scriptwait()!) If you put 0 in this parameter, \
  549. .               it waits for two seconds.
  550. .   -lineStart- The first line number you want to display.
  551. .   -lineCount- The number of lines to display consecutively after line number
  552. .               lineStart.
  553. .
  554. .
  555. .
  556.  
  557.  
  558. @@@@ 3.4.2 - API: Interaction
  559.    Although there are only two script in here, they are some of the most useful
  560. script in the entire API! They automate the task of engaging in conversation.
  561. Because there is so much involved in this subject, I kept the API docs at the
  562. bare bone. For more information, see 3.2.1 - Interaction.
  563.  
  564. -=- ACS_Execute(C_MultiChoice(4), X_MapID, int ss, int es, int callscript);
  565. -=-       C_Result <--- 0
  566. -=-                ---> 0
  567. -=-
  568. .  When engaging in a conversation, have your charector make some opening
  569. .remarks, and then its the player's turn. This script will show the player his
  570. .options, and when the player makes his choice, will call a the script you gave
  571. .C_MultiChoice with the choice the player has chosen.
  572. .
  573. .   -ss-        The first switch in the chain of switches that are the player's
  574. .               choices.
  575. .   -es-        The last switch in the chain of switches that are the player's
  576. .               choices.
  577. .   -callscript-The script to call after the player has made his choice. The
  578. .               script should have only one argument: an integer. This is the
  579. .               number of the choice.
  580. .
  581. .
  582. .
  583. -=- ACS_Execute(I_Processor(5), X_MapID, int callscript, int D_s, int cs);
  584. -=-       C_Result <--- 0
  585. -=-                ---> 0
  586. -=-
  587. .  This script should NEVER be called directly unless you have a very, very good
  588. .reason to. Even then, reconsider.
  589. .  This script is called once the player has made his choice. It lowers the
  590. .switches, displays the choice, and calls the callscript.
  591. .
  592. .   -callscript-The script that needs to be called after processing is complete.
  593. .   -D_s-       A compressed variable. Bitsize: 15.
  594. .                      varNum = 1: ss
  595. .                      varNum = 2: es
  596. .   -ss-        This variable is the same variable that was given in
  597. .               C_MultiChoice, minus 1.
  598. .   -es-        This variable is the same variable given in C_MultiChoice.
  599. .
  600. .
  601. .
  602.  
  603. @@@@ 3.3.4 - API: Experience and Gold givers
  604.    These are several routines that automate the process of giving the player
  605. gold and experience, and some routines that automate buying and selling items in
  606. a merchant's shop.
  607.  
  608. -=- ACS_Execute(C_GiveExp(1), X_MapID, int exp, int sm, 0);
  609. -=-       C_Result <--- 0
  610. -=-                ---> 0
  611. -=-
  612. .  This script gives the player experience and prints a message to the screen
  613. .informing the player. This script can be used in your scripts for the added
  614. .benefit of displaying the message, or you can add it to your monster specials
  615. .to automatically give the player his experience.
  616. .
  617. .   -exp-       The amount of experience you want to give to the player.
  618. .   -sm-        Put 1 in here if you want to suppress displaying the message.
  619. .               Otherwise, put anything else in here.
  620. .
  621. .
  622. .
  623. -=- ACS_Execute(C_GiveGold(2), X_MapID, int gp, int sm, 0);
  624. -=-       C_Result <--- 0
  625. -=-                ---> 0
  626. -=-
  627. .  This script gives the player gold and prints a message to the screen
  628. .informing the player. This script can be used in your scripts for the added
  629. .benefit of displaying the message, or you can add it to your monster specials
  630. .to automatically give the player his gold.
  631. .
  632. .   -gp-        The amount of gold you want to give to the player.
  633. .   -sm-        Put 1 in here if you want to suppress displaying the message.
  634. .               Otherwise, put anything else in here.
  635. .
  636. .
  637. .
  638. -=- ACS_Execute(C_GiveBoth(3), X_MapID, int exp, int gp, int sm);
  639. -=-       C_Result <--- 0
  640. -=-                ---> 0
  641. -=-
  642. .  This script gives the player both gold and experience, and displays a message
  643. .to the screen informing the player. In essense, it just calls C_GiveExp and
  644. .C_GiveGold (in that order). READ THE DESCRIPTION OF SM CAREFULLY!
  645. .
  646. .   -gp-        The amount of gold you want to give to the player.
  647. .   -exp-       The amount of experience you want to give to the player.
  648. .   -sm-        Put 0 in here to show messages for both C_GiveExp and
  649. .               C_GiveGold (it will pause for 1 second between the messages).
  650. .               Put 1 in here to suppress ONLY the experience message.
  651. .               Put 2 in here to suppress ONLY the gold message.
  652. .               Put 3 in here to suppress both messages.
  653. .
  654. .
  655. .
  656. -=- ACS_Execute(C_BuyItem(21), X_MapID, int gpCost, int spawnSpot,
  657. -=-       C_Result <--- 0                                   int spawnThing);
  658. -=-                ---> 0
  659. -=-
  660. .  The script automates the processes of purchasing an item. It will
  661. .automatically check the player to see if he has enough gold to but it, and, if
  662. .so, will subtract that much gold from the player's total and "spawn" the item
  663. .spawnThing at spawnSpot, informing the player. Otherwise, it will tell the
  664. .player that he doesn't have enough money.
  665. .  This script can often be most useful in a merchants shop when the price is
  666. .set and you don't want the hassel of writing your own purchasing script.
  667. .
  668. .   -gpCost-    The price of the item the player wants to buy.
  669. .   -spawnSpot- The tid of the place where you want the purchased item spawned.
  670. .   -spawnThing-The thing number that the player bought. Look in HEXSPC09.DOC
  671. .               (included) and DEFS.ACS (also included) for the list of things
  672. .               you can spawn and their numbers.
  673. .
  674. .
  675. .
  676. -=- ACS_Execute(C_SellItem(22), X_MapID, int gpCost, 0, 0);
  677. -=-       C_Result <--- 0
  678. -=-                ---> 0
  679. -=-
  680. .  Unfortunately, the only things that can be sold are puzzle items & treasure.
  681. .All of the same, a Use_PuzzItem that points to this script will automate the
  682. .process of having the player sell something to the merchant. It adds the cost
  683. .of the item to the player's gold total, informing the player.
  684. .  This script can often be most useful in a merchants shop when the price is
  685. .set and you don't want the hassel of writing your own sell script.
  686. .
  687. .   -gpCost-    The price of the item the player sold.
  688. .
  689. .
  690. .
  691.  
  692. @@@@ 3.3.5 - API: Stat testers
  693.    In order to immerge the player in RPG experience, and to actually make the
  694. stats WORTH something :), these are routines that simulate the aspect of chance
  695. of the RPG. At the moment, there are only three routines. A dice throwing
  696. script, a stat testing script, and a script that handles secret doors.
  697.  
  698. -=- ACS_Execute(C_DiceRoll(10), X_MapID, int count, int sides, 0);
  699. -=-       C_Result <--- 0
  700. -=-                ---> int diceTotal
  701. -=-
  702. .  This script simulates throwing count dice, each having sides sides, numbered
  703. .1 through sides. It adds them together, and returns the total in diceTotal.
  704. .  Basically, this script runs count random(1, sides), and adds them together.
  705. .
  706. .   -count-     How many dice you want to throw.
  707. .   -sides-     The number of sides, numbered 1 through sides, on each of the
  708. .               dice.
  709. .
  710. .   -diceTotal- The sum of the dice.
  711. .
  712. .
  713. .
  714. -=- ACS_Execute(C_DiceRoll(9), X_MapID, int stat, int hilow, 0);
  715. -=-       C_Result <--- 0
  716. -=-                ---> int testResult
  717. -=-
  718. .  This script rolls one twenty sided die, and checks to see whether the result
  719. .is either higher or lower then the stat you tell it to check.
  720. .  This script lets you see if the player has enough strength, etc. to pass a
  721. .test, and so usually the player would want a roll lower then their stat.
  722. .
  723. .   -stat-      The stat you want to check. This should be one of the V_ defines
  724. .               (see C_GetVar)
  725. .   -hilow-     Either TEST_higher(1) if the player wants a higher roll, or
  726. .               TEST_lower(0, recommeded) if the player wants a lower roll.
  727. .
  728. .   -testResult-True, if the player passed the "stat check", false if he failed.
  729. .
  730. .
  731. .
  732. -=- ACS_Execute(C_SecretDoor(18), X_MapID, int lineID, 0, 0);
  733. -=-       C_Result <--- 0
  734. -=-                ---> 0
  735. -=-
  736. .  Most of you WAD authors out there are used to a different kind of secret
  737. .door. One which usually stands out from the rest of a wall and which merely
  738. .needs to be opened. However, in the Hexen RPG, there is a new kind of secret
  739. .door.
  740. .  Although the secret door should be fairly inconspicuous (pardon the spelling)
  741. .it can have something unusual about it that can be seen through CLOSE
  742. .EXAMINATION. Also, the secret door can't just be easily opened. The opening
  743. .requires a stat check. This routine automates all of this for you.
  744. .  First off, create a secret door as you normally would, with all of the
  745. .attributes of one WITH ONE EXCEPTION: instead of using a Door_ special, it
  746. .needs to have a Line_SetIdentification special, with the ID set to the same as
  747. .the tag of the sector. Also, an OPEN script in your map script file MUST have
  748. .the following line for every secret door in your WAD, substituting #lineID for
  749. .the ID and tag of each of your secret doors:
  750. .
  751. .ACS_Execute(C_InitSecretDoor,X_MapID,#lineID,0,0); scriptwait(C_InitSecretDoor)
  752. .
  753. .  From that point on the C_SecretDoor and C_Grunt (see 3.3.6 - API: Misc)
  754. .scripts will automate the secret door.
  755. .
  756. .  To a degree, this script is an internal script as in you should not call it
  757. .unless you known what you are doing. However, I decided that it better fit the
  758. .category of a call script because, in theory, you could put it to some other
  759. .use.
  760. .
  761. .   -lineID-    The ID of the line and sector of the secret door.
  762. .
  763. .
  764. .
  765. -=- ACS_Execute(C_InitSecretDoor(23), X_MapID, int lineID, 0, 0);
  766. -=-       C_Result <--- 0
  767. -=-                ---> 0
  768. -=-
  769. .  Most of you WAD authors out there are used to a different kind of secret
  770. .door. One which usually stands out from the rest of a wall and which merely
  771. .needs to be opened. However, in the Hexen RPG, there is a new kind of secret
  772. .door.
  773. .  Although the secret door should be fairly inconspicuous (pardon the spelling)
  774. .it can have something unusual about it that can be seen through CLOSE
  775. .EXAMINATION. Also, the secret door can't just be easily opened. The opening
  776. .requires a stat check. This routine automates all of this for you.
  777. .  First off, create a secret door as you normally would, with all of the
  778. .attributes of one WITH ONE EXCEPTION: instead of using a Door_ special, it
  779. .needs to have a Line_SetIdentification special, with the ID set to the same as
  780. .the tag of the sector. Also, an OPEN script in your map script file MUST have
  781. .the following line for every secret door in your WAD, substituting #lineID for
  782. .the ID and tag of each of your secret doors:
  783. .
  784. .ACS_Execute(C_InitSecretDoor,X_MapID,#lineID,0,0); scriptwait(C_InitSecretDoor)
  785. .
  786. .  From that point on the C_SecretDoor and C_Grunt (see 3.3.6 - API: Misc)
  787. .scripts will automate the secret door.
  788. .
  789. .  Note: The reason this script has nearly the exact same docs of the
  790. .        C_SecretDoor script is because I added it later and decided just to
  791. .        copy the docs, considering they weren't describing the script itself.
  792. .        IF YOU AREN'T PAY ATTENTION LISTEN UP AND READ THE FOLLOWING:
  793. .        In your OPEN script, running this script will set the special of the
  794. .        linedef of the secret door to call C_SecretDoor. When the player
  795. .        finds the secret door, C_SecretDoor changes the wall texture to that
  796. .        of a door and sets the linedef special to Door_Raise.
  797. .
  798. .   -lineID-    The ID of the line and sector of the secret door.
  799. .
  800. .
  801. .
  802.  
  803. @@@@ 3.3.6 - API: Misc
  804.    These are the routines which don't really fit into any catagory.
  805.  
  806. -=- ACS_Execute(C_Grunt(19), X_MapID,0,0,0);
  807. -=-       C_Result <--- 0
  808. -=-                ---> 0
  809. -=-
  810. .  This is a fun script to call. Each class in Hexen has its own grunt, and so
  811. .this script figures out which grunt to play, and plays it. In fact, it is
  812. .almost impossable to distinguish the C_Grunt from a real grunt! This script is
  813. .used when hiding things, such as secret doors.
  814. .
  815. .
  816. .
  817. -=- ACS_Execute(I_StatShowLoop(20),X_MapID,0,0,0);
  818. -=-       C_Result <--- 0
  819. -=-                ---> 0
  820. -=-
  821. .  Why anyone would need to call this script is beyond me, especially
  822. .considering that it is the only OPEN script (at the moment) in the API.
  823. .However, for those of you who want to know, this is what it does...
  824. .  As you play through a Hexen RPG, you will notice three messages flashing at
  825. .the top of the screen:
  826. .     ### EXP
  827. .     LEVEL ##
  828. .     ### GOLD
  829. .  These messages tell you, respectively, how much experience you have, what
  830. .level you are, and how much gold you have. Guess which script displays them?
  831. .Yup! This one. Also, this script keeps track of how long it has been from the
  832. .last time you slept for the night. After five minutes, you can sleep again.
  833. .
  834. .
  835. .
  836. -=- ACS_Execute(C_TellSpellType(6), X_MapID, int spellNum, int typeNum,
  837. -=-       C_Result <--- 0                                    int chargeCount);
  838. -=-                ---> 0
  839. -=-
  840. .  This script is meant to be placed on artifacts you put in your levels. It
  841. .tells the player what kind of object he has picked up and how many charges it
  842. .has. (see 4.1.3 - Spells) For a list of the numbers of the spells and spell
  843. .types, see the defines in RPGLIB.ACS
  844. .
  845. .   -spellNum-  The number of the spell the player has obtained.
  846. .   -typeNum-   The number of the type of the spell the player has obtained.
  847. .   -chargeCnt- The number of charges in the object the player picked up.
  848. .               (ignored if the spell type is 1 ("Scroll") or 4 ("Artifact"))
  849. .
  850. .
  851. .
  852.  
  853.  
  854. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  855. 3.5 - The Reserved Vars/Scripts
  856. ---------------------------------------------
  857.  
  858.    Before you read this section, take a deep breath.
  859.  
  860.    Ready? Ok, read on...
  861.  
  862. v1.0 - Scripts 1-50 are reserved for API and internal RPG use
  863.  
  864. v1.0 - A minimum of three map variables is required for rpglib,
  865.        a minimum of at least eight map vars is recommended if you are going to
  866.        use C_MultiChoice
  867.  
  868. v1.0 - All world vars EXCEPT for 48 through 64 are RESERVED for RPG and internal
  869.        use. Also, other world vars from 1-47 are availuable on request. At the
  870.        time of this spec, the following world vars are in service:
  871.  
  872.                    1         2         3
  873.           1234567890123456789012345678901
  874.        1:   gold                        | <gold>
  875.        2:   experience                  | <experience>
  876.        3: int |wis |str |chr |con |dex |@ <stats_1> @ = F_Talking
  877.        4:slpwt|lvl |clss|mlvl|0000000000@ <stats_2> @ = F_SleptYet
  878.  
  879.        There are three things you need to tell me when requesting a world var
  880.        between 1-47.
  881.             a) Why you need something so perminant (48-64 are for individual
  882.                  adventures and will change from adventure to adventure, 1-47
  883.                  are PERMINANT and will stick with the player's charector
  884.                  FOREVER)
  885.             b) What the benefit the RPG community will recieve from this.
  886.             c) The MINIMUM number of bits you need.
  887.  
  888.        Also, you will need to submit to me source code that will modify the
  889.        variable (don't worry, this is just for verification purposes).
  890.  
  891.        If you do not use your world var bits then you must face the possibility
  892.        of CONFISCATION. You also have the option of volintarily releasing your
  893.        reservation on the bits.
  894.  
  895. v1.0 - The following puzzle items have a specific name and cannot be renamed
  896.        or used for an entirely different purpose:
  897.          ZZ_GemGreen1 - Green Gem
  898.          ZZ_GemBlue1  - Blue Gem
  899.          ZZ_GemRed    - Red Gem
  900.          ZZ__BigGem, known as Korax's Heart - Big Red Gem
  901.  
  902.        You may do whatever you want with these AS GEMS*, but because the player
  903.        will carry tons of them around, you cannot, say, change their graphics
  904.        and use them for something else.
  905.  
  906.        Also, any OTHER puzzle items that the player manages to find in your
  907.        RPG WAD must be returned, other wise the player could pick up a clock
  908.        piece in one RPG WAD, swap out, and use it in another. This is not
  909.        always a good thing. Don't be afraid to use puzzle items, but proceed
  910.        at your own discretion.
  911.  
  912.        * in other words you can have the player need to find a gem and put it
  913.          into a maching, but you can't use the exact same puzzle item, change
  914.          the graphics, and then, say, have the player hunt for Barney's head
  915.          and sacrifise it to the gods, or something
  916.  
  917. v1.0 - Cluster 8 and MAPs 55-60 are reserved for RPGBASE.WAD use.
  918.  
  919.    I will not dwell on this subject any longer, but if I recieve, say, thousands
  920. of complaints from angry RPG WAD authors I may losen these restrictions.
  921.  
  922. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  923. 3.6 - Misc
  924. ----------
  925.  
  926.    Nothing here yet...
  927.  
  928. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  929. 4.0 - Programmers Perspective, or the How-Tos
  930. ---------------------------------------------
  931.  
  932.    This section is a fairly detailed description of how to do everything I
  933. mentioned in section 2.0 - The RPG.
  934.  
  935.    Everything quoted in here comes from the "Player Docs".
  936.  
  937. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  938. 4.1 - Basics
  939. ----------------
  940.  
  941. @@@@ 2.1.1 - Experience
  942.    Experience is a "score" given to the players. In order to be consistant from
  943. adventure to adventure, each monster has been assigned a certain amount of exp,
  944. and unless the monster was a good and/or maybe neutral NPC, the player should
  945. obtain that amount of experience.
  946.    The easiest way to do this is to set the monster's special to call the script
  947. C_GiveExp, or script 1, with the experience gained as the first argument.
  948. (see 3.4 - API)
  949.    Even when you are scripting you should call the C_GiveExp script for purposes
  950. of flexibility, and also because it has the added benefit of informing the
  951. player. However, if you must, you can also modify the experience variable
  952. directly. It is world var #2 and is even declared in the rpglib.acs file.
  953.  
  954. @@@@ 2.1.2 - Gold
  955.    Money. Need I say more? No, but might as well. :)
  956.    If you want the player to get both experience AND gold when he kills a
  957. monster, set the special of the monster to call the C_GiveBoth script.
  958. (see 3.4 - API). More will be discussed on what to DO with money later.
  959.  
  960. @@@@ 2.1.3 - Stats
  961.    These are the player's six stats. Lets review through them:
  962.  
  963.    "-INT- Intelligence - How smart you are. This stat is used extensively in
  964.           your search for secret doors. This is the most important stat for
  965.           mages."
  966.    "-WIS- Wisdom - How wise you are. Your level of enlightenment. If you ever
  967.           pray to the gods, you will want plenty of this! This is the most
  968.           important stat for clerics."
  969.    "-STR- Strength - Don't try to move large bolders without it! How strong
  970.           you are. For fighters THIS is the most important stat."
  971.    "-DEX- Dexterity - Your hand-eye coordination, if you will. How well you can
  972.           keep balence, aim well, etc. This is the Mage's secondary stat."
  973.    "-CON- Constitution - Stamina & ability to heal quickly. Fighter's 2nd stat."
  974.    "-CHR- Charisma - How charming you are. With this, you can get better
  975.           prices, more support, etc. People tend to like you more."
  976.  
  977.    In your RPG adventure, try to come up with some obsticles that involve the
  978. stats. For example, if there is a big rock blocking the entrance to a cave,
  979. have the player try to push it asside, but in order to move it even an inch he
  980. has to pass a "strength check". You should preform such a "stat check" by
  981. calling the script C_DiceTest, telling it you want to test the player's
  982. strength, and that the player must roll lower then his strength. C_DiceTest will
  983. roll a twenty sided die, and tell you if the player passed the test. If he
  984. succeeds, then he has moved aside the rock. Otherwise, he "grunts" (see C_Grunt)
  985. and fails. However, don't always retest the player for every inch he moves the
  986. rock. Such tedious work can get old VERY QUICKLY.
  987.  
  988. @@@@ 2.1.4 - Spells
  989.    "With the exception of the Fletchett, this includes practically every artifact
  990. in Hexen. You automatically know all of the spells of your MAGIC level (see
  991. Levels). You can use any spell in your inventory. To put a spell into your
  992. inventory, you need to "rememorize" it. To do this, you need to rest for the
  993. night. At the penalty of not being able to heal (normally you would be healed to
  994. 100 life), you can choose to rememorize a spell. It then will become part of
  995. your inventory. You choose to rest for the night by stepping through the
  996. porthole. You choose to rememorize by stepping into the fire.
  997.    In general, in the Hexen RPG, an artifact is something that is loaded with
  998.    spells, and everything in your inventory that is not a puzzle item or
  999.    treasure is a spell."
  1000.  
  1001.    Note: When I refer to artifacts, I refer to Hexen artifacts unless explicitly
  1002.          stated (usually through quotation marks) that I am not.
  1003.    To make the Hexen RPG more interesting, an attempt should be made to
  1004. differentiate between "scrolls", "staffs", "wands", and "artifacts".
  1005.    "Scrolls" are objects in which there is only one "charge", or spell use.
  1006. "Wands" are objects that contain more then one charge of a spell. To simulate
  1007. this, place several copies of an artiface in one place, so the player seems to
  1008. pick them all up at once. "Staffs" are just like "Wands", only more powerful.
  1009. "Artifacts" are to "Scrolls" as "Staffs" are to "Wands", in other words,
  1010. consider an "Artifact" to be a very power "Scroll" with only one charge. Also,
  1011. Fletchetts and Dark Servants are "Artifacts" only. Nothing else. BTW, by
  1012. "more powerful" I mean that the more powerful spells (you can tell them because
  1013. on my list of prices there is a considerable gap between weaker spells and
  1014. powerful spells) only exist in the form of "Artifacts" or "Staffs". Go ahead and
  1015. differentaite between the four findable spells at your discretion.
  1016.    In order to make the game... more interesting. I have included a script,
  1017. which you can use to tell the player what he has picked up and how many charges
  1018. it has. (see C_TellSpellType)
  1019.  
  1020.    Another aspect of spells is rememorization. At certain points along an
  1021. adventure, the player should be able to "rest for the night". As you know, I
  1022. have included an example WAD in this package. Simple, but demonstative. Copy
  1023. from it two rooms. One was a dark room with a porthole on one side and a flame
  1024. on the other. Stepping through the porthole takes the player into a room of
  1025. health vials and a porthole leading home. Stepping through the flame takes the
  1026. player into a room full of artifacts and switches. The artifacts are the spells
  1027. of the Hexen RPG. The switches, only raised in front of some of the artifacts,
  1028. represent the spells a player can rememorize. Using a switch lowers all of the
  1029. switches in the room, turns off the light in the room, and another flame
  1030. appears. Stepping through the flame returns the player to his "place of
  1031. departure" If you want, you can copy these rooms and paste it in your WAD. Make
  1032. sure you don't use any conflicting TIDs, tags, etc! 'course, this should be no
  1033. problem unless you use TIDs, etc over 200. If you "import" those rooms, then
  1034. you can use the undocumented C_NightRest script. Put a "bed" in a room, and
  1035. when the player walks onto the bed call the C_NightRest script with only one
  1036. argument: the TID of return. The script will handle the rest.
  1037.  
  1038. @@@@ 2.1.5 - Levels
  1039.    "As you gain experience, you will gain more power in the form of "levels".
  1040. See GIVAWAYS.ACS for the experience you need for each level.
  1041.    There are two kinds of levels: Normal levels, and MAGIC levels. You start out
  1042. at MAGIC level 1, Normal level 0.
  1043.  
  1044.      -Normal Levels- This is your rank, from 0 to IMMORTAL(21), on the ladder to
  1045.                      power. The experience required increases exponantially with
  1046.                      each level.
  1047.      -Magic Levels-  This is your level when it comes to magic. Most spells
  1048.                      require you to be at least a certain MAGIC level. See
  1049.                      GIVAWAYS.ACS for the MAGIC level required by each spell."
  1050.  
  1051.    Unless you are going to use the Magic Levels (which would be really awesome),
  1052. you do not need to worry about levels, although you could find a way to use them
  1053. to your advantage if you wanted...
  1054.  
  1055. @@@@ 2.1.6 - Advancement
  1056.    "As you gain levels, you also become more skilled. Every 4 levels you gain +1
  1057. to your primary and every 8 levels you gain +1 to your secondary.
  1058.    Although with each level you become more powerful, your missions also become
  1059. more difficult so that you can earn the experience you need for the next level."
  1060.  
  1061.    All I've got to say about advancement is that it only applies when you first
  1062. create the RPG WAD when you need to think out two things:
  1063.       1) What level the RPG WAD is designed for.
  1064.       2) How much progress the player can make in terms of experience & gold.
  1065.  
  1066. @@@@ 2.1.7 - Treasure...
  1067.    "Treasure, for the most part, is in the form of gems (sometimes called
  1068. "planets") You can sell gems almost anywhere that there is a merchant. Blue gems
  1069. usually sell for 500gp (Gold Pieces), green for 1000gp, red for 2000gp, and big
  1070. red gems (so valuable as to be deemed D'Speril's heart!) at 5000GP!!
  1071.    Note: Before you get dreams about getting rich in the gem trade, remember
  1072.          that even blue gems ARE VERY RARE AND USUALLY HIDDEN IN SECRET ROOMS!!!
  1073.    Also, some gems are special enough to be set apart from the normal set..."
  1074.  
  1075.    Again, not much to say. The above description is pretty self-explanitory.
  1076. As with the gold, I will go through here in more detail later. However, just
  1077. know that when I refer to gems, I refer to puzzle items: GemBlue1, GemGreen1,
  1078. GemRed, and Korax's Heart.
  1079.  
  1080. @@@@ 2.1.8 - Artifacts, etc.
  1081.  
  1082.    I just went through all of this in 2.1.3 - Spells.
  1083.  
  1084. @@@@ 2.1.9 - Weapons
  1085.    "One of the centers of the game. Fighters, mages & clerics each are only
  1086. skilled in certain weapons. Although you can find weapons, it is often easier
  1087. to buy them, with one exception: You can buy the most powerful weapon already
  1088. assembled ONLY AT A VERY HIGH PRICE!!! Your only other option is to buy the
  1089. first (and most common piece) at a VERY discount price, at one 60th of the cost
  1090. of the pre-assembled weapon.
  1091.    The Frost Shards, Arc of Death, and Firestorm can usually only be bought at
  1092. a magic shop, while the Timon's Axe, Hammer of Retribution, and Serpant Staff
  1093. can usually only be bought at a weapon shop."
  1094.  
  1095.    Read my lips. NO EASY TO GET WEAPONS. Weapons are supposed to be rare
  1096. luxuries, considerinh there are only four of them. IF, and I mean, IF, you
  1097. include any weapons in your adventure, unless it is designed for a level 20
  1098. player, MAKE THEM VERY, VERY, VERY hard to find. However, the one weapon which,
  1099. although the hardest to find, I ENCOURAGE having in your adventure is pieces of
  1100. #4. But again VERY VERY VERY ... VERY hard to find. Thank you, that will be all.
  1101. :)
  1102. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1103. 2.1 - NPCs
  1104. ----------
  1105.    "NPCs are a central part of a good RPG. They represent just about every
  1106. monster in the game. Think of the monsters you kill, as evil monsters. Other
  1107. monsters (you can tell them apart because they won't attack you) are neutral,
  1108. and some are even good!"
  1109.       NPCs... you can live with 'em, you can't live without them, so shut up
  1110. and learn how to make them. :)
  1111.  
  1112. @@@@ 3.2.1 - Interaction
  1113.    "If you want to talk to an NPC, walk right up to him/her and press the
  1114. spacebar. You should then back up. The NPC often has an opening remark, such as
  1115. "Hello", and then, one by one, several switches start to rise. As each switch
  1116. rises the option it represents appears. After all of the switches have risen,
  1117. --and its often a good idea to wait, although in theory you don't HAVE to wait
  1118. before you choose--flip the switch that is the option you want. If you miss
  1119. reading one of the options, you can usally assume that the last switch will
  1120. end the conversation.
  1121.    NOTE: Although I tried to be "flexible" in the entire thing, there is still
  1122.          a bug which should be corrected by the time you read this document, so
  1123.      nevermind. But although the system is pretty stable, PLEASE end a
  1124.      conversation before you try to open one with someone else. Failure to
  1125.      do so may result in TOTAL CHAOS. Thank you."
  1126.  
  1127.    And here comes the fun part. You need to design a series of charector that
  1128. the player will interact with throughout the game. The basic method of
  1129. interaction is simple, and here's how to set it up.
  1130.    1) Descide what "thing" your charector will be. (e.g. corpse,
  1131.           cleric boss, etc.), create it, and make it dormant.
  1132.    2) Draw two two-sided "boxes" around it.
  1133.    3) Set the inner one* to be an impassable, special: Line_SetIdentification,
  1134.       use type: impact or projectile cross (whichever works).
  1135.    4) Set the outer one to be special: Line_SetIdentification,
  1136.       use type: use (e.g. spacebar)
  1137.  
  1138.    Easiest things first. Decide what you want to happen when the NPC is punched.
  1139. In the OPEN script of your level, set the inner box* that you tagged to do
  1140. whatever it should do when the guy is punched. I reccomend that you write a
  1141. script to have the guy say "FOOL. YOU WILL DIE NOW!" or something like that^,
  1142. activate the NPC, and then turn off the impassable flag of the inner box. Then
  1143. clear the specials (e.g. set them to be "No Acton", or 0) of both boxes and let
  1144. the two fight it out. Its not a good idea, however, to give the player
  1145. experience if he kills the NPC, though.
  1146.  
  1147.    Ok, now the NPC will react if the player punches/shoots him, but now we need
  1148. to have the player be able to talk to him. Remember the outer box? In your OPEN
  1149. script you need to set it to run one of your scripts. In that script, the
  1150. charector will, say, make an opening remark or something. Then, and I'll discuss
  1151. this later, call C_MultiChoice to present the player with his options. The
  1152. player will choose one, and then the charector will do something and then its
  1153. the players turn again, and so forth. I'll leave it up to you to decide what
  1154. will happen.
  1155.  
  1156.    And now for one of the most useful scripts in RPGLIB.ACS: C_MultiChoice.
  1157. This is the way it works. VERY close to the NPC create a series of switches,
  1158. all lowered to the ground so the player doesn't even know that they are there.
  1159. Each switch should be about 32 wide, 32 tall, and 8 thick, its lower texture~
  1160. should be the mouth switch (only fitting, I say. (: ), its special should be
  1161. Line_SetIdentification, and its activation use. Also, you will need to tag
  1162. each of the switches (linedef & sector tag) consecutively, so that, say, switch
  1163. 31 will be on the farthest left, 32 to the right of it, 33 to the right of 32,
  1164. etc. Don't worry about setting the line special in your OPEN script though
  1165. THIS time.
  1166.    Now, this is what will happen when the player walks up to the guy and hits
  1167. spacebar. Your script, once run, will set EACH OF THE TalkL_# vars WITH AN
  1168. OPTION FOR THE PLAYER. Now lets say that you have four options, and therefor
  1169. AT LEAST four switches have been set up right next to each other and
  1170. consecutively numbered 31, 32, 33, and 34. Now, your script will call
  1171. C_MultiChoice with three arguments. The first one is the number of the first
  1172. switch in the series, which in this case is 31. The second argument is the
  1173. LAST switch in the series, which is 34. And the third argument is the number
  1174. of the script that will be called when the player has chosen. It will have only
  1175. one argument, the number of the choice, NOT THE SWITCH, but the choice of the
  1176. player. Switch 31 would be choice 1, switch 32 choice 2, etc.
  1177.    And this is what the player will see. He will see (providing you included it)
  1178. an opening remark, like "MERCHANT: 'HELLO'", and then, one by one, his options
  1179. will be shown on the screen indivually for about two seconds as the switch
  1180. representing that option rises. He will then choose an option, and all of the
  1181. switches will lower while his choice is displayed at the top of the screen.
  1182. After all of the switches have lowered, the script number that was specified
  1183. earlier to C_MultiChoice will be called and the number of the player's choice
  1184. given to it.
  1185.  
  1186.    This is how players and NPCs interact.
  1187.  
  1188.    Before moving on, there are some final points to make:
  1189.  
  1190.       *) You can ALWAYS assume that the player will end one conversation before
  1191.          starting another. Although it is, in theory, possible to allow the
  1192.          player to start a conversation with another NPC when he didn't end his
  1193.          old one, unless YOU SPECIFICALLY INTEND TO, SAY, HAVE A DIALOGUE
  1194.          BETWEEN TWO NPCs, it is too great a tax on resources to allow. The
  1195.          players have already been warned, it is their fault not yours.
  1196.       *) Be careful how many of the limited resources you use in NPCs. In other
  1197.          words, make them awesome, but 10 good NPCs are better then 2 awesome
  1198.          ones. Remember: There is always compression!
  1199.       *) The only thing that NPCs cannot do in Hexen is be made to move, walk,
  1200.          etc. in any way.
  1201.  
  1202. * when ever I refer to the "box", I refer to all four lines making up the box.
  1203. ^ once, I had the say, 1st: "OUCH", 2nd: "OUCH", 3rd: "STOP", 4th:
  1204.   "CUT IT OUT!", 5th: "THIS IS YOU LAST WARNING!", 6th: ten dark bishops appear,
  1205.   and the guy is only level 0 so he only has a fist, heh heh heh...
  1206. ~ I am referring to the side of the switch that the player will use, of course.
  1207.  
  1208. @@@@ 3.2.2 - Merchants
  1209.    "Merchants are the shopkeepers who will sell you things. Not all merchants
  1210. will sell you their product in the same way, but what you need to do to buy is
  1211. usually intuitive. Often, you can even haggle over a price!
  1212.    You interact with merchants just as you do with other NPCs."
  1213.  
  1214.    When it comes to merchants and shops, as long as, on average, the player will
  1215. spend the amount shown in GIVAWAYS.ACS on his goods, and as long as your method
  1216. is implicit and easy to use, you can have the player buy goods from the mercant
  1217. IN ANY MANNER YOU DEEM FIT. You can have the goods in showcases, you can have
  1218. them in slot machines, you can have the player buy them from the merchant
  1219. himself, etc. Your choice here.
  1220.  
  1221.    Now to talk a little about treasures and gold. All along the player's
  1222. adventure he has accumulated amounts of gold and maybe a gem. Merchants give the
  1223. players a change to spend their new found wealth. Also, merchant provide a way
  1224. for players to sell their gems, etc. However, there are DEFINATE PRICES for
  1225. things listed in GIVAWAYS.ACS. You can be a little low or a little high or have
  1226. limited time sales or haggling or whatever. Just don't go way off.
  1227.  
  1228.    If, say, you want a player to put his gems in a slot in the side of the wall,
  1229. you could set the wall special to Use_PuzzItem, and call my C_SellItem script.
  1230. If, say, you want a player to buy things by walking up to the showcase with the
  1231. item and pressing spacebar you can just have it call my C_BuyItem script. Easy!
  1232.  
  1233. @@@@ 3.2.3 - Misc
  1234.    "NPCs represent the "good, bad, and the ugly". They can talk to you, you can
  1235. talk to them. Remember: That skeleton on the floor might not just be some dead
  1236. remnants..."
  1237.  
  1238. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1239. 5.0 - Closing Remarks
  1240. ---------------------
  1241.  
  1242. Programmers, remember the following:
  1243.  
  1244.   *) Please do not go against the spec NO MATTER WHAT. The spec was created so
  1245.      that there would be a central standard. I am not a dictator, and I admit I
  1246.      probably made some mistakes and/or misjudgements. If you want something
  1247.      changed, e-me at cogmc@prodigy.com and we'll see from there.
  1248.  
  1249. Players, remember the following:
  1250.  
  1251.   *) Thou shalt not engage in more then one conversation at a time before saving
  1252.      the game lest thou create HAVOK! :)
  1253.  
  1254.  
  1255. My mail address is:
  1256.  
  1257. Gregory Crosswhite
  1258. 4022 Foreston Rd
  1259. Beltsville, MD 20705
  1260. USA
  1261.  
  1262. My e-mail address is: cogmc@prodigy.com
  1263.  
  1264.    I am anxious to hear you opinions, so please let me know what you think.
  1265. (Although "IT SUCKS!" will be accepted, it will hardly help anything. Please
  1266. include some constructive critisism.)
  1267.  
  1268.    Also, if you are interested in making an RPG WAD, please let me know your
  1269. name and e-mail address. If you make an RPG WAD, let me know so I can add it to
  1270. my list and/or throw in my two cents. Thanks.
  1271.