Jump to content

[LE] 1 line script issue


Recommended Posts

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname JVDSetFactionRankPF Extends Package Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(Actor akActor)
;BEGIN CODE
int i = 0
Debug.Notification(akActor.GetDisplayName() + " -- " + akActor.GetCurrentLocation().GetName() + " -- " + LocType.GetName() + " - " + SetLoc + " SetFacRank PRE")
while i < 4
akActor.SetFactionRank( LocType , SetLoc )
Debug.Notification(akActor.GetDisplayName() + " -- " + akActor.GetCurrentLocation().GetName() + " -- " + SetLoc + " - " + akActor.GetFactionRank(LocType) + " SetFacRank " + i)
i+=1
endwhile
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

int Property SetLoc Auto

Faction Property LocType  Auto

I think I'm going crazy.

This script is supposed to be 1 line akActor.SetFactionRank( LocType , SetLoc )

I'm passing the correct faction to LocType, I'm passing a 1 to SetLoc. For some reason LocType ends up having a faction rank of 0.

Whats even more crazy is the while loop originally had a condition SetLoc != akActor.GetFactionRank(LocType) but first iteration through it breaks out of the loop with the faction rank being 0. The computer is telling me 1 == 0 is true, nothing to see here, moving on.

The while loop also calls setfactionrank(1) but everytime I getfactionrank it stays 0. I even checked the NPC faction rank afterwards and its still 0 so its not like its delayed.

I am going crazy.

 

I have this exact same script except for Dialog, no problems. I pass it 1 it sets 1. I pass it 9 it sets 9.

 

My debug lines are displaying the correct info. SetLoc upon entry of the script is 1.

In the Faction form the rank 1 has been created even though in the past I have set a rank I did not create in the Faction form.

SetFactionRank works correctly in Package scripts, I have another scripts that randomly selects a int from an array and sets the faction to that int. Works correctly.

 

I feel like I'm missing something small but I don't see it and I just need another pair of eyes on it. What could I be doing wrong?

 

Thanks for your help.

Link to comment
Share on other sites

I called it many times cause I thought maybe it wasn't taking affect the first time.

I fixed it though, still the fix shouldn't be.
I remove the actor from the faction, then I use SetFactionRank.

I don't have to do this with my dialog script or my other package script that uses SetFactionRank, something definitely fishy here...

Link to comment
Share on other sites

  • Recently Browsing   0 members

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