Player Resource Consortium

 

Author Topic: Subrace field not recognized  (Read 20441 times)

0 Members and 3 Guests are viewing this topic.

September 30, 2009, 08:55:23 AM
Reply #15

Quote from: fluffyamoeba

The PRC racial constants are in prc_racial_const.nss in the include hak. You would just need to use GetRacialType() where you are currently using GetSubrace() and compare against the race constants instead of matching strings (the subrace is a string, the races are an integer than corresponds to the race's line in racialtypes.2da).


Yeah, kinda already covered that above.  I think he's having trouble actually finding the script that it's being called from.
HEATSTROKE


October 01, 2009, 07:54:30 PM
Reply #16

Quote from: fluffyamoeba

The PRC racial constants are in prc_racial_const.nss in the include hak. You would just need to use GetRacialType() where you are currently using GetSubrace() and compare against the race constants instead of matching strings (the subrace is a string, the races are an integer than corresponds to the race's line in racialtypes.2da).


It's a lot more complex than that.  The subrace system is from 2002 & horribly convoluted.  It's also got an old version of the HCR ruleset in there, & the module doesn't compile with the PRC compiler.  Probably going to be a lot more involved than we thought.
« Last Edit: October 01, 2009, 08:21:04 PM by DM Heatstroke »
HEATSTROKE


October 01, 2009, 10:11:50 PM
Reply #17

Ok, here are your problem scripts, unfortunately you still aren't going to have a stable module until you can get this thing to compile with the PRC compiler.

[size=16]drow_recog.nss[/size]

Code: [Select]
if (GetSubRace(GetPCSpeaker())=="Drow")
Should be

Code: [Select]
if (GetRacialType(GetPCSpeaker()) = 163 || 164)


[size=16]duergar_recog.nss[/size]

Code: [Select]
if (GetSubRace(GetPCSpeaker())=="Duergar")
Should be

Code: [Select]
if (GetRacialType(GetPCSpeaker()) = 153)

[size=16]entrance_port.nss & guardian_spawn.nss[/size]
(guardian_spawn.nss uses oRespawner instead of oTarget as the object, you'll have to change that manually)

Code: [Select]
string sRace=GetSubRace(oTarget);
Should be

Code: [Select]
int iRace = GetRacialType(oTarget);

And farther down
Code: [Select]
else
    if (sRace == "Drow")
    {
        ExploreAreaForPlayer(GetObjectByTag("UnderdarkCentral"),oTarget);
        AssignCommand(oTarget, JumpToLocation(GetLocation(GetObjectByTag ("drowstart"))));
    }
    else
    if (sRace == "Duergar")
    {
        ExploreAreaForPlayer(GetObjectByTag("LaduguerHalls"),oTarget);
        AssignCommand(oTarget, JumpToLocation(GetLocation(GetObjectByTag ("duergarstart"))));

Should  be

Code: [Select]
else
    if (iRace = 163 || 164)
    {
        ExploreAreaForPlayer(GetObjectByTag("UnderdarkCentral"),oTarget);
        AssignCommand(oTarget, JumpToLocation(GetLocation(GetObjectByTag ("drowstart"))));
    }
    else
    if (iRace = 153)
    {
        ExploreAreaForPlayer(GetObjectByTag("LaduguerHalls"),oTarget);
        AssignCommand(oTarget, JumpToLocation(GetLocation(GetObjectByTag ("duergarstart"))));



[size=16]hc_inc_subrace.nss[/size]
You're going to basically want to remark out this entire script.  This is the one that gives & destroys the subrace items & it will conflict with the creature hides & weapons that the PRC uses.

[size=16]hc_on_cl_enter.nss[/size]
Code: [Select]
//Setting custom factions
    if (GetSubRace(oPC)=="Drow")
     {
           AdjustReputation(oPC,GetObjectByTag("bad_boy"),100);
           if (!HasItem(oPC,"BondofH_NOD"))
               AdjustReputation(oPC,GetObjectByTag("good_boy"),-100);
    }

    if (GetSubRace(oPC)=="Duergar")
    {
           AdjustReputation(oPC,GetObjectByTag("duergar_faction"),100);
           if (!HasItem(oPC,"BondofH_NOD"))
               AdjustReputation(oPC,GetObjectByTag("good_boy"),-100);
    }

Should be

Code: [Select]
//Setting custom factions
    if (GetRacialType(oPC) = 163 || 164)
     {
           AdjustReputation(oPC,GetObjectByTag("bad_boy"),100);
           if (!HasItem(oPC,"BondofH_NOD"))
               AdjustReputation(oPC,GetObjectByTag("good_boy"),-100);
    }

    if (GetRacialType(oPC) = 153)
    {
           AdjustReputation(oPC,GetObjectByTag("duergar_faction"),100);
           if (!HasItem(oPC,"BondofH_NOD"))
               AdjustReputation(oPC,GetObjectByTag("good_boy"),-100);
    }


[size=16]hc_on_play_death.nss[/size]
(this script doesn't take Duergar into consideration, if that is an issue, the script above can give pointers on how it should work I think)

Code: [Select]
   if (GetSubRace(oPlayer)=="Drow")
            {
                AdjustReputation(oPlayer,GetObjectByTag("bad_boy"),100);
                if (!HasItem(oPlayer,"BondofH_NOD"))
                    AdjustReputation(oPlayer,GetObjectByTag("good_boy"),-100);
            }
            else
            {
                AdjustReputation(oPlayer,GetObjectByTag("good_boy"),100);
            }


Should be

Code: [Select]
   if (GetRacialType(oPlayer) = 163 || 164)
            {
                AdjustReputation(oPlayer,GetObjectByTag("bad_boy"),100);
                if (!HasItem(oPlayer,"BondofH_NOD"))
                    AdjustReputation(oPlayer,GetObjectByTag("good_boy"),-100);
            }
            else
            {
                AdjustReputation(oPlayer,GetObjectByTag("good_boy"),100);
            }


[size=16]hc_on_ply_respwn.nss[/size]

Code: [Select]
string sRace=GetSubRace(oRespawner);
Should be

Code: [Select]
int iRace = GetRacialType(oRespawner);
& a bit further down

Code: [Select]
if (sRace == "Drow")
                {
                    AssignCommand(oRespawner, JumpToLocation(GetLocation(GetObjectByTag ("drowstart"))));
                }
            else
            if (sRace == "Duergar")
                {
                    AssignCommand(oRespawner, JumpToLocation(GetLocation(GetObjectByTag ("duergarspawn"))));
                }
            else
                    AssignCommand(oRespawner, JumpToLocation(GetLocation(GetObjectByTag ("playerrespawn"))));

Should be

Code: [Select]
if (iRace = 163 || 164)
                {
                    AssignCommand(oRespawner, JumpToLocation(GetLocation(GetObjectByTag ("drowstart"))));
                }
            else
            if (iRace = 153)
                {
                    AssignCommand(oRespawner, JumpToLocation(GetLocation(GetObjectByTag ("duergarspawn"))));
                }
            else
                    AssignCommand(oRespawner, JumpToLocation(GetLocation(GetObjectByTag ("playerrespawn"))));


[size=16]rr_enter.nss[/size]

Code: [Select]
// Sets up subrace if legal one chosen
        if(use_pc_subrace())
            SendMessageToPC(oPC,"Your subrace of "+GetSubRace(oPC)+" has been enabled.");
            if (GetSubRace(oPC)=="Drow")
            {
                AdjustReputation(oPC,GetObjectByTag("bad_boy"),100);
                if (!HasItem(oPC,"BondofH_NOD"))
                    AdjustReputation(oPC,GetObjectByTag("good_boy"),-100);
            }

Should be

Code: [Select]
// Sets up subrace if legal one chosen
        if(use_pc_subrace())
            SendMessageToPC(oPC,"Your subrace of "+GetSubRace(oPC)+" has been enabled.");
            if (GetRacialType(oPC) = 163 || 164)
            {
                AdjustReputation(oPC,GetObjectByTag("bad_boy"),100);
                if (!HasItem(oPC,"BondofH_NOD"))
                    AdjustReputation(oPC,GetObjectByTag("good_boy"),-100);
            }


[size=16]whizbang_drow.nss[/size]

Code: [Select]
int StartingConditional()
{

    // Reject player races
    if(GetSubRace(GetPCSpeaker()) == "Drow")
        return TRUE;
    else
        return FALSE;

}

Should be

Code: [Select]
int StartingConditional()
{

    // Reject player races
    if(GetRacialTyep(GetPCSpeaker()) = 163 || 164)
        return TRUE;
    else
        return FALSE;

}


[size=16]sei_subraces.nss[/size]
(This one is kinda screwy, and won't compile under the PRC compiler.  Basically this is the script set (SEI) you're going to want to get rid of completely by the time your mod is done)

Code: [Select]
string sSubraceField = GetStringLowerCase( GetSubRace( a_oCharacter ) );
Should be

Code: [Select]

string sSubraceTemp =  Get2DAString("racialtypes", "Label", GetRacialType(a_oCharacter));
SetSubRace( a_oCharacter, sSubraceTemp );
string sSubraceField = GetStringLowerCase( GetSubRace( a_oCharacter ) );


Pick these apart guys.  I'm not 100% on the last one.  Haven't done many 2DA lookups.
« Last Edit: October 04, 2009, 12:36:03 AM by DM Heatstroke »
HEATSTROKE


October 01, 2009, 10:50:07 PM
Reply #18

I hate to say it, but you guys are going to have some pretty serious scripting hurdles getting this module to work properly with the PRC & I'm not just talking about the subrace stuff.
HEATSTROKE


October 02, 2009, 03:53:22 AM
Reply #19

Quote from: DM Heatstroke

I hate to say it, but you guys are going to have some pretty serious scripting hurdles getting this module to work properly with the PRC & I'm not just talking about the subrace stuff.


Thanks a lot for looking into this!
Surely seems like we have some work to do... But I think it's worth it so I have some work to do now.

Thank you both DM Heatstroke and Fluffy for your help. I really appreciate it.
I'll keep you posted when I make any progress.


October 02, 2009, 06:50:43 AM
Reply #20

Quote from: Badjaccur

Quote from: DM Heatstroke

I hate to say it, but you guys are going to have some pretty serious scripting hurdles getting this module to work properly with the PRC & I'm not just talking about the subrace stuff.


Thanks a lot for looking into this!
Surely seems like we have some work to do... But I think it's worth it so I have some work to do now.

Thank you both DM Heatstroke and Fluffy for your help. I really appreciate it.
I'll keep you posted when I make any progress.


You're welcome, but I am serious about the scripting.  Have you considered starting the mod over from area/creature ERFs or using another prefab that already has the PRC integrated into it like this version of Nordock?
« Last Edit: October 02, 2009, 06:58:19 AM by DM Heatstroke »
HEATSTROKE


October 02, 2009, 05:16:07 PM
Reply #21

First of all the good news: the dialog is gone now (for new toons), so our problem got fixed!
But there is also bad news: Every character that is made (so Drow, Duergar and Others) shows the same behavior:
[ulist=disc]When they hit the server guide they spawn in the Underdark
Get attacked by the drow
Spawn in Benzor Temple (spawning location for Others)[/ulist]
Trying the Plagued Nordock is something we thought about but we were not that happy with CEP (since it's a big download) and the crafting system they put in (CNR, since we like ATS better).

But looking at the trouble we have now it might be our best option... Especially when there's more scripting problems ahead, and I as a scripting n00b probably won't be able to maintain the mod anyway.

DM Heatstroke, thank you for taking the time to look at the mod, helping with the scripts and the good advice.


October 02, 2009, 07:34:51 PM
Reply #22

Quote from: Badjaccur

When they hit the server guide they spawn in the Underdark.


1.) Which area is the server guide?

2.) What ever you choose to do, let me make one suggestion, don't use encounters.  Get a nice spawn system like NESS or BESIE to spawn your creatures & placables in.  Saves a good bit of memory especially in large modules.

I prefer & can give you pointers for NESS.
« Last Edit: October 02, 2009, 07:44:08 PM by DM Heatstroke »
HEATSTROKE


October 03, 2009, 06:36:09 AM
Reply #23

Quote
DM Heatstroke Wrote:
1.) Which area is the server guide?

The Server Guide is a statue in The Gateway to Nordock, the first area players enter. It gives information and sends players to their starting area in Underdark Central (Drow), Duergar caverns (Duergar) or Benzor (rest of the races).
Quote
2.) What ever you choose to do, let me make one suggestion, don't use encounters.  Get a nice spawn system like NESS or BESIE to spawn your creatures & placables in.  Saves a good bit of memory especially in large modules.

I prefer & can give you pointers for NESS.

Thanks a lot for that one, sure will look into it. I can use *any* advice or hints with building this PW, and this seems like another good one.


October 03, 2009, 10:22:27 AM
Reply #24

In all the code I posted above replace the following:

153 with RACIAL_TYPE_DUERGAR

163 with RACIAL_TYPE_DROW_FEMALE

164 with RACIAL_TYPE_DROW_MALE

Sorry about that, been a long time since I messed with AR's starting area & I thought I did it the way I showed you originally.
HEATSTROKE


October 03, 2009, 03:45:08 PM
Reply #25

Quote from: DM Heatstroke

In all the code I posted above replace the following:

153 with RACIAL_TYPE_DUERGAR

163 with RACIAL_TYPE_DROW_FEMALE

164 with RACIAL_TYPE_DROW_MALE

Sorry about that, been a long time since I messed with AR's starting area & I thought I did it the way I showed you originally.


Hate to bug you again but I get the same behavior. All created characters get UD as starting point, chopped up by drow and spawn in Benzor.

Also the scripts don't compile, giving "ERROR: VARIABLE DEFINED WITHOUT TYPE" for every line where I changed the number with the race.
I can not use PRC's compiler since it will not compile the custom AI (Jasperre's AI). Aurora toolset gives compile errors but completes anyway and most stuff seems to work (i.e. it errors on ATS crafting system and AI but both work fine as far as I can tell) Any ideas?
« Last Edit: October 03, 2009, 03:56:39 PM by Badjaccur »


October 04, 2009, 12:28:11 AM
Reply #26

Quote from: Badjaccur

Quote from: DM Heatstroke

In all the code I posted above replace the following:

153 with RACIAL_TYPE_DUERGAR

163 with RACIAL_TYPE_DROW_FEMALE

164 with RACIAL_TYPE_DROW_MALE

Sorry about that, been a long time since I messed with AR's starting area & I thought I did it the way I showed you originally.


Hate to bug you again but I get the same behavior. All created characters get UD as starting point, chopped up by drow and spawn in Benzor.

Also the scripts don't compile, giving "ERROR: VARIABLE DEFINED WITHOUT TYPE" for every line where I changed the number with the race.
I can not use PRC's compiler since it will not compile the custom AI (Jasperre's AI). Aurora toolset gives compile errors but completes anyway and most stuff seems to work (i.e. it errors on ATS crafting system and AI but both work fine as far as I can tell) Any ideas?


Yeah, that is my screw up.  The numbers will work fine, you just have to use a single equal sign instead of a double equal sign in the functions above.  Single equal is for integers, double equal is for strings.  Using the 2DA numbers will keep you from having to define the constants or having to include the prc_racial_const file.  I edited my previous post to reflect that correction.

Also you'll  basically have to get rid of Jasperre's AI.  That & a few other things is why I'm rebuilding Athas Reborn from ERFs, one area  at a time.  I couldn't for the life of me get it to play nice with the PRC.  I've heard that it's possible to get TonyK's AI working with the PRC, but I didn't have any luck with it either.  If someone else has more insights into this, or a PRC compatible version of either one, for DEITY$ sake let me know.

Again, if you aren't compiling with the PRC compiler you're going to have issues.  

This is the batch file I use to do my compiling

Code: [Select]
pushd %CD%
C:\Games\NWN\utils\prc\nwnnsscomp -cg -i C:\Games\NWN\utils\prc\include %1
pause


In the above instance, the PRC includes are extracted to C:\Games\NWN\Utils\PRC\Include\ so the compiler has access to them.

If I was trying to make that version of Nordock play nice with the PRC, and didn't want to use Horred's PRC version, here is how I'd do it.

1.) Make a back up of the module

