Author Topic: NWN Flag Constants - Fallen's Vampire Scripts - HELP? Adv Scripters preferably... (SOLVED)  (Read 366 times)

Legacy_LordValinar

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0


               Hey all, I'm trying to create an include file with the constants of new abilities. In Fallen's Vampire Scripts (for those not familiar, link is below of download) great scripts by the way but in the "f_vampire_spls_h" file the following has me confused::

//new constants for the epic abilities
const int FALLEN_VAMPIRE_EPIC_IMP_THRALL     = 0x00000001;
const int FALLEN_VAMPIRE_EPIC_UNH_THRALL     = 0x00000003;
const int FALLEN_VAMPIRE_EPIC_IMP_UNH_THRALL = 0x00000007;
const int FALLEN_VAMPIRE_EPIC_CHILDREN_NIGHT = 0x00000008;
const int FALLEN_VAMPIRE_EPIC_KIN_DAMNED     = 0x00000018;
const int FALLEN_VAMPIRE_EPIC_TWIN_ABYSS     = 0x00000038;
const int FALLEN_VAMPIRE_EPIC_SUNPROOF       = 0x00000040;
const int FALLEN_VAMPIRE_EPIC_BLOOD_OF_LAND  = 0x00000080;
const int FALLEN_VAMPIRE_EPIC_BLOOD_OF_LAND2 = 0x00000180;
const int FALLEN_VAMPIRE_EPIC_HOLY_VAMPIRE   = 0x00000200;
const int FALLEN_VAMPIRE_EPIC_LOOK_OF_HUNGER = 0x00000400;
const int FALLEN_VAMPIRE_EPIC_LOOK_OF_HUNGER2= 0x00000C00;
const int FALLEN_VAMPIRE_EPIC_REFUGE         = 0x00001000;
const int FALLEN_VAMPIRE_EPIC_TURNPROOF      = 0x00002000;

Now I assume these values are related to NWN's Flags? Or how do those work... (the 0x00000001- whatever) I'm confused about those. If those ARE referred to flags, does anyone know where I can get a compete list, because the NWN Lexicon doesn't contain most of those listed above.

EDIT (sorry) / Link: http://nwvault.ign.c...s.Detail&id=569
               
               

               


                     Modifié par LordValinar, 04 février 2012 - 08:07 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0


                These are values that you can use with bitwise operators.

Look up bitwise operators in teh NWN Lexicon.

I'll let someone else explain in depth as I don't have the time, but sonsider the following numbers (binary).

0001
0010
0100
1000

Those represent four bits each which can be turned on or off in a single integer.

All on
1111
All off
0000

Do not try to write 1000 binary as 1000 decimal. They are not the same number.
1111 is actually equal to a decimal int of 15.

For simplicity sake most represent these numbers as they are in the constants you posted. Those look like hex values to me. I'll let others explain more about that.
               
               

               
            

Legacy_LordValinar

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0


               Hmm, thanks for the boost of help, still unsure about some of them though like the one ending in C00. I understand little of binary code and don't see how/why letters come into play too :\\ I do appreciate the boost though, but if anyone else can explain in better detail, much appreciation is pre-given.
if(Help >= 1) { MyThanks = 1; }

... yeah I have no life '<img'>
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0


               Letters are used in hexadecimal - what I called hex - because its a base 16 system instead of the base 10 you are accustomed to.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0


               

LordValinar wrote...

Hey all, I'm trying to create an include file with the constants of new abilities. In Fallen's Vampire Scripts (for those not familiar, link is below of download) great scripts by the way but in the "f_vampire_spls_h" file the following has me confused::

