NHguy03276 Posted December 3, 2016 Posted December 3, 2016 So I've been hacking at code for a little bit now, slowly figuring things out... however I'm still a bit confused to how functions are called... Anyways, the goal is to add a bunch of personality traits to npc's to affect the conversations the player has with them. To do this I'm adding a bunch of factions, and using faction ranks. However, since it's unlikely anyone will need this for all npcs, I only want the faction ranks to be assigned when you get to a certain point in the conversation, that way if you never go down some paths, the factions aren't needed and aren't assigned. So I want to use a script fragment when you get to a point to call the function in the script that assigned the factions / faction ranks. Looking at SexTalk(gay) as a template, I figured out where to place my calls, but the script will not run. I tried a test where I added what I want to do into the Sextalk(gay) quest and it works exactly how I want it, and the dialogue portion of my quest works as expected, but the script won't even activate a Debug.Notification("test test") . I'm thinking I'm missing either a event or a registerforevent someplace, but not sure where.... Anyways the fragment call is Debug.Notification("Reached the Fragment to call the SetStats function") SetInfo.SetStats(akSpeaker) with Setinfo defined in the config script to the script name as SetPersonalityTraits Property SetInfo Auto And my script SetPersonalityTraits Scriptname SetPersonalityTraits extends Quest SexLabFramework Property SexLab Auto slaFrameworkScr Property sla auto Faction Property SL_isGay Auto Faction Property SL_isDouch Auto Int Rank = -2 Actor TheActor Function SetStats(Actor anActor) ;Rank = anActor.getfactionrank(SL_isGay) ;if (rank < 0) ; anActor.addtofaction(SL_isGay) ; rank = utility.Randomint(0,1) ; anActor.SetFactionRank(SL_isGay, rank) ;endif Debug.Notification("this is from the script function setstats") EndFunction Yes most of the function is commented out, as I just want the debug notification to pop up at the moment, but that code did work when I placed it into Sextalk(gay) , I'm just not sure why this won't activate.
NHguy03276 Posted December 4, 2016 Author Posted December 4, 2016 I can't believe it... 5 days I spent staring at the scripts trying to figure this out... I knew it had to be something simple... I missed a script association property on the Fragment... Well, at least it now works, and I can move on...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.