Jump to content

Inn Script error


sub_zerus

Recommended Posts

I wanted to create an inn i am not good at scripting so i copied text from another script and changed all references to my NPC but when I try to save I get an error:

 

Script Error

Script 'PublicanGreenRoadInn' , line 8:

Unknown variable or function 'rent'

 

If the references are unchanged the script saves fine

Link to comment
Share on other sites

ScriptName PublicanGreenRoadInnTriggerScript

 

short doonce

 

 

Begin Gamemode

 

if ( AAAHelviusNoniusRef.rent == 1 )

if ( AAAHelviusNoniusRef.Cleanup == 1 )

if ( doonce == 0 )

if ( GetDistance Player < 600 )

AAAHelviusNoniusRef.EvaluatePackage

set doonce to 1

endif

endif

endif

endif

 

End

Link to comment
Share on other sites

ScriptName PublicanGreenRoadInnTriggerScript

short doonce

Begin Gamemode

if ( AAAHelviusNoniusRef.rent == 1 )
 if ( AAAHelviusNoniusRef.Cleanup == 1 )
if ( doonce == 0 )
   if ( GetDistance Player < 600 )
	 AAAHelviusNoniusRef.EvaluatePackage
	 set doonce to 1
   endif
 endif
  endif
endif

End

I like indenting ;)

 

Well, guess you'll have to attach some sort of script to your ref.

Scriptname Publican_BorderWatchInnSthasa

 

;CellName: GreenRoadInn

;Publican: AAAHelviusNoniusRef

;Room: *fill in for later "readability"

;Door Ref: InnDoorToPlaceWherePlayerSleepsRef

 

 

 

short rent

 

short cleanup

short setup

short hourspassed

 

float renthour

float hourcheck

 

begin gamemode

 

 

if ( rent == 1 )

 

if ( setup == 0 )

set renthour to GameHour

set setup to 1

set hourspassed to 0

set hourcheck to GameHour

InnDoorToPlaceWherePlayerSleepsRef.unlock ; This is the persistent ref to the door leading to the room where the player sleeps.

InnDoorToPlaceWherePlayerSleepsBed.SetOwnership ; This is the persistent ref to the bed in which the player sleeps.

 

else

 

if ( HoursPassed >= 24 )

set cleanup to 1

else

set hourcheck to GameHour

if ( renthour >= 23 )

if ( GameHour < 1 )

set HoursPassed to ( HoursPassed + 1 )

set renthour to GameHour

endif

else

if ( ( renthour + 1 ) < GameHour )

set HoursPassed to ( HoursPassed + 1 )

set renthour to GameHour

endif

endif

endif

 

endif

 

if ( Player.GetInCell PublicanGreenRoadInn == 0 ) ; I assumed your cell was called something like this?

if ( Cleanup == 1 )

set Cleanup to 2

endif

endif

 

 

if ( Cleanup == 2 )

 

set rent to 0

set renthour to 0

set hourspassed to 0

set setup to 0

set cleanup to 0

set PublicanGreenRoadInnTriggerRef.doonce to 0 ; The ref to which you attached the other script.

InnDoorToPlaceWherePlayerSleepsRef.SetOpenState 0

InnDoorToPlaceWherePlayerSleepsRef.lock 30

InnDoorToPlaceWherePlayerSleepsBed.SetOwnership AAAHelviusNoniusRef

endif

endif

 

 

 

End

 

Begin MenuMode

 

if ( rent == 1 )

if ( setup == 1 )

if ( HoursPassed >= 24 )

set cleanup to 1

else

if ( renthour >= 23 )

if ( Gamehour < 1 )

set HoursPassed to ( HoursPassed + 1 )

set renthour to GameHour

endif

else

if ( ( renthour + 1 ) < GameHour )

set HoursPassed to ( HoursPassed + 1 )

set renthour to GameHour

endif

endif

endif

endif

endif

 

End

I modified one of the existing inn-scripts to fit your vars. I really have to little info. If this works, I'm happy to have helped! Otherwise, please upload your mod or send it to my email at

joe /dot revolt-it /dot com

I'll fix it for ye'.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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