logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Word based Spellcasting System

 
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Lanthar D'Alton



Joined: 10 Feb 2005
Posts: 100

PostPosted: Sun Feb 27, 2005 8:44    Post subject: Word based Spellcasting System Reply with quote

So, some of you hopefully have downloaded my speech system alpha...
http://lanthar.dyndsl.com/downloads/lds_talus_speech_30a_win.rar
and a few of you hopefully have tried adding it to your own modules...
and maybe some of you have wondered about it enough to go through the scripts in the demo module... and you've hit some scripts that puzzle you... because they aren't used... lds_conv_spl_wrd, lds_parse_spells, lds_spell_caster, lds_spell_switch, and lds_spell_syls.

What are they, you may ask? They are the beginnings of something I made back when I first created the listener... the ultimate culmination of it's potential. They work too. It's a syllabic spell casting system. Pick the elements, powers, target type, name if needed, and put them into a string that sounds like the mumblings of a wizard, and poof.

i.e. AEEFEWYUNINI would have cast a spell using NInetyNIne mana at the nearest creature (YU), by combining the Creation method AE with the Elements of Fire and Water... (fire+water = acid elemental damage) and those syllables could be arranged in any order the caster wanted. Additional syllables allow choosing of target by saying part of their name, or a variety of other methods. Also there are syllables to allow specifying of the spell shape, and ah heck, here's the syllable list. Note that some things like mana stealing and such might not have been added yet.

Code:

//METHODS

const int METHOD_ANALYZE     =  11;  //AL
const int METHOD_BREAK       =  01;  //AB
const int METHOD_COMMUNICATE =  02;  //AC
const int METHOD_CONTROL     =  13;  //AN
const int METHOD_CREATE      =  04;  //AE
const int METHOD_DESTROY     =  03;  //AD
const int METHOD_MOVE        =  12;  //AM
const int METHOD_REPAIR      =  17;  //AR
const int METHOD_STRENGTHEN  =  18;  //AS
const int METHOD_TRANSFORM   =  19;  //AT
const int METHOD_WARD        =  22;  //AW
const int METHOD_WEAKEN      =  10;  //AK

//MANA SOURCE SKILLS

const int MANA_DRAWING       =  312; //MA
const int MANA_LENDING       =  323; //ML
const int MANA_READING       =  329; //MR
const int MANA_STEALING      =  320; //MI

//FORCES

const int FORCE_AIR          =  104; //EA
const int FORCE_ANIMAL       =  117; //EN
const int FORCE_BODY         =  105; //EB
const int FORCE_DIMENSION    =  107; //ED
const int FORCE_EARTH        =  108; //EE
const int FORCE_ELECTRICITY  =  106; //EC
const int FORCE_FIRE         =  109; //EF
const int FORCE_GRAVITY      =  110; //EG
const int FORCE_LIGHT        =  115; //EL
const int FORCE_MANA         =  116; //EM
const int FORCE_MIND         =  123; //ET //okay, I needed ei for eight.  sorry:)
const int FORCE_PLANT        =  119; //EP
const int FORCE_SOUND        =  118; //EO
const int FORCE_SPIRIT       =  122; //ES
const int FORCE_WATER        =  126; //EW

//POWER SOURCES
//Uses the letter U for "U"se
const int POWER_PERSONAL     =  535; //UP
const int POWER_FAITH        =  525; //UF
const int POWER_ITEM         =  528; //UI
const int POWER_VICTIM       =  541; //UV
const int POWER_AMBIENT      =  520; //UA
const int POWER_NODE         =  533; //UN
const int POWER_LEY_LINE     =  531; //UL

const int LDS_NUMBER_ZERO    =  654; //ZE
const int LDS_NUMBER_ONE     =  377; //ON
const int LDS_NUMBER_TWO     =  508; //TO
const int LDS_NUMBER_THREE   =  501; //TH
const int LDS_NUMBER_FOUR    =  144; //FO
const int LDS_NUMBER_FIVE    =  138; //FI
const int LDS_NUMBER_SIX     =  476; //SI
const int LDS_NUMBER_SEVEN   =  472; //SE
const int LDS_NUMBER_EIGHT   =  112; //EI
const int LDS_NUMBER_NINE    =  346; //NI

const int LDS_TARGET_SELF             =  316; //ME
const int LDS_TARGET_NEAREST          =  644; //YU
const int LDS_TARGET_WAND             =  591; //WT
const int LDS_TARGET_NEAREST_ENEMY    =  342; //NE
const int LDS_TARGET_STRONGEST_ENEMY  =  446; //RE
const int LDS_TARGET_WEAKEST_ENEMY    =  576; //WE
const int LDS_TARGET_NEAREST_FRIEND   =  343; //NF
const int LDS_TARGET_STRONGEST_FRIEND =  473; //SF
const int LDS_TARGET_WEAKEST_FRIEND   =  577; //WF
const int LDS_TARGET_AREA             =  494; //TA
const int LDS_TARGET_SHAPE            =  394; //PE
const int LDS_TARGET_NAME             =  338; //NA
const int LDS_TARGET_SPELL            =  512; //TS
const int LDS_TARGET_ENEMIES          =  498; //TE
const int LDS_TARGET_LAST             =  286; //LA
//MAY ADD MORE LATER TO FURTHER DRILL DOWN TARGET...

const int LDS_SPELL_TYPE_HARMFUL      =  475; //SH
const int LDS_SPELL_TYPE_BENEFICIAL   =  469; //SB
const int LDS_SPELL_TYPE_INFORMATION  =  481; //SN
const int LDS_SPELL_TYPE_CONJURATION  =  470; //SC
const int LDS_SPELL_TYPE_CREATION     =  485; //SR
const int LDS_SPELL_TYPE_DESTRUCTION  =  471; //SD
const int LDS_SPELL_TYPE_WARD         =  490; //SW
const int LDS_SPELL_TYPE_TRIGGER      =  487; //ST
const int LDS_SPELL_TYPE_ENCHANT      =  468; //SA
const int LDS_SPELL_TYPE_ONTHEFLY     =  482; //SO

const int LDS_SPELL_SHAPE_CIRCLE      =   60; //CI
const int LDS_SPELL_SHAPE_CONE        =   66; //CO
const int LDS_SPELL_SHAPE_DONUT       =   72; //CU
const int LDS_SPELL_SHAPE_RECTANGLE   =   52; //CA
const int LDS_SPELL_SHAPE_MISSILE     =   76; //CY
const int LDS_SPELL_SHAPE_BEAM        =   56; //CE

const int LDS_SPELL_DURATION          =   98; //DU


I left out the mana giving system... and the four or five spells I converted before being overwhelmed by having to convert a few hundred spells... but if anyone's interested...

Note the system is extremely efficient. It converts every 2 letter syllable to a base 26 multiplying integer (base 26 * base 26), and then evaluates which of the only possible two letter combos was spoken. The methods and elements are bitwise combined to create a value which (using only 27 of 32 possible bits) are then checked in a giant switch statement that has room for any possible spell. If no matches are found, there's an unfinished function that would have cast the spell entirely on the fly, combining effects and damage types based on the order of mana amounts and elements.

There was also a skill giving system for it... but I stripped that out of the mod because it added about 15 more scripts for a dialog. I could rework that to use the same scripts as my messages dialog...

Anyway, that's a basic summary. If anyone wants to follow this up let me know.

-Lanthar
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group