Would you like to react to this message? Create an account in a few clicks or log in to continue.

Need a bit of help...

2 posters

Go down

Need a bit of help... Empty Need a bit of help...

Post by Angel of Death Fri Oct 14, 2011 2:11 pm

Resolved and edited out.


Last edited by Angel of Death on Sun Oct 16, 2011 2:07 pm; edited 2 times in total
Angel of Death
Angel of Death
Epic Level
Epic Level

Number of posts : 1132
Age : 409
Location : Europe
Main Character : Célestin Chevalier; Knight Champion of Dalix. Protector of the Innocent. Slayer of Evil.
Other Character : Angelique Nightstar; Arcane Archer.
Personal Quote: "The way of the bow is simplicity and beauty combined with power and discipline."
Other Character. : Bruce Li; Wanderer and Practitioner of the Dragon Paw Style. & Cherry; Starchild of Jewel n' Chancetaker of Lysis.
Other Character.. : Anna, Weaver of Illusions. - You can read about all of them following this link to their Biographies! =)
NWN Username : I await You in the End
Time Zone : Central European Timezone
Registration date : 2010-12-11

Back to top Go down

Need a bit of help... Empty Re: Need a bit of help...

Post by The Amethyst Dragon Fri Oct 14, 2011 2:28 pm

Your error comes from your list of deities. If the PC's deity doesn't match the first one, the script ends. If he/she matches the first one, but not the second, the script ends. No matter what the character's deity is, the script will end before doing anything.

Rewritten so that the script cuts out only if PC is not a glimmerskin halfling AND if PC doesn't have any of the deities listed. The && is the "and" for combining checks in NWScript. For "or", you use ||

Code:

// Put this script OnUsed.


void main()
{
    // Get the creature who triggered this event.
    object oPC = GetLastUsedBy();

    // Abort if the PC's subrace is not Glimmerskin Halfling.
    if (GetStringLowerCase(GetSubRace(oPC)) != "glimmerskin halfling")
      { return; }

    // Get the PC's deity just once, then do comparisons all at once.
    string sDeity = GetStringLowerCase(GetDeity(oPC));
    if (sDeity != "yondalla" &&
        sDeity != "dallah thaun" &&
        sDeity != "arvoreen" &&
        sDeity != "brandobaris" &&
        sDeity != "cyrollalee" &&
        sDeity != "sheela peryroyl" &&
        sDeity != "urogalan")
      { return; }

    // Send a message to the player's chat window.
    SendMessageToPC(oPC, "As you gets closer to the fountain and inspects it's design, you find...");
    SendMessageToPC(oPC, "..a line of words in the hinnish tongue, carved into the surface.");
    SendMessageToPC(oPC, "'Live by the Creed'; does it say. Instinctly a reply forms within your mind...");
    SendMessageToPC(oPC, "'Don't get Caught'; and as your hand passes over a section of the fountain...");
    SendMessageToPC(oPC, "...you disappear into a secret backroom of the temple.");

    // Find the location to which to teleport.
    location lTarget = GetLocation(GetWaypointByTag("yontemplebckrmwp"));

    // Teleport the PC.
    AssignCommand(oPC, ClearAllActions());
    AssignCommand(oPC, JumpToLocation(lTarget));
}
The Amethyst Dragon
The Amethyst Dragon
Ludicrous Level
Ludicrous Level

. : Creator of Aenea / Dungeon Master
Male Number of posts : 7841
Age : 49
Location : probably on the computer or wrangling his offspring
NWN Username : amethystdragon
DM Name : The Amethyst Dragon
Time Zone : GMT - 6:00 (Wisconsin)
Registration date : 2008-06-02

https://www.amethyst-dragon.com

Back to top Go down

Need a bit of help... Empty Re: Need a bit of help...

Post by Angel of Death Fri Oct 14, 2011 2:34 pm

Oh, doh! Yeah, I can see how that might be a problem now. Thanks. Smile


Rewritten so that the script cuts out only if PC is not a glimmerskin halfling AND if PC doesn't have any of the deities listed. The && is the "and" for combining checks in NWScript. For "or", you use ||
That one refreshed my memory of scripting knowledge, had forgotten that part. *I really suck at scripting Razz*
Angel of Death
Angel of Death
Epic Level
Epic Level

Number of posts : 1132
Age : 409
Location : Europe
Main Character : Célestin Chevalier; Knight Champion of Dalix. Protector of the Innocent. Slayer of Evil.
Other Character : Angelique Nightstar; Arcane Archer.
Personal Quote: "The way of the bow is simplicity and beauty combined with power and discipline."
Other Character. : Bruce Li; Wanderer and Practitioner of the Dragon Paw Style. & Cherry; Starchild of Jewel n' Chancetaker of Lysis.
Other Character.. : Anna, Weaver of Illusions. - You can read about all of them following this link to their Biographies! =)
NWN Username : I await You in the End
Time Zone : Central European Timezone
Registration date : 2010-12-11

