Scriptname RedwoodsTools extends Quest{ Global functions used by Redwood's Mods }import gameimport utilityimport math; Variables for Linked List implementationActivator property NodeType Auto ; what type of object are we using as default nodes? Make sure to attach the linked list node script to said object type!FormList property RandomNodeType Auto ; Optional list of random object types for the nodes. Make sure the linked list node script is attatched to all such objects!LinkedListControls property LList Auto ; Dummy node used to call the node creation functions.ObjectReference property NodeAxis AutoActivator Property NodeAxisType Auto ; What type of object is the node axis?ObjectReference Property NodeAxisHideSpot Auto ; Where do we hide the node axis?LLNOrgItem Property NodeOrgItem Auto ; Tvar.NodeOrgItem = For the linked list testing spell, to handle list organization outside the effect.Activator Property NodeOrgItemType Auto ; = The item type for the above organizer item.LLNNavOrgScript Property NavigationOrgItem Auto; Tvar.NavigationOrgItem = The organizer item for Navigatiion node linked lists.Activator Property NavNodeOrgItemType Auto ; = The Item type for the above organizer item.\Bool Property MapRequest=False Auto ; Is there a map using reference trying to get a map and unable to find the map controller?LinkedListControls Property NavMapList Auto ; Gvar.NavMapList = List of maps for navigation control. Ordinary vanilla linked list.ObjectReference Function InitializeLL(ObjectReference NodeAxis,Activator NodeAxisType) Global ObjectReference NewAxis if !NodeAxis ; We haven't got a place to put node lists yet! NewAxis = FindClosestReferenceOfTypeFromRef(NodeAxisType,Game.GetPlayer(),100000) ; Look for one. if !NewAxis ; None in the cell! NewAxis = Game.GetPlayer().PlaceAtMe(NodeAxisType,1,true) ; Emergency...make one! endif endif return NewAxisEndFunctionLinkedListControls Function SetLList(ObjectReference NodeAxis,Activator NodeType) global ; Function to make a dummy node. LinkedListControls NewLList while !NewLList NewLList = (NodeAxis.PlaceAtMe(NodeType,1,true) as LinkedListControls) ; Dummy Linked List node just to use to call functions. endwhile return NewLListEndFunctionEvent OnInit() RegisterForSingleUpdate(1)EndEventbool Property MapRequestBool AutoFunction MapRequest()Debug.Notification("Map request Function Call") ; This never shows. If !MapRequestBool ; Will prevent multiple registrations MapRequestBool = True UnRegisterForUpdate() RegisterForSingleUpdate(1) Endif Wait(5) MapRequestBool = FalseEndFunctionEvent OnUpdate() ; Checks periodically to make sure important global variables get filled when needed. if !NodeAxis NodeAxis = InitializeLL(NodeAxis,NodeAxisType) NodeAxis.MoveTo(NodeAxisHideSpot) endif if !LList LList = SetLList(NodeAxis,NodeType) endif if !NavigationOrgItemDebug.Notification("Global Variable Quest OnUpdate: Make Navigation Org Item") NavigationOrgItem = (NodeAxis.PlaceAtme(NavNodeOrgItemType,1) as LLNNavOrgScript) endif if !NodeAxis || !LList || !NavigationOrgItem RegisterForSingleUpdate(5) endifEndEventthat is being called in this OnInit Event in another script:
RedwoodsTools Property Gvar AutoEvent OnInit() setMotionType(Motion_Keyframed, TRUE) ; Only move when I tell you to move! while !MapController ; Don't try to do anything until we have a map controller working. While !Gvar.NavigationOrgItem ; Global reference to map controller is empty! ; Can't make it here...too many of these in existance! Wait(RandomFloat(0,3.0)) ; Prevent synchronized threads in multiple map getting attempts. if !Gvar.MapRequestBoolDebug.Notification(name+": Sending Map request") ; Get spammed with this, but the function call isn't happening. Gvar.MapRequest() endif EndWhile MapController = Gvar.NavigationOrgItem endwhile; Important code it never gets to hereEndEvent
I've been wasting a lot of my vacation time tracking this down, but now I'm utterly stuck. I'm using a completely clean savegame, so there's no bad savegame problem. When I log in, I get repeatedly spammed with the "Sending Map Request" message, but the notification inside the function doesn't show up! For some reason, the map request call is failing, and I haven't been able to figure out why. The Boolean is clearly "False", or the notification wouldn't show at all.
the really Weird part is, the initial update in the quest init DOES print out the notification that the navigation node org item is being created, and only prints it once. Which means that I SHOULDN'T be seeing the other loop at all.
