![]()
|
|
Related Issues: 181
After reinvestigation (it's been quite some time ago), I guess that I messed up the declaration. I remember that I had totally overlooked that the function is set up to return a global variable rather than the value of a global.
Otherwise, this is a duplicate of bug 181.
Otherwise, this is a duplicate of bug 181.
Yep, didn't really notice this was a dup. So many bugs!
I’ve noticed this several times, outside of Whiterun in particular. The
tents are there with no Khajiit or the Khajiit are there with no tents. I’m
not sure of the cause/trigger, but the behavior was happening long before
the battle. They eventually settled back down into something resembling
their normal movement patterns, but it took a couple or three in-game
months. I know they lost one member/guard to a dragon attack while on the
road at one point, but their behavior had been buggy before then.
tents are there with no Khajiit or the Khajiit are there with no tents. I’m
not sure of the cause/trigger, but the behavior was happening long before
the battle. They eventually settled back down into something resembling
their normal movement patterns, but it took a couple or three in-game
months. I know they lost one member/guard to a dragon attack while on the
road at one point, but their behavior had been buggy before then.
i have had this happen multiple times as well. sometimes it’s the other way around, and the tents are there but the khajiits are missing.
Probably a dodgy script is all. The caravan system seems needlessly complex.
The Khajiit were having their camp outside of Windhelm. I sold stuff. I traveled west. I met them on the way, except they were coming from west heading to Windhelm… Is that ok because of a “dumb†script?
There are two caravans that can be met in the area around Windhelm.
I’ve seen a number of variations on this, generally the traders outside cities but with no camp set up, but occasionally the tents with no traders. Today, possibly for the first time ever that I’ve noticed, there was a camp outside Solitude – this time with no cats. Using the console I jumped to the location of each of the caravan leaders and all three were already encamped, outside Whiterun, Dawnstar and Windhelm respectively. I’ve not had a chance to investigate the scripting, but this doesn’t seem to make a lot of sense any which way.
It appears that I have found the error in the script:
Within the function “GetLocationGlobal(Int WhichCaravan)†(right at the bottom of the script), a value is assigned to a global variable by using a simple <global variable> = <value> command (more precisely, there are three of these commands: “ReturnVar = CaravanLocationAâ€, “ReturnVar = CaravanLocationB†and “ReturnVar = CaravanLocationCâ€). This does not work. To be completely sure, I tried to recompile this part of the code, and, as expected, got three type mismatch errors. To assign values to global variables, the setvalue() command has to be applied (i.e. “ReturnVar.SetValue(CaravanLocationA)â€, “ReturnVar.SetValue(CaravanLocationB)†and “ReturnVar.SetValue(CaravanLocationC)â€, respectively – this will compile without an error).
What this function does is to return a global that reflects the enable/disable state of the tents of the caravan specified by the “WhichCaravan†variable. In other words, if it fails to return a value, enabling/disabling the caravan tents stops working properly. It doesn’t stop to work at all though, since the value expected to be returned by the function is either 0 or 1; therefore, the default value is accidentally the correct one in statistically one out of two cases.
I really wonder how they got this code compiled. Did they provide us with erroneous source codes ? Or, did they use a different early papyrus version ?
Within the function “GetLocationGlobal(Int WhichCaravan)†(right at the bottom of the script), a value is assigned to a global variable by using a simple <global variable> = <value> command (more precisely, there are three of these commands: “ReturnVar = CaravanLocationAâ€, “ReturnVar = CaravanLocationB†and “ReturnVar = CaravanLocationCâ€). This does not work. To be completely sure, I tried to recompile this part of the code, and, as expected, got three type mismatch errors. To assign values to global variables, the setvalue() command has to be applied (i.e. “ReturnVar.SetValue(CaravanLocationA)â€, “ReturnVar.SetValue(CaravanLocationB)†and “ReturnVar.SetValue(CaravanLocationC)â€, respectively – this will compile without an error).
What this function does is to return a global that reflects the enable/disable state of the tents of the caravan specified by the “WhichCaravan†variable. In other words, if it fails to return a value, enabling/disabling the caravan tents stops working properly. It doesn’t stop to work at all though, since the value expected to be returned by the function is either 0 or 1; therefore, the default value is accidentally the correct one in statistically one out of two cases.
I really wonder how they got this code compiled. Did they provide us with erroneous source codes ? Or, did they use a different early papyrus version ?
I’d be more curious to know how you got it to spit out an error. I just tried recompiling it and it came back fine. Though obviously what you found is definitely a syntax bug, nice catch.
Created an empty mod with an empty quest, attached an empty script to bring up the CK edit window, then copied the respective function into the script and ran the compiler from the edit window.
I tried this:
Scriptname tesdt extends Quest Conditional
GlobalVariable property CaravanLocationA auto
GlobalVariable property CaravanLocationB auto
GlobalVariable property CaravanLocationC auto
GlobalVariable function GetLocationGlobal(int WhichCaravan)
GlobalVariable ReturnVar
if WhichCaravan == 1
ReturnVar = CaravanLocationA
elseif WhichCaravan == 2
ReturnVar = CaravanLocationB
elseif WhichCaravan == 3
ReturnVar = CaravanLocationC
EndIf
; Debug.trace("CaravanScript GetLocationGlobal() is returning " + ReturnVar)
return ReturnVar
EndFunction
But that compiles clean. Can you post what you tried it with?
Scriptname tesdt extends Quest Conditional
GlobalVariable property CaravanLocationA auto
GlobalVariable property CaravanLocationB auto
GlobalVariable property CaravanLocationC auto
GlobalVariable function GetLocationGlobal(int WhichCaravan)
GlobalVariable ReturnVar
if WhichCaravan == 1
ReturnVar = CaravanLocationA
elseif WhichCaravan == 2
ReturnVar = CaravanLocationB
elseif WhichCaravan == 3
ReturnVar = CaravanLocationC
EndIf
; Debug.trace("CaravanScript GetLocationGlobal() is returning " + ReturnVar)
return ReturnVar
EndFunction
But that compiles clean. Can you post what you tried it with?
Showing Comments 1 - 12 of 12