2.) Delete all of the scripts & systems that you either don't want to use or conflict with the PRC (JAI, HCR, Crafting) & save the module.  Make sure you set aside a copy of the module event scripts because you'll have to look at them again later.  May be good idea to dump all of the scripts to a folder somewhere in case you need to reference them later.

3.) Export every area & creature individually.  While you are doing so delete all the encounters & in the area's comments list any creature or NPCs that spawn in that area.  You can probably get away with exporting any custom items together in one shot.  Don't forget to grab any tag based item scripts as well.  You can leave any "racial" items out however, you won't be needing them anymore.

4.) Create a new module.  Run it thru the PRC hak installer. Save it.

5.) Install NESS into your new module as well as the HCR2 if you want to use it & if it is infact compatible with the PRC.  I think the PRC might have a good bit of it's functionality already in it however.  I also recommend Markshire's Nomenclature to keep your players guessing & FluffyA's PRC compatible Pwxfp Expericence scripts.

6.) Set your module variables.  Setup your new module event scripts using the old ones you set aside earlier for reference.

7.) Add your areas back in one at a time, setting up the spawn system & spawn waypoints as needed.  Set any area variables or scripts as needed as well.

8.) Add your quests back in.  This is basically a lot of copying & pasting from a text file since there is no easy way to export journal entries that I know of.  Not difficult, just tedious.

