Jump to content

Recommended Posts

Posted
I am talking about an NPC that I made. It's not one of the original characters of Oblivion. The script was about renting a bed. I could not make it happen, so I made it remove, for a while, an object that functions as a door. But, apparently it was permanent.
  • Replies 47
  • Created
  • Last Reply

Top Posters In This Topic

Posted

I am talking about an NPC that I made. It's not one of the original characters of Oblivion. The script was about renting a bed. I could not make it happen, so I made it remove, for a while, an object that functions as a door. But, apparently it was permanent.

 

Doors (at least load doors) get baked into your save. Only way to test changes is to use a save that has never had any contact with the door you are testing.

Posted

To disable and enable an object you need to give it a cell-specific reference and use the cell reference .enable/disable functions in a script or a scripted dialogue.

Posted

To disable and enable an object you need to give it a cell-specific reference and use the cell reference .enable/disable functions in a script or a scripted dialogue.

I have given it a reference .enable function, bit still, it stays disabled.

Posted (edited)

The Door

Something similar did happen to my house mod in Morrowind, a door disappeared when I modded the house, extremely annoying and I never touched that door as it was still in CS, so I had to make a copy of the door and place it again. So maybe you could try to make a new door?

 

Well try this:

  • Get the reference to the door from CS
  • Run the game and open console
  • Type <Prid refenumber>
  • Enable

 

The Innkeeper

To make an innkeeper you need to do more things then edit scripts. I checked the old thread and we did not get far in it. So do you wanna try to make a fully functional innkeeper? I cannot promise we will succeed but we can try as I have mentioned before, they are not as easy to make as it looks like.

  • Script at the Innkeeper
  • 3 different Dialog topics and the innkeeper must be member in them

I also only use the old CS, so I do not know exact how to do things in ECS, which you are using

Edited by Pellape
Posted

OK, here is what I wrte at the first place:

 

Scriptname VALAdhrisa
;CellName: VALRoadTripInn
;Publican: VALAdhrisa
;Room: First room upstairs on the left
;Door Ref: BedTapestry
short rent
short rentday
short rentmonth
short cleanup
short setup
begin gamemode
if ( rent == 1 )
if ( setup == 0 )
set rentday to GameDay
set rentmonth to GameMonth
set setup to 1
BedTapestry.disable
else
if ( GameDay != rentday )
set cleanup to 1
elseif ( GameMonth != rentmonth )
set cleanup to 1
endif
endif
if ( Player.GetinCell VALRoadTripInn == 0 )
if ( Cleanup == 1 )
set Cleanup to 2
endif
endif
if ( Cleanup == 2 )
set rent to 0
set setup to 0
set rentday to 0
set rentmonth to 0
set cleanup to 0
BedTapestry.enable
endif
endif
End
And here is another attempt:
Scriptname VALAdhrisa
short rent
begin gamemode
if ( rent == 1 )
if ( setup == 0 )
set rentday to GameDay
set rentmonth to GameMonth
set setup to 1
BedTapestry.disable
else
if ( GameDay != rentday )
set cleanup to 1
elseif ( GameMonth != rentmonth )
set cleanup to 1
endif
endif
if ( Player.GetinCell VALRoadTripInn == 0 )
if ( Cleanup == 1 )
set Cleanup to 2
endif
endif
if ( Cleanup == 2 )
set rent to 0
set setup to 0
set rentday to 0
set rentmonth to 0
set cleanup to 0
BedTapestry.enable
endif
endif
End
Posted (edited)

Oki. Let us use script 1 as you did deleted some variable declarations that must be in the script in the scrtipt 2, otherwise they do look the same. Lets me check the script in Notepad++ and tab it, so it gets easier to read.

The reason we tab it, is to see where the if sections starts and end... It has become a habbit since I started with coding 30 years ago... :wink:

 

Scriptname VALAdhrisa
 
;CellName: VALRoadTripInn
;Publican: VALAdhrisa
;Room: First room upstairs on the left
;Door Ref: BedTapestry
 
 
 
short rent
short rentday
short rentmonth
short cleanup
short setup
 
 
 
begin gamemode
 
 
	if ( rent == 1 )
 
		if ( setup == 0 )
			set rentday to GameDay
			set rentmonth to GameMonth
			set setup to 1
			BedTapestry.disable
 
 
		else
 
			if ( GameDay != rentday )
				set cleanup to 1
			elseif ( GameMonth != rentmonth )
				set cleanup to 1
			endif
		endif
 
		if ( Player.GetinCell VALRoadTripInn == 0 )
			if ( Cleanup == 1 )
				set Cleanup to 2
			endif
		endif
 
		if ( Cleanup == 2 )
 
			set rent to 0 
			set setup to 0
			set rentday to 0
			set rentmonth to 0
			set cleanup to 0
			BedTapestry.enable
		endif
	endif
  
End

What I see as a problem is that the script has the same name as the Publician. Is VALAdhrisa the name of the reference? We must make sure that we can clearly see them apart so they cannot confuse us.

 

I do suggest you use script 1 again but rename it to scn VALAdhrisaSCR and rename the Persistent Reference VALAdhrisa to VALAdhrisaREF, as she is Persitent and named right? What ye think?

 

50850136132_4dec175dc0_o.png

 

It seems NPC's are always Persistent but you must name the Reference like this (Or similar) to be able to call its script from elsewhere, like from the dialog. I do suggest the name VALAdhrisaREF so it gets clear as water in the Caribbean.

 

This way we can change the rent from the dialog, with

Set VALAdhrisaREF.rent to 1

...as it is the reference that are called and changed, not the script itself, so we can NEVER get something like this to work:

Set VALAdhrisaSCR.rent to 1

Edited by Pellape
Posted (edited)

Adhrisa is the name of the vendor and VAL comes from Valenwood. I will try what you told me and I will tell you as soon as possible.

Edited by Dimitrisgb
Posted

I still get the same message. I did all these things you wrote (first I tried by naming the script VALAdhrisa nd then VALAdhrisaSCR (d before h). So I went to the notepad archive and it says:

 

"[CS] Script 'DefaultCompiler', line 3:

Unknown referenced object 'VALAhdrisa'."
Although there is NOWHERE any object called VALAhdrisa (h before d).
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...