Back to top Go down

Need a bit of help... Empty Re: Need a bit of help...

Post by Angel of Death Sat Oct 15, 2011 10:12 am

Oh boy, ran into another problem. >.>
In itself the script works fine, just not the way it's intended for my module...since it makes use of the PRC haks; it seems the PRC team has set up their custom races in a different manner than using the subrace field. So the simply script doesn't work. Rolling Eyes

Not sure how to handle this one problem...yet. Suspect
Angel of Death
Angel of Death
Epic Level
Epic Level

Number of posts : 1132
Age : 409
Location : Europe
Main Character : Célestin Chevalier; Knight Champion of Dalix. Protector of the Innocent. Slayer of Evil.
Other Character : Angelique Nightstar; Arcane Archer.
Personal Quote: "The way of the bow is simplicity and beauty combined with power and discipline."
Other Character. : Bruce Li; Wanderer and Practitioner of the Dragon Paw Style. & Cherry; Starchild of Jewel n' Chancetaker of Lysis.
Other Character.. : Anna, Weaver of Illusions. - You can read about all of them following this link to their Biographies! =)
NWN Username : I await You in the End
Time Zone : Central European Timezone
Registration date : 2010-12-11

Back to top Go down

Need a bit of help... Empty Re: Need a bit of help...

Post by Angel of Death Sun Oct 16, 2011 9:19 am


Making progress, albeit slower than I would want it too... Razz

Figured it out how the PRC team set up their custom races and stuff. . .sort of. . .anyway; it seems like they have created new racialtypes. Begs the question if I could use the GetRacialtype command to check for race instead of the GetSubrace command. In theory I think it could work... Smile

Like this.

Code:

    // Abort if the PC's race is not one of the variety of halfling races called in the script.
    string sGetRacialType = (GetRacialType(oPC));
    if (sGetRacialType  != RACIAL_TYPE_HALFLING &&
        sGetRacialType  != RACIAL_TYPE_DS_HALFLING &&
        sGetRacialType  != RACIAL_TYPE_DEEP_HALFLING &&
        sGetRacialType  != RACIAL_TYPE_GHOSTWISE_HALFLING &&
        sGetRacialType  != RACIAL_TYPE_GLIMMERSKIN_HALFING &&
        sGetRacialType  != RACIAL_TYPE_STRONGHEART_HALFLING &&
        sGetRacialType  != RACIAL_TYPE_TALLFELLOW_HALFLING &&
        sGetRacialType  != RACIAL_TYPE_TUNDRA_HALFLING &&
        sGetRacialType  != RACIAL_TYPE_SHOAL_HALFLING)
      { return; }

*Edit*
Jep, just as I thought. Something is definitely not right with the above as reports an error mismatched type when I try to compile it. Razz *Double-checks stuff to see where the problem may lie*
Angel of Death
Angel of Death
Epic Level
Epic Level

Number of posts : 1132
Age : 409
Location : Europe
Main Character : Célestin Chevalier; Knight Champion of Dalix. Protector of the Innocent. Slayer of Evil.
Other Character : Angelique Nightstar; Arcane Archer.
Personal Quote: "The way of the bow is simplicity and beauty combined with power and discipline."
Other Character. : Bruce Li; Wanderer and Practitioner of the Dragon Paw Style. & Cherry; Starchild of Jewel n' Chancetaker of Lysis.
Other Character.. : Anna, Weaver of Illusions. - You can read about all of them following this link to their Biographies! =)
NWN Username : I await You in the End
Time Zone : Central European Timezone
Registration date : 2010-12-11

Back to top Go down

Need a bit of help... Empty Re: Need a bit of help...

Post by The Amethyst Dragon Sun Oct 16, 2011 10:51 am

Racial types are usually an integer value, and you're trying to set it as a string value. Hence the "mismatched types" error.

Also, you'll need to make sure your script includes definitions for the new racial type constants, either right in the script or via an "#include".
The Amethyst Dragon
The Amethyst Dragon
Ludicrous Level
Ludicrous Level

. : Creator of Aenea / Dungeon Master
Male Number of posts : 7841
Age : 49
Location : probably on the computer or wrangling his offspring
NWN Username : amethystdragon
DM Name : The Amethyst Dragon
Time Zone : GMT - 6:00 (Wisconsin)
Registration date : 2008-06-02

https://www.amethyst-dragon.com

Back to top Go down

Need a bit of help... Empty Re: Need a bit of help...