9.) Add your creatures & NPCs back in.  Reset any custom AI & variables & make sure you tie the PRC AI scripts in as well so your creature will use any passive PRC abilities you give them.

10.) Add your items back in.

7a, 8a, 9a & 10a.) Test, test, test!
« Last Edit: October 04, 2009, 01:20:59 AM by DM Heatstroke »
HEATSTROKE


October 04, 2009, 10:54:49 AM
Reply #27

Thanks for the pointers on compiling and spawning, I really appreciate it, including the time you spent in helping me out. I'll make sure I look into this as soon as this annoying race thing is fixed.

I have changed the race-strings into integers and made sure that only single equal signs were used. Sad thing is it didn't help. I still get the same behavior. "Human" and "Drow, female" characters spawn in UD with a faction that makes the Drow that live there attack both of them on sight. (With much success of course, both get slapped into the Fugue plane where the Statue sends them to... Benzor, home of the non-Drow and non-Duergar.

Weird thing is that when I put the single equal sign in drow_recog.nss
Code: [Select]
if (GetRacialType(GetPCSpeaker()) = 163 || 164) I get the following error when compiling: "ERROR:CANNOT ASSIGN A VALUE TO THE LEFT-SIDE OF THIS STATEMENT"
Double equal sign does compile. Same goes for duergar_recog.nss

