Player Resource Consortium
Neverwinter Nights => Help => Topic started by: Badjaccur on September 22, 2009, 05:54:04 PM
-
I'm not sure if this is PRC related but since I can not find any information on this problem, have PRC 3.3g installed and think the most skilled NWN developers are found here B) I might as well give it a try on this forum.
I'm running a Nordock mod that was patched with PRC 3.3 and uses the convoCC without any problems. Characters I made (using convoCC or the Java CC) get a dialogue with the following text as soon as they enter the starting area:
Your subrace field was not recognized. Please, finish this dialog completely to correctly initialize your subrace.
Does anyone have any idea what is going on here and how this can be fixed?
-
I'm not sure if this is PRC related but since I can not find any information on this problem, have PRC 3.3g installed and think the most skilled NWN developers are found here B) I might as well give it a try on this forum.
I'm running a Nordock mod that was patched with PRC 3.3 and uses the convoCC without any problems. Characters I made (using convoCC or the Java CC) get a dialogue with the following text as soon as they enter the starting area:
Your subrace field was not recognized. Please, finish this dialog completely to correctly initialize your subrace.
Does anyone have any idea what is going on here and how this can be fixed?
Did this module at one time have a separate subrace system installed?
-
Hello DM Heatstroke, thanks for your quick reply.
No, I don't think so. It's a clean Nordock with only the subrace system Nordock uses (written by Shir'le E. Illios who has seemed to disappear from the face of Faerun) patched with the PRC pack.
-
Well one easy way to find out whats throwing that error would be to open the module in the toolset, go the the temp0 folder that the toolset dumps all the modules files into & do a search for that textstring. That should point you in the right direction.
-
The two systems are completely unrelated and using Shirle's system with the prc won't work as they apply the subrace bonuses/penalties differently. You need to use one or the other.
-
The two systems are completely unrelated and using Shirle's system with the prc won't work as they apply the subrace bonuses/penalties differently. You need to use one or the other.
Well there you go. I've never even heard of that subrace system.
-
Thank you both fluffyamoeba and DM Heartstroke for you help,
The thing with Shirle's subrace system is that it also sets a faction and a starting point. In Nordock Drow and Duergar have their own starting point in cities in the Underdark, while all other races start topside in Bezor. I don't care much for the subrace bonuses/penalties because the PRC handles those a lot better, but I still need to set the right faction and spawning point. But for some reason the subrace is not being read. I was hoping someone would recognize this problem and could give me some clues.
I have played NWN for quite a few years now and I just LOVE what you guys at the PRC did with it but this is my first serious attempt at building a PW. And I'm a complete n00b when it comes to scripting, so any help is appreciated.
-
Thank you both fluffyamoeba and DM Heartstroke for you help,
The thing with Shirle's subrace system is that it also sets a faction and a starting point. In Nordock Drow and Duergar have their own starting point in cities in the Underdark, while all other races start topside in Bezor. I don't care much for the subrace bonuses/penalties because the PRC handles those a lot better, but I still need to set the right faction and spawning point. But for some reason the subrace is not being read. I was hoping someone would recognize this problem and could give me some clues.
I have played NWN for quite a few years now and I just LOVE what you guys at the PRC did with it but this is my first serious attempt at building a PW. And I'm a complete n00b when it comes to scripting, so any help is appreciated.
I think you are confusing Race & Subrace. AFAIK the PRC doesn't do anything with the actual BIC subrace field, so there is nothing for your faction script to read. What you can do is have the OnClientEnter script read the PC race using GetRacialType (http://www.nwnlexicon.com/compiled/function.GetRacialType.html)the 1st time they enter the server & SetSubrace (http://www.nwnlexicon.com/compiled/function.SetSubRace.html)to whatever you want it to be. The older, non-PRC version of Athas Reborn is setup this way for the Gnome (Tari) & Half-Orc (Half-Giant) races & it works fine. It'd probably be easier to just change the faction script from detecting subrace to detecting race however. You shouldn't need to futz with subraces anymore with the PRC installed. If you are still confused PM me & I'll see what I can do to help.
-
Thanks a lot for your suggestions, DM Heartstroke. In the mean time I found that when I use the Bioware CC to make an Elf and set the subrace to "Drow" the subrace does get read because the dialogue that asks me for my race and subrace does not show up, I get the (buffed, the way Shirley's subrace system works) ability boni and spawn in the Underdark. So something is working. With the hints you gave I 'll look into the scripts again and hope I'll find out that is happening here. If I hit that good old brick wall again I will make sure to PM you for advice.
Thanks again, your help with this is much appreciated.
-
Thanks a lot for your suggestions, DM Heartstroke. In the mean time I found that when I use the Bioware CC to make an Elf and set the subrace to "Drow" the subrace does get read because the dialogue that asks me for my race and subrace does not show up, I get the (buffed, the way Shirley's subrace system works) ability boni and spawn in the Underdark. So something is working. With the hints you gave I 'll look into the scripts again and hope I'll find out that is happening here. If I hit that good old brick wall again I will make sure to PM you for advice.
Thanks again, your help with this is much appreciated.
That kinda goes along with what I was saying. If you use the JavaCC or the ConvoCC nothing gets populated in the Subrace field because Drow & Duegar are actual racial types. If you use the Bioware CC, you can manually type Drow in but you don't get the natural bonuses or SLAs. You really want to be using racial types as opposed to subraces.
-
I used to play this Nordock server with PRC installed and as far as I know we used both systems at the same time. (This was not good because the buffed stats from Shirley's and the PRC's unbuffed racial stats stack, giving the Drow and Duergar double boni, but it was all about getting the right factions and spawning point.) So it worked one way or the other.
So I assume that some script would be checking for any subrace, if set to "Drow" it would set faction, add stats etc. Same goes with Duergar. But if no subrace was set it should set the spawning point to Benzor and not add bonus abilities. The last thing does not happen, but brings up the dialog and the options to set both race and subrace instead.
The idea about letting the faction script detect the race is really a good idea, although I don't know how to set the correct spawning point once the race is detected. But I have not looked at the script yet and as I mentioned before, I'm new with this.
I'm going to see if I can find out what script is doing what and how I can change it to work as it should again.
Again my thanks for your advice. I really appreciate it.
-
I used to play this Nordock server with PRC installed and as far as I know we used both systems at the same time. (This was not good because the buffed stats from Shirley's and the PRC's unbuffed racial stats stack, giving the Drow and Duergar double boni, but it was all about getting the right factions and spawning point.) So it worked one way or the other.
So I assume that some script would be checking for any subrace, if set to "Drow" it would set faction, add stats etc. Same goes with Duergar. But if no subrace was set it should set the spawning point to Benzor and not add bonus abilities. The last thing does not happen, but brings up the dialog and the options to set both race and subrace instead.
The idea about letting the faction script detect the race is really a good idea, although I don't know how to set the correct spawning point once the race is detected. But I have not looked at the script yet and as I mentioned before, I'm new with this.
I'm going to see if I can find out what script is doing what and how I can change it to work as it should again.
Again my thanks for your advice. I really appreciate it.
Should be just a matter of switching GetSubrace (http://www.nwnlexicon.com/compiled/function.getsubrace.html)to GetRacialType in the script & then disabling all of the "artifical" bonuses those races get.
-
Wow, my brain hurts.
I have been looking through scripts trying to find what is happening where but no luck so far. This is far more complicated than I hoped.
The desired behavior is that Nordock's subrace system no longer gives any boni to abilities and such since PRC handles this in a far better way. I also want the scripts check for the player's race (like DM Heartstroke suggested) instead of subrace and set factions and spawning point accordingly. But I have no idea how to do this.
If anyone has any (hands-on and scripting n00b compatible) suggestions or hints they are much appreciated.
-
DM Heartstroke
Lol
Wow, my brain hurts.
I have been looking through scripts trying to find what is happening where but no luck so far. This is far more complicated than I hoped.
The desired behavior is that Nordock's subrace system no longer gives any boni to abilities and such since PRC handles this in a far better way. I also want the scripts check for the player's race (like DM Heartstroke suggested) instead of subrace and set factions and spawning point accordingly. But I have no idea how to do this.
If anyone has any (hands-on and scripting n00b compatible) suggestions or hints they are much appreciated.
By any chance did you try my text search suggestion above? If you did & you still can't figure out where the bonuses are coming from you can 7zip (http://www.7-zip.org/)& send the module to dmheatstroke(at)athasreborn(dot)com. Not saying I'll fix it for you, but I will tell you what script is calling the racial bonuses.
-
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).
-
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.
-
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.
-
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]
if (GetSubRace(GetPCSpeaker())=="Drow")
Should be
if (GetRacialType(GetPCSpeaker()) = 163 || 164)
[size=16]duergar_recog.nss[/size]
if (GetSubRace(GetPCSpeaker())=="Duergar")
Should be
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)
string sRace=GetSubRace(oTarget);
Should be
int iRace = GetRacialType(oTarget);
And farther down
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
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]
//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
//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)
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
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]
string sRace=GetSubRace(oRespawner);
Should be
int iRace = GetRacialType(oRespawner);
& a bit further down
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
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]
// 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
// 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]
int StartingConditional()
{
// Reject player races
if(GetSubRace(GetPCSpeaker()) == "Drow")
return TRUE;
else
return FALSE;
}
Should be
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)
string sSubraceField = GetStringLowerCase( GetSubRace( a_oCharacter ) );
Should be
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.
-
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.
-
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.
-
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 (http://nwvault.ign.com/View.php?view=Modules.Detail&id=3963)?
-
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.
-
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 (http://www.chunkychode.com/Ness/links.aspx)or BESIE (http://nwvault.ign.com/View.php?view=Other.Detail&id=494)to spawn your creatures & placables in. Saves a good bit of memory especially in large modules.
I prefer & can give you pointers for NESS.
-
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).
2.) What ever you choose to do, let me make one suggestion, don't use encounters. Get a nice spawn system like NESS (http://www.chunkychode.com/Ness/links.aspx)or BESIE (http://nwvault.ign.com/View.php?view=Other.Detail&id=494)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.
-
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.
-
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?
-
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
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 (http://www.chunkychode.com/Ness/default.aspx)into your new module as well as the HCR2 (http://nwvault.ign.com/View.php?view=Scripts.Detail&id=3066) 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 (http://nwvault.ign.com/View.php?view=Scripts.Detail&id=3044) to keep your players guessing & FluffyA's PRC compatible Pwxfp Expericence (http://prc.theamberdragon.com/files/PRC3x_pwfxp.rar) 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 (http://www.nwnprc.com//nwn/english/content/modulebuilding/manual_modulebuilding_prcnpcs.html) 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!
-
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 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.
-
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 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]
int StartingConditional()
{
int nRace = GetRacialType(GetPCSpeaker());
if (163 == nRace || 164 == nRace )
return TRUE;
return FALSE;
}
[size=16]duergar_recog.nss[/size]
int StartingConditional()
{
int nRace = GetRacialType(GetPCSpeaker());
if (153 == nRace)
return TRUE;
return FALSE;
}
[size=16]rr_enter.nss @ line 246 [/size]
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]
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]
#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.
-
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.
Weird thing is that when I put the single equal sign in drow_recog.nss 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)
These all compile for me:
[size=16]drow_recog.nss[/size]
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.
-
Thanks for the pointers. As you can tell I don't do this for a living & have apparently learned what I do know from a lot of bad examples :D
Speaking of examples, is this how you would script drow_recog,nss?
int StartingConditional()
{
int nRace = GetRacialType(GetPCSpeaker());
if (163 || 164 == nRace )
return TRUE;
return FALSE;
}
-
Thanks for the pointers. As you can tell I don't do this for a living & have apparently learned what I do know from a lot of bad examples :D
Speaking of examples, is this how you would script drow_recog,nss?
int StartingConditional()
{
int nRace = GetRacialType(GetPCSpeaker());
if (163 || 164 == nRace )
return TRUE;
return FALSE;
}
Almost. No way exists in nwscript to do multiple comparison on a single operand. The statement if (163 || 164 == nRace) is evaluated to if true or nRace is 164 -- obviously not what you want!
Logical and (&&), logical or (||), logical not (!) operate on one or more conditions; operand expressions are first evaluated in place to true or false. The && and || operators are always evaluated after the comparison operators and most other operators.
So with this knowledge in mind, the if statement needs more tweaking:
if nRace is 163 or nRace is 164
and nwscript-ified:
if (163 == nRace || 164 == nRace)
Hope that helps.
-
Almost. No way exists in nwscript to do multiple comparison on a single operand. The statement if (163 || 164 == nRace) is evaluated to if true or nRace is 164 -- obviously not what you want!
And that's why he was always getting sent to the Drow area. Makes perfect sense. Thanks again, now let me see if I can fix those other scripts now.
-
Thank you N-S for your help.
I changed the scripts reflecting your suggestion.
The only script I can't get to compile is rr_enter.nss. And it looks like the factions are set here so this must be why the whole faction thing is not working. When trying to compile I get the following error:
rr_enter.nss(250): ERROR: NO RIGHT BRACKET ON EXPRESSION
I have looked for a place that looked like it could use a right bracket but everything seemed OK.
Anyone have any idea how to fix this (hopefully final) issue?
In case someone wants to take a look at this I attached the script.
-
I don't have a compiler at work so I have no idea if this will work or not.
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);
}
}
}
By the way, don't use NESS in conjunction with the PRC, too many DelayCommands & it stops spawning stuff.
-
@DM Heatstroke:
Seems to be it, but since whitespace is ignored that should be legal syntax and compile OK. Is the error with nwnnsscomp or clcompile?
I don't have an IDE nor the include files for this script. I did see this when looking at it (line 101):
if(!STARTING_GOLD)
{
...
}[color=#cc0000] if (GetLocalInt(oMod,"GIVELEVEL") > 1)[/color]
if(GetLocalInt(oMod,"GIVELEVEL") > 1)
{
...
Looks like a copy-paste mistake. But it should also compile without error.