Post by Angel of Death Sun Oct 16, 2011 11:08 am

The Amethyst Dragon wrote:Racial types are usually an integer value, and you're trying to set it as a string value. Hence the "mismatched types" error.
Yeah...I figured that out when I checked the nwn-lexicon.

The Amethyst Dragon wrote:
Also, you'll need to make sure your script includes definitions for the new racial type constants, either right in the script or via an "#include".

Just so I'm sure I understood that...all there's need is that I add an '#include' at the top of the script? Smile ...think I figured it out. Now I just need to figure out what the resource's name is. scratch

*Edit 2.1*

Alright, so I went through the game resources in my module to find the right file to include to my script. Found the file prc_inc_racial, which appears to be the correct file I am looking for. . .but! (always a but, eh?) when I try to include the file to my script (and then save/compile it) I get an access violation warning. affraid

"Access violation at address 0067336B in module 'nwtoolset.exe'. Read of address 00000026."

I got absolutely no clue what that mean. o.O Neutral
Angel of Death
Angel of Death
Epic Level
Epic Level

Number of posts : 1132
Age : 409
Location : Europe
Main Character : Célestin Chevalier; Knight Champion of Dalix. Protector of the Innocent. Slayer of Evil.
Other Character : Angelique Nightstar; Arcane Archer.
Personal Quote: "The way of the bow is simplicity and beauty combined with power and discipline."
Other Character. : Bruce Li; Wanderer and Practitioner of the Dragon Paw Style. & Cherry; Starchild of Jewel n' Chancetaker of Lysis.
Other Character.. : Anna, Weaver of Illusions. - You can read about all of them following this link to their Biographies! =)
NWN Username : I await You in the End
Time Zone : Central European Timezone
Registration date : 2010-12-11

Back to top Go down

Need a bit of help... Empty Re: Need a bit of help...

Post by The Amethyst Dragon Sun Oct 16, 2011 3:59 pm

It probably means that there are too many functions and/or constants in that include file for the toolset compiler to work with. I think PRC used an external script compiler to get around it.

What you could do is open the prc include file, copy the constants you want, paste them into your script at the top (before the "void main()"), then just not include the PRC include. If all you need is the constants, there's no real reason to try to use the full include.

Oh, and I don't know about you, but I have to save my module and fully close out the toolset, then reopen it if I want the toolset script compiler to function again after getting that error.
The Amethyst Dragon
The Amethyst Dragon
Ludicrous Level
Ludicrous Level

. : Creator of Aenea / Dungeon Master
Male Number of posts : 7841
Age : 49
Location : probably on the computer or wrangling his offspring
NWN Username : amethystdragon
DM Name : The Amethyst Dragon
Time Zone : GMT - 6:00 (Wisconsin)
Registration date : 2008-06-02

https://www.amethyst-dragon.com

Back to top Go down

Need a bit of help... Empty Re: Need a bit of help...

Post by Angel of Death Sun Oct 16, 2011 4:35 pm

The Amethyst Dragon wrote:It probably means that there are too many functions and/or constants in that include file for the toolset compiler to work with. I think PRC used an external script compiler to get around it.

What you could do is open the prc include file, copy the constants you want, paste them into your script at the top (before the "void main()"), then just not include the PRC include. If all you need is the constants, there's no real reason to try to use the full include.

Oh, and I don't know about you, but I have to save my module and fully close out the toolset, then reopen it if I want the toolset script compiler to function again after getting that error.

I actually found the problem when I reopened the toolset and examined the prc_inc_racial resource file closer. It has 3 files included to it, one of them being prc_racial_const...which would be the file I needed in the first place. Doh! Razz

I really should have noticed that one earlier*, thanks though! Smile

*The PRC haks got way too many files to look through, easy to miss really...or so I tell myself. >.>


*Edit*

That did it -- Now the script works perfect, thanks for the help! Very Happy
Angel of Death
Angel of Death
Epic Level
Epic Level

Number of posts : 1132
Age : 409
Location : Europe
Main Character : Célestin Chevalier; Knight Champion of Dalix. Protector of the Innocent. Slayer of Evil.
Other Character : Angelique Nightstar; Arcane Archer.
Personal Quote: "The way of the bow is simplicity and beauty combined with power and discipline."
Other Character. : Bruce Li; Wanderer and Practitioner of the Dragon Paw Style. & Cherry; Starchild of Jewel n' Chancetaker of Lysis.
Other Character.. : Anna, Weaver of Illusions. - You can read about all of them following this link to their Biographies! =)
NWN Username : I await You in the End
Time Zone : Central European Timezone
Registration date : 2010-12-11

Back to top Go down

Need a bit of help... Empty Re: Need a bit of help...

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum