sub_zerus Posted September 9, 2007 Share Posted September 9, 2007 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 ErrorScript 'PublicanGreenRoadInn' , line 8:Unknown variable or function 'rent' If the references are unchanged the script saves fine Link to comment Share on other sites More sharing options...
Povuholo Posted September 9, 2007 Share Posted September 9, 2007 Could you post the script? The one that doesn't work. Link to comment Share on other sites More sharing options...
sub_zerus Posted September 9, 2007 Author Share Posted September 9, 2007 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 endifendif End Link to comment Share on other sites More sharing options...
GBHis Posted September 9, 2007 Share Posted September 9, 2007 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 EndI 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 cleanupshort setupshort hourspassed float renthourfloat 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 endifendif 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 endifendif EndI 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 comI'll fix it for ye'. Link to comment Share on other sites More sharing options...
sub_zerus Posted September 10, 2007 Author Share Posted September 10, 2007 thx :rolleyes: :rolleyes: it works Link to comment Share on other sites More sharing options...
GBHis Posted September 11, 2007 Share Posted September 11, 2007 Kewl :)Let my name slip somewhere in the README, will you? :) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.