//new constants for the epic abilities
const int FALLEN_VAMPIRE_EPIC_IMP_THRALL     = 0x00000001;
const int FALLEN_VAMPIRE_EPIC_UNH_THRALL     = 0x00000003;
const int FALLEN_VAMPIRE_EPIC_IMP_UNH_THRALL = 0x00000007;
const int FALLEN_VAMPIRE_EPIC_CHILDREN_NIGHT = 0x00000008;
const int FALLEN_VAMPIRE_EPIC_KIN_DAMNED     = 0x00000018;
const int FALLEN_VAMPIRE_EPIC_TWIN_ABYSS     = 0x00000038;
const int FALLEN_VAMPIRE_EPIC_SUNPROOF       = 0x00000040;
const int FALLEN_VAMPIRE_EPIC_BLOOD_OF_LAND  = 0x00000080;
const int FALLEN_VAMPIRE_EPIC_BLOOD_OF_LAND2 = 0x00000180;
const int FALLEN_VAMPIRE_EPIC_HOLY_VAMPIRE   = 0x00000200;
const int FALLEN_VAMPIRE_EPIC_LOOK_OF_HUNGER = 0x00000400;
const int FALLEN_VAMPIRE_EPIC_LOOK_OF_HUNGER2= 0x00000C00;
const int FALLEN_VAMPIRE_EPIC_REFUGE         = 0x00001000;
const int FALLEN_VAMPIRE_EPIC_TURNPROOF      = 0x00002000;

Now I assume these values are related to NWN's Flags? Or how do those work... (the 0x00000001- whatever) I'm confused about those. If those ARE referred to flags, does anyone know where I can get a compete list, because the NWN Lexicon doesn't contain most of those listed above.

EDIT (sorry) / Link: http://nwvault.ign.c...s.Detail&id=569


Some creatures are using multiple bits to show they are a special type of another creature.  So if you looked at the general type you would have returned all special types.  You can also look at a special type and not return a general type.

Here is a listing from general to specific (I am guessing at  the abbreviations)

Improved thrall -> unholy thrall -> improved unholy thrall
Children's knight -> kin damned -> twin abyss
Sunproof
Blood of land -> blood of land 2
Holy Vampire
Look of Hunger -> look of hunger 2
Refuge
Turnproof

The one's without special types might also be flags used in the system that could apply to any of the vampires.


EDIT: Didn't see at first that these were abilities not creatures.  So the epic fallen vampires would have 8 abilities as listed above with their upgraded versions as the special types.
               
               

               


                     Modifié par WhiZard, 01 février 2012 - 01:27 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0


               

LordValinar wrote...

Hmm, thanks for the boost of help, still unsure about some of them though like the one ending in C00. I understand little of binary code and don't see how/why letters come into play too : I do appreciate the boost though, but if anyone else can explain in better detail, much appreciation is pre-given.
if(Help >= 1) { MyThanks = 1; }

... yeah I have no life '<img'>


In a script when you type a number, It is really not a number  yet as far as the computer is concerned, It is just text.   It is the job of the compiler to convert that text into a number that the computer understands.   In order for it do do that it also needs a data type to convert it into.   Where NWscript is concerned it only understands two types of numbers,  Floats and integers.  When ever you type the number into a script the compiler will convert it into one of them two formats.   The format it converts it into is dependent on how you write the number.   There are three way to write the number.   One of them get converted into the floating point format for the float data type.  The way the compile recignizes then is that they contain a decimal point.  So: 
5.1
1.0 
0.1 
Will all be converted by the compiler into a float.   

Now there are two diffrent numbering systems tha can be used to enter a intenger into a script.   They of courcer are decimal and hex. 
Decimal number are just any string of characters (0-9) That do not have a decimal point in the number.  
Hex numbers are entered by starting the number with a prefix of 0x followed by a string of hex digits( 0 - F) 

You can read more about how the numbers are represented in  either Chapter Three Data Representation or  
A Tutorial on Data Representation - Integers, Floating-point numbers ...    
               
               

               
            

Legacy_LordValinar

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0


               @WhIzard: wow... that actually helped me 200% lol Thank you so much!
@Lightfood8 Thank you too '<img'>

You all helped me greatly today! Wish I could repay the favors some day. If you ever need scripts, lemme know '<img'> I'm trying to work on a World of Darkness system (vampires, werewolves, ghosts, etc etc) to a balanced degree. Mostly just a Just For Fun project, not really expecting it to become a server or anything. Just practice '^_^' Anyways thanks again guys

(Topic resolved)