Jump to content

Problem with protectron patrols


82dsoldier

Recommended Posts

I've placed a protectron in a pod in my mod and modeled it off the generic factory protectron in The Pitt. I've successfully linked it to a terminal so when I select the proper line in the terminal, the pod opens and the protectron activates. However, I can't get the protectron to start its patrol. It's a simple patrol made with three XMarkerHeadings. Each one of the XMarkerHeadings has a linked ref to the next one in line and the last one is linked back to the first one. I created a patrol package with the starting point at the first heading and containing all three headings and I've added this package to the protectron with the condition GetAv Variable01 >= 3. The relevant scripts are as follows:

Protectron script:

begin onLoad
	if getav variable01 == 0 ; I'm currently "off"
		; make me unconscious so I don't play sounds
		setUnconscious 1
	endif
end

begin OnActivate
	if isActionRef player == 0
		if getav variable01 == 0 ; I'm currently "off"
			setav variable01 1	; turn on
			setUnconscious 0		; not unconscious any more
			Activate			; tell pod to open
		else
			showwarning "just got activated"
			setav variable01 0	; turn off
			evp
		endif
	else
		Activate
	endif	
end

begin OnPackageEnd ProtectronNotActive
	if getav variable01 == 0
		Activate									; to get pod to close behind me
		; make me unconscious
		setUnconscious 1
	endif
end

begin onPackageEnd ProtectronTurnOn
	if getav variable01 >= 1
		setav variable01 3 ;to get it to start patrol
	endif
end

 

Protectron pod script:

ref myActionRef

Begin OnActivate

	if IsActionRef player == 0
		set myActionRef to getActionRef
		if myActionRef.getav variable01 == 0
			setopenstate 0
		else
			setopenstate 1
		endif
	endif

End

Terminal:

ref myProtectron
set myProtectron to getLinkedRef
if (myProtectron.getActorValue Variable01 == 0)
    myProtectron.activate door 1
endif
 

Any idea what I'm doing wrong here?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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