hc_on_client_enter.nss does not compile and gives the following error:
sei_subraces.nss(740): ERROR: INVALID DECLARATION TYPE
Line 740 in sei_subraces.nss looks like this:  return nSubrace;

The same thing happens with hc_play_on_death.nss and hc_on_ply_respawn.nss

rr_enter.nss does not compile and gives the following error:
rr_enter.nss(250): ERROR: NO RIGHT BRACKET ON EXPRESSION
Line 250 in rr_enter.nss looks like this:  if(use_pc_subrace())

The same thing happens with wizbang_drow.nss

Man, this is a LOT harder than I expected.


October 04, 2009, 12:30:09 PM
Reply #28

Quote from: Badjaccur

Thanks for the pointers on compiling and spawning, I really appreciate it, including the time you spent in helping me out. I'll make sure I look into this as soon as this annoying race thing is fixed.

I have changed the race-strings into integers and made sure that only single equal signs were used. Sad thing is it didn't help. I still get the same behavior. "Human" and "Drow, female" characters spawn in UD with a faction that makes the Drow that live there attack both of them on sight. (With much success of course, both get slapped into the Fugue plane where the Statue sends them to... Benzor, home of the non-Drow and non-Duergar.

Weird thing is that when I put the single equal sign in drow_recog.nss
Code: [Select]
if (GetRacialType(GetPCSpeaker()) = 163 || 164) I get the following error when compiling: "ERROR:CANNOT ASSIGN A VALUE TO THE LEFT-SIDE OF THIS STATEMENT"
Double equal sign does compile. Same goes for duergar_recog.nss

