Jump to content

Scripting problem, once again.


apixaez

Recommended Posts

Hey ya'll, it's been a while since I've been here..

 

Unfortunately with my absence it seems I've forgotten how to properly script aswell (if I ever could script properly :P).

 

I'm building a new .. player home/outpost which is basically in a mountain (enjoy the view ;)) and my plan is to have a switch that disables the forcefields/rocks when activated.

 

From what I remember it "should" be working (or damn close to), just whenever I try to save the script it won't let me which probably means there's an error in the script somewhere.. And yes, it's based on one of the useful scripts from Beth.

 

scn HRockSwitchTestSCRIPT

ref HRockSwitchTest

Begin OnActivate
if HRockSwitchTest == 0
	set HRockSwitchTest to GetLinkedRef
endif

if HRockSwitchTest.GetDisabled
	HRockSwitchTest.Enable
else
	HRockSwitchTest.Disable
endif
Activate
End

 

If anyone could point me on what is wrong in this script, it would be greatly appreciated and I will give you an imaginary cookie. (and yes, they have persistent reference flags enabled).

 

Thanks!

Link to comment
Share on other sites

To give you an idea of what I'm attempting..

 

 

 

The idea is that a forcefield and some rocks behind it are added in the area you're currently looking out so you kind of get a way to camouflage your hideout .. :)

Link to comment
Share on other sites

If its the name of a reference, or the name of a base object, then use something else for the ref variable in the script, is what I meant, but didn't explain too well ;)
Link to comment
Share on other sites

It was the name of the base object .. I've just given it a new reference and changed it accordingly in the script, but allas, no success as of yet.

 

I'm reading that to mean the refname in the editor is still the same as the ref declaration in the script? They should not be the same.

 

scn HRockSwitchTestSCRIPT

ref rLinkedREF

Begin OnActivate

   	if rLinkedREF == 0
           	set rLinkedREF to GetLinkedRef
   	endif

   	if rLinkedREF.GetDisabled
           	rLinkedREF.Enable
   	else
           	rLinkedREF.Disable
   	endif
   	Activate
End

Link to comment
Share on other sites

  • Recently Browsing   0 members

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