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 
 
Custom Races nwnx_funcs coding. Refined problem.

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
Savagefool



Joined: 23 Apr 2015
Posts: 6

PostPosted: Fri May 22, 2015 17:02    Post subject: Custom Races nwnx_funcs coding. Refined problem. Reply with quote

Here is the refined problem.
We need to set the subrace field to setrace if such a value is inputted.
As ConvoCC is disabled we cannot easily select races. However, the workaround for it was to setrace based on the value set in subrace.
The constants for the races are integer numbers so setting the subrace to say.. 84 for hound archon in order for StringToInt should in theory work.
This needs to happen at the right time otherwise we have numerous problems.
Where can we inject the following code:
Code:
#include "inc_nwnx_funcs"
/* Check Subrace and set race based on this.
*/
void main()
{
    {
    object oPC = GetFirstPC();
    string sRace = GetSubRace(oPC); //grab the subrace
    int nRace = StringToInt(sRace); //convert to int, use numbers so this goes smoothly.
    if (nRace != 0) //if this returns 0, assume error and no number was input.
        {
        PRC_Funcs_SetRace(oPC, nRace); //set race via funcs.
        }
    }
}


Any ideas?
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules 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