hc_on_client_enter.nss does not compile and gives the following error:
sei_subraces.nss(740): ERROR: INVALID DECLARATION TYPE
Line 740 in sei_subraces.nss looks like this:  return nSubrace;

The same thing happens with hc_play_on_death.nss and hc_on_ply_respawn.nss

rr_enter.nss does not compile and gives the following error:
rr_enter.nss(250): ERROR: NO RIGHT BRACKET ON EXPRESSION
Line 250 in rr_enter.nss looks like this:  if(use_pc_subrace())

The same thing happens with wizbang_drow.nss

Man, this is a LOT harder than I expected.


These all compile for me:

[size=16]drow_recog.nss[/size]
Code: [Select]
int StartingConditional()
    {
        int nRace = GetRacialType(GetPCSpeaker());
        if (163 == nRace || 164 == nRace )
            return TRUE;
        return FALSE;
    }


[size=16]duergar_recog.nss[/size]
Code: [Select]
int StartingConditional()
    {
        int nRace = GetRacialType(GetPCSpeaker());
        if (153 == nRace)
            return TRUE;
        return FALSE;
    }


[size=16]rr_enter.nss @ line 246 [/size]
Code: [Select]
if(SUBRACESYSTEM)
    {

// Sets up subrace if legal one chosen
        if(use_pc_subrace())
            SendMessageToPC(oPC,"Your subrace of "+GetSubRace(oPC)+" has been enabled.");
            int iRace = GetRacialType(oPC);
            if (163 == iRace || 164 == iRace)
            {
                AdjustReputation(oPC,GetObjectByTag("bad_boy"),100);
                if (!HasItem(oPC,"BondofH_NOD"))
                    AdjustReputation(oPC,GetObjectByTag("good_boy"),-100);
            }

    }


[size=16]whizbang_drow.nss[/size]
Code: [Select]
int StartingConditional()
{

    // Reject player races
    int iRace = GetRacialType(GetPCSpeaker());
    if(163 == iRace || 164 == iRace)
        return TRUE;
    else
        return FALSE;

}


[size=16]entrance_port.nss[/size]
Code: [Select]

#include "nw_i0_tool"

void main()
{
    object oTarget=GetPCSpeaker();
    int iRace = GetRacialType(oTarget);

    if (HasItem(oTarget,"BlackHillsStone"))
    {
        ExploreAreaForPlayer(GetObjectByTag("BlackHills"),oTarget);
        AssignCommand(oTarget, JumpToLocation(GetLocation(GetObjectByTag ("blackhillsspawn"))));
    }
    else
    if (HasItem(oTarget,"brosnastone"))
    {
        ExploreAreaForPlayer(GetObjectByTag("BrosnaTempleofLife"),oTarget);
        AssignCommand(oTarget, JumpToLocation(GetLocation(GetObjectByTag ("brosnatempspawn"))));
    }
    else
    if (HasItem(oTarget,"llothstone"))
    {
        ExploreAreaForPlayer(GetObjectByTag("TempleOfLloth"),oTarget);
        AssignCommand(oTarget, JumpToLocation(GetLocation(GetObjectByTag ("llothspawn"))));
    }
    else
    if (HasItem(oTarget,"loknarstone"))
    {
        ExploreAreaForPlayer(GetObjectByTag("Loknar"),oTarget);
        AssignCommand(oTarget, JumpToLocation(GetLocation(GetObjectByTag ("port_loknar"))));
    }
    else
    if (163 == iRace || 164 == iRace)
    {
        ExploreAreaForPlayer(GetObjectByTag("UnderdarkCentral"),oTarget);
        AssignCommand(oTarget, JumpToLocation(GetLocation(GetObjectByTag ("drowstart"))));
    }
    else
    if (153 == iRace)
    {
        ExploreAreaForPlayer(GetObjectByTag("LaduguerHalls"),oTarget);
        AssignCommand(oTarget, JumpToLocation(GetLocation(GetObjectByTag ("duergarstart"))));
    }
    else
    {
        ExploreAreaForPlayer(GetObjectByTag("Benzor"),oTarget);
        AssignCommand(oTarget,JumpToLocation(GetLocation(GetObjectByTag ("benzorstart"))));
    }
}


I don't know what to tell you for the HCR & SEI scripts.  You aren't going to be able to get those to compile as is & I can't look at them & tell what is wrong with them.  You might try removing the SEI scripts from the module, compiling with the PRC compiler (you cannot use the Bioware one for this) & then fixing each error that pops up.
« Last Edit: October 06, 2009, 10:12:57 PM by DM Heatstroke »
HEATSTROKE


October 05, 2009, 10:35:17 PM
Reply #29
  • Jr. Associate
  • **
  • Posts: 62
  • Karma: +0/-0
    • View Profile

Quote from: DM Heatstroke

The numbers will work fine, you just have to use a single equal sign instead of a double equal sign in the functions above.  Single equal is for integers, double equal is for strings.

= is for assignment, == is for comparison. Type isn't involved.

Quote from: Badjaccur

Weird thing is that when I put the single equal sign in drow_recog.nss
Code: [Select]
if (GetRacialType(GetPCSpeaker()) = 163 || 164) I get the following error when compiling: "ERROR:CANNOT ASSIGN A VALUE TO THE LEFT-SIDE OF THIS STATEMENT"

Without lambdas or defining the racial type variable previously the only way to do this comparison is:
if (GetRacialType(GetPCSpeaker()) == 163 || GetRacialType(GetPCSpeaker()) == 164)

Quote from: DM Heatstroke

These all compile for me:

[size=16]drow_recog.nss[/size]
Code: [Select]
int StartingConditional()
    {
        int nRace = GetRacialType(GetPCSpeaker());
        if (nRace = 163 || 164 )
            return TRUE;
        return FALSE;
    }

This is really dangerous, and is why it's common practice in C/C++ to place constants on the left-hand side of comparisons, so that the compiler will choke if the programmer makes a typo and forgets an equals sign.