Jump to content

[Solved] Getting my custom script to run a function from a fragment... not sure what I'm missing


NHguy03276

Recommended Posts

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.   

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use