Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Script Requests


Tonycubed2
 Share

Recommended Posts

Event OnActivate (ObjectReference akActionRef)

The value of akActionRef is 'who or what' activated the button.

So, that means it will equal the player, or Game.GetPlayer().

I would suggest adding a integer property, and on each button, give it a local value in the integer property of the buttons script reference in the Object window.

And for the totals value, use a global variable so all versions of the script on each button can keep track of the tally.

So let me see if I understand you.

First: Add an integer property

Int Property activatornum auto
Second: Give the integer a local value inside of the button's script (the one that comes with it I'm assuming) in the Object Window (the window that appears when you double click an item? as well as under the "scripts" tab I would gather.) Sorry but I am not sure how to specifically go about doing this. If I were to edit a pre-existing code then I think that I would have to declare the new integer there as well. So would I need to do this then?
Int Property activatornum auto

Int = #

Third: I do not know how to use a global variable or even know what it is precisely, but gathering from the context you used it in and its name, I'm assuming that it is some kind of variable that will act on multiple activators at once?

Link to comment
Share on other sites

1. correct.

2. correct.

The script will run its 'own version' of that script on its object. So I will not know what the other objects 'versions' of that script did in the past or future. The object in your case is your individual buttons.

In the object window, you double-click each button and on the 'activatornum' int property, you set its value to 1 for the ones button. 2 for the tens button. 3 for the hundreds button, etc...

Now when the script runs, you can look at this variable 'inside the script' to know which button called the script. So...

GlobalVariable Property entrynumberGBL Auto
if activatornum == 1
entry = entry + 1
entrynumberGBL = entrynumberGBL + 1
elseif activatornum == 2
entry = entry + 10
entrynumberGBL = entrynumberGBL + 1EndEvent
elseif activatornum == 3[/code]

etc...

3. Global variables can be accessed with its current value from ANY other object or script. And they are easy to setup and use.

1. You create the global you want to use in the >Miscellaneous >Global listing.

LevelersMaxGoldGBL

2. You then define that global as a property to your script.

GlobalVariable Property LevelersMaxGoldGBL Auto

3. You can then get the value of that global like this:

int myGoldAmount = LevelersMaxGoldGBL.GetValue() as int

4. You can also set the value of the global like this:

LevelersMaxGoldGBL.SetValue(100)

And it can be used like this in any script.

Link to comment
Share on other sites

1. correct.

2. correct.

The script will run its 'own version' of that script on its object. So I will not know what the other objects 'versions' of that script did in the past or future. The object in your case is your individual buttons.

In the object window, you double-click each button and on the 'activatornum' int property, you set its value to 1 for the ones button. 2 for the tens button. 3 for the hundreds button, etc...

Now when the script runs, you can look at this variable 'inside the script' to know which button called the script. So...

GlobalVariable Property entrynumberGBL Auto
if activatornum == 1

                entry = entry + 1

                entrynumberGBL = entrynumberGBL + 1

elseif activatornum == 2

                entry = entry + 10

                entrynumberGBL = entrynumberGBL + 1EndEvent

elseif activatornum == 3
etc... 3. Global variables can be accessed with its current value from ANY other object or script. And they are easy to setup and use. 1. You create the global you want to use in the >Miscellaneous >Global listing. LevelersMaxGoldGBL 2. You then define that global as a property to your script. GlobalVariable Property LevelersMaxGoldGBL Auto 3. You can then get the value of that global like this: int myGoldAmount = LevelersMaxGoldGBL.GetValue() as int 4. You can also set the value of the global like this: LevelersMaxGoldGBL.SetValue(100) And it can be used like this in any script.
Okay so then, this is what the script looks like so far:
Scriptname MODCombinationLockTest01 extends ObjectReference  

{Test stage script for the combination lock concept.}


ObjectReference Property outputactivator auto

Int Property combination auto

Int Property activatornum auto

GlobalVariable Property EntrynumberGBL Auto



Event OnActivate (ObjectReference akActionRef)


	activatornum.GetValue()


	if activatornum == 1

        	EntrynumberGBL = EntrynumberGBL.GetValue() + 1


	elseif activatornum == 2

        	EntrynumberGBL = EntrynumberGBL.GetValue() + 10


	elseif activatornum == 3

        	EntrynumberGBL = EntrynumberGBL.GetValue() + 100


	elseif activatornum == 4

        	EntrynumberGBL = EntrynumberGBL.GetValue() + 1000


	elseif activatornum == 0

        	EntrynumberGBL = EntrynumberGBL.GetValue() * 0

	endif


EndEvent


if (EntrynumberGBL == combination)

        activate.outputactivator()

elseif (EntrynumberGBL != combination)

        EntrynumberGBL = EntrynumberGBL * 0

endif

So if this is correct, then that means all I have to do now is declare the activatornumbers in the button script like you previously mentioned and then fill in the property spaces in the scripts tab. Is that right?

Link to comment
Share on other sites

Your script will not work because you have to either set the global value into another variable, or 'GetValue' everytime you use the global variable.

1.

myNum = activatornum.GetValue()
if myNum == 1[/code] 2.
[code]if activatornum.GetValue() == 1

Link to comment
Share on other sites

Your script will not work because you have to either set the global value into another variable, or 'GetValue' everytime you use the global variable.

1.

myNum = activatornum.GetValue()

if myNum == 1
2.
if activatornum.GetValue() == 1
Hmm okay so I like the look of the second option there even though my intuition tells me that it might be the less efficient of the two options... So then this is what I am thinking of using (this feels just like high-school math all over again O_o):
Scriptname MODCombinationLockTest01 extends ObjectReference  

{Test stage script for the combination lock concept.}


ObjectReference Property outputactivator auto

Int Property combination auto

Int Property activatornum auto

GlobalVariable Property entrynumberGBL auto


Event OnActivate (ObjectReference akActionRef)


	if activatornum.GetValue() == 1

        	entrynumberGBL = entrynumberGBL.GetValue() + 1


	elseif activatornum.GetValue() == 2

        	entrynumberGBL = entrynumberGBL.GetValue() + 10


	elseif activatornum.GetValue() == 3

        	entrynumberGBL = entrynumberGBL.GetValue() + 100


	elseif activatornum.GetValue() == 4

        	entrynumberGBL = entrynumberGBL.GetValue() + 1000


	elseif activatornum.GetValue() == 0

        	entrynumberGBL = entrynumberGBL.GetValue() * 0

	endif


	if (entrynumberGBL.GetValue() == combination)

        	outputactivator.activate()

	elseif (entrynumberGBL.GetValue() != combination)

       		entrynumberGBL = entrynumberGBL * 0

	endif


EndEvent

Ok so this one didn't work and here's the error code:

Starting 1 compile threads for 1 files...

Compiling "MODCombinationLockTest01"...

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(11,17): int is not a known user-defined type

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(11,28): cannot compare a none to a int (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(12,9): type mismatch while assigning to a globalvariable (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(14,21): int is not a known user-defined type

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(14,32): cannot compare a none to a int (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(15,9): type mismatch while assigning to a globalvariable (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(17,21): int is not a known user-defined type

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(17,32): cannot compare a none to a int (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(18,9): type mismatch while assigning to a globalvariable (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(20,21): int is not a known user-defined type

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(20,32): cannot compare a none to a int (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(21,9): type mismatch while assigning to a globalvariable (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(23,21): int is not a known user-defined type

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(23,32): cannot compare a none to a int (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(24,9): type mismatch while assigning to a globalvariable (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(28,25): argument akactivator is not specified and has no default value

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(30,41): cannot multiply a globalvariable with a int (cast missing or types unrelated)

No output generated for MODCombinationLockTest01, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on MODCombinationLockTest01

Edited by Altrunchen
Link to comment
Share on other sites

You need to use SetValue() to reset the value of a Global. Like this:


Scriptname MODCombinationLockTest01 extends ObjectReference  

{Test stage script for the combination lock concept.}


ObjectReference Property outputactivator auto

Int Property combination auto

Int Property activatornum auto

GlobalVariable Property entrynumberGBL auto


Event OnActivate (ObjectReference akActionRef)


        if activatornum.GetValue() == 1

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 1)


        elseif activatornum.GetValue() == 2

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 10)


        elseif activatornum.GetValue() == 3

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 100)


        elseif activatornum.GetValue() == 4

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 1000)


        elseif activatornum.GetValue() == 0

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() * 0)

        endif


        if (entrynumberGBL.GetValue() == combination)

                outputactivator.activate()

        elseif (entrynumberGBL.GetValue() != combination)

                entrynumberGBL = entrynumberGBL * 0

        endif


EndEvent

Edited by ThomasKaira
Link to comment
Share on other sites

You need to use SetValue() to reset the value of a Global. Like this:


Scriptname MODCombinationLockTest01 extends ObjectReference  

{Test stage script for the combination lock concept.}


ObjectReference Property outputactivator auto

Int Property combination auto

Int Property activatornum auto

GlobalVariable Property entrynumberGBL auto


Event OnActivate (ObjectReference akActionRef)


        if activatornum.GetValue() == 1

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 1)


        elseif activatornum.GetValue() == 2

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 10)


        elseif activatornum.GetValue() == 3

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 100)


        elseif activatornum.GetValue() == 4

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 1000)


        elseif activatornum.GetValue() == 0

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() * 0)

        endif


        if (entrynumberGBL.GetValue() == combination)

                outputactivator.activate()

        elseif (entrynumberGBL.GetValue() != combination)

                entrynumberGBL = entrynumberGBL * 0

        endif


EndEvent

Ah, okay thank you. I appreciate the help!

EDIT: Alright, so the error report now says:

Starting 1 compile threads for 1 files...

Compiling "MODCombinationLockTest01"...

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(11,24): int is not a known user-defined type

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(11,35): cannot compare a none to a int (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(14,28): int is not a known user-defined type

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(14,39): cannot compare a none to a int (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(17,28): int is not a known user-defined type

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(17,39): cannot compare a none to a int (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(20,28): int is not a known user-defined type

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(20,39): cannot compare a none to a int (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(23,28): int is not a known user-defined type

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(23,39): cannot compare a none to a int (cast missing or types unrelated)

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(28,32): argument akactivator is not specified and has no default value

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(30,48): cannot multiply a globalvariable with a int (cast missing or types unrelated)

No output generated for MODCombinationLockTest01, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on MODCombinationLockTest01

Sorry for bugging you guys so much about this, but to be honest I really don't know what I'm doing here.

Edited by Altrunchen
Link to comment
Share on other sites

Ahh, I see. You seem to have mixed up how to reference Globals and normal variables. You don't use GetValue() for normal variables, only Globals (and as stated before, globals need to be reset using SetValue()).

Scriptname MODCombinationLockTest01 extends ObjectReference  

{Test stage script for the combination lock concept.}


ObjectReference Property outputactivator auto

Int Property combination auto

Int Property activatornum auto

GlobalVariable Property entrynumberGBL auto


Event OnActivate (ObjectReference akActionRef)


        if activatornum == 1 ;GetValue() is not used for normal variables. Removed.

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 1)


        elseif activatornum == 2 ;GetValue() is not used for normal variables. Removed.

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 10)


        elseif activatornum == 3 ;GetValue() is not used for normal variables. Removed.

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 100)


        elseif activatornum == 4 ;GetValue() is not used for normal variables. Removed.

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 1000)


        elseif activatornum == 0 ;GetValue() is not used for normal variables. Removed.

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() * 0)

        endif


        if (entrynumberGBL.GetValue() == combination)

                outputactivator.activate(game.getPlayer()) ;You must specify which Object Reference you wish to activate the Activator with. I have filled this in for you.

        elseif (entrynumberGBL.GetValue() != combination)

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() * 0) ;There was another mix-up on SetValue() usage here.

        endif


EndEvent

I've commentated the rest of the corrections. This will at least get your script to compile. However, you may wish to rethink your second If statement, as I feel it might cause you some trouble.

Edited by ThomasKaira
Link to comment
Share on other sites

Ahh, I see. You seem to have mixed up how to reference Globals and normal variables. You don't use GetValue() for normal variables, only Globals (and as stated before, globals need to be reset using SetValue()).

Scriptname MODCombinationLockTest01 extends ObjectReference  

{Test stage script for the combination lock concept.}


ObjectReference Property outputactivator auto

Int Property combination auto

Int Property activatornum auto

GlobalVariable Property entrynumberGBL auto


Event OnActivate (ObjectReference akActionRef)


        if activatornum == 1 ;GetValue() is not used for normal variables. Removed.

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 1)


        elseif activatornum == 2 ;GetValue() is not used for normal variables. Removed.

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 10)


        elseif activatornum == 3 ;GetValue() is not used for normal variables. Removed.

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 100)


        elseif activatornum == 4 ;GetValue() is not used for normal variables. Removed.

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 1000)


        elseif activatornum == 0 ;GetValue() is not used for normal variables. Removed.

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() * 0)

        endif


        if (entrynumberGBL.GetValue() == combination)

                outputactivator.activate(game.getPlayer()) ;You must specify which Object Reference you wish to activate the Activator with. I have filled this in for you.

        elseif (entrynumberGBL.GetValue() != combination)

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() * 0) ;There was another mix-up on SetValue() usage here.

        endif


EndEvent
I've commentated the rest of the corrections. This will at least get your script to compile. However, you may wish to rethink your second If statement, as I feel it might cause you some trouble.
Thank you so very much! It's so nice of you guys to take time out of your day to help random people on the internet with stuff like this. I'll let you guys know if it works or not. EDIT: Ok so the script compiles now but when I tried implementing it I realized that there wasn't a way in the script to send the integer assigned to the individual switches to the script to be evaluated. WillieSea did suggest modifying the button's code so that an integer could be assigned to it, and I believe his idea was that the activated button would send its assigned integer to the main script, thereby fulfilling the corresponding 'if' statement. It's probably my own fault that this didn't seem to work, but the one thing I thought was fishy was that the main script was asking me for the integer in the properties window that was supposed to come from the switches, not from itself. What I thought might work would be to have it so that there were multiple objectreferences that were part of the if statements. As in if the object reference was activated it would tell the script to do such and such. Putting that idea into effect resulted in a successful compilation but I realized that there was another problem. The "outputactivator" to be activated implied that this script was not on the object effected by the combination, so I thought what if the script would just tell the object that it is on to activate instead? What happens is that the combination doesn't seem to enter because the doors do not swing open (or activate, I would prefer if this script could work on other things apart from doors) and the one button that the script is attached to activates while I manually activate the doors. Here is what I changed:
Scriptname MODCombinationLockTest01 extends ObjectReference  

{Test stage script for the combination lock concept.}


ObjectReference Property outputactivator auto

ObjectReference Property ones auto

ObjectReference Property tens auto

ObjectReference Property hundreds auto

ObjectReference Property thousands auto

ObjectReference Property reset auto

Int Property combination auto

GlobalVariable Property entrynumberGBL auto


Event OnActivate (ObjectReference akActionRef)


        if ones.activate(game.getplayer())

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 1)


        elseif tens.activate(game.getPlayer())

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 10)


        elseif hundreds.activate(game.getPlayer())

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 100)


        elseif thousands.activate(game.getPlayer())

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() + 1000)


        elseif reset.activate(game.getPlayer()) 

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() * 0)

        endif


        if (entrynumberGBL.GetValue() == combination)

                activate(self)

        elseif (entrynumberGBL.GetValue() != combination)

                entrynumberGBL.SetValue(entrynumberGBL.GetValue() * 0)

        endif


EndEvent

Edited by Altrunchen
Link to comment
Share on other sites

You have that script on all 5 buttons.

You double-click on each button and the tabs on its 'properties', you scroll to the right until you click on the 'script' tab. Select your script in the box and edit the properties.

Change the Int value of 'activatornum' to the values that are used in the script.

"1" for ones button.

"2" for tens button.

ect..

Link to comment
Share on other sites

Hey guys. I''m having a little trouble with an activator being used in my house mod. I'm trying to copy the repository (funny it matches this threads name, that's how I found this site!) from the septimus signus outpost. Now I'm VERY limited in Papyrus, did some Java, so I can understand what stuff does, but I can't come up with this one on my own. The repository doesn't have any scripts or any linked references or any active parents. It seems like the opening of it is controlled by the quest, but even then I can't find any kind of command to play it's animation. My main goal is to have the repository be opened and closed with the push of a dwemer button. Now I've tried copying code from other activations that play an animation, like what's in mzulft03 (the thing where you have to rotate the domes so the lights all focus on the correct spot). The code for that is...


bool openNext = false

bool closeNext = false



Function _Open()

	openNext = false

	GoToState("Busy")

	PlayAnimationandWait("Open", "Done")

	GoToState("Opened")

EndFunction


Function _Close()

	closeNext = false

	GoToState("Busy")

	PlayAnimation("Close")

	GoToState("Closed")

EndFunction


Function Close()

EndFunction


Function Open()

EndFunction



Event OnInit()

	BlockActivation(True)

EndEvent



auto State Closed

	Event OnBeginState()

		BlockActivation(True)

		if (openNext)

			Open()

		endif

	EndEvent


	Function Open()

		_Open()

	EndFunction

EndState



State Opened

	Event OnBeginState()

		BlockActivation(False)

		if (closeNext)

			Close()

		endif

	EndEvent


	Event OnActivate(ObjectReference akActivator)

		if (akActivator == Game.GetPlayer())

			GoToState("Busy")

			PlayAnimationAndWait("Trigger01", "Done")

			GoToState("Opened")

		endif

	EndEvent


	Function Close()

		_Close()

	EndFunction

EndState


; defers open and close commands

State Busy

	Function Open()

		openNext = true

	EndFunction


	Function Close()

		closeNext = true

	EndFunction

EndState

I really don't know what to do from here, I've basically tried to take existing code and change it around to fit my needs, but I can't seem to find a good template.

Also, bonus points, would there be an easy way to make a chest that contains the same items found in other copies of that chest in different cells? For example, if I'm in Cell A with Chest A, and I put an object in that Chest A, and then I go to Cell B and look in Cell B, it'll have that same object. And when an object is removed from B, it's also removed from A. Is there an easy way to do this, or do I have to use Papyrus as well?

Thanks everyone!

Link to comment
Share on other sites

You have that script on all 5 buttons.

You double-click on each button and the tabs on its 'properties', you scroll to the right until you click on the 'script' tab. Select your script in the box and edit the properties.

Change the Int value of 'activatornum' to the values that are used in the script.

"1" for ones button.

"2" for tens button.

ect..

So you're saying that declaring the int activatornum in the button and editing its properties will send that data automatically to the main script to be read?

EDIT: Ok so after reading your response a few times I realized that you meant for the script to go on each button and for the activatornumber to be set on each button individually that way. I tried this, by placing the script on each button I wanted to use, setting the number and setting the outputactivator objectreference. When I tested this, nothing happened. I checked the global variable in-game using the console and it had not changed from 0. What exactly am I doing wrong here?

Edited by Altrunchen
Link to comment
Share on other sites

1. I''m having a little trouble with an activator being used in my house mod.

2. make a chest that contains the same items found in other copies of that chest in different cells?

1. What object are you trying to have animate? What I would do is one of two things, or maybe even both.

a. Extract that object from the meshes folder and bring it up in nifskope and see what animation names are on that object. You have to use the correct animation name for it to animate.

b. If the object is already scripted in the game to animate, look at the scripts that animate it and see what animation name they are using.

Link to comment
Share on other sites

1. What object are you trying to have animate? What I would do is one of two things, or maybe even both.

a. Extract that object from the meshes folder and bring it up in nifskope and see what animation names are on that object. You have to use the correct animation name for it to animate.

b. If the object is already scripted in the game to animate, look at the scripts that animate it and see what animation name they are using.

a.The object is the dwemer door thing in septimus signus outpost that when he mixes all the different bloods that you bring him, it opens up to reveal the oghma infinium. It's closed at first, but when he opens it, it spins multiple times and then opens up like a tunnel going through it. But I've downloaded nifskope to look but I can't seem to find the correct file. I must be looking in the wrong spot because all I see is downloaded mods. Can you give me the most likely path to the correct folder?

b. I've looked through the scripts in the creation kit so many times for things like the quest code and the name of the object and everything. There are no scripts attached to the repository itself, so I'm not sure how it receives the command to open. I think it's from the quest, but either way it's way over my head.

I actually found the correct file and opened it in nifskope, but I have no idea what I'm supposed to be looking at. There's some text about small gears and large gears and gear assemblys?

Edited by revostriker101
Link to comment
Share on other sites

a.The object is the dwemer door thing in septimus signus outpost

I actually found the correct file and opened it in nifskope, but I have no idea what I'm supposed to be looking at. There's some text about small gears and large gears and gear assemblys?

Ok, its an activator and called 'DweRepository01'.

It has no script.

The NPC DA04Septimus has a quest related to him, DA04.

Looking at quest DA04, Stage 55 unblocks the activator.

Alias_OghmaInfinium.GetReference().BlockActivation(false)

But I could not see how the door was opened either. Perhaps when its unblocked, activating it does something to it.

Link to comment
Share on other sites

Perhaps you could upload just your ESP file so we could look at it.

And say what cell, or objects are involved.

You may need to include the scripts as well, since they are seperate files from the ESP.

Well the script is right there and the objects I am using are as follows:

  • Five Dwemer Buttons
  • A Dwemer Partition Door

I'm not sure if that little warrants an upload :L. I guess it never occured to me where the main script should go or perhaps the activation parts of the script are faulty somehow?

Link to comment
Share on other sites

I'm not sure if that little warrants an upload :L. I guess it never occured to me where the main script should go or perhaps the activation parts of the script are faulty somehow?

But the question remains if you setup your references correctly, or did something else that would cause it to not work that an experienced scripter would see.

Link to comment
Share on other sites

Ok, its an activator and called 'DweRepository01'.

It has no script.

The NPC DA04Septimus has a quest related to him, DA04.

Looking at quest DA04, Stage 55 unblocks the activator.

Alias_OghmaInfinium.GetReference().BlockActivation(false)

But I could not see how the door was opened either. Perhaps when its unblocked, activating it does something to it.

But then how do I form the script from that? I didn't even know that line of code was a reference to the DweRepository, rather a reference to the book itself. If I were to send you the exact file of the Repository, would you be able to look at it in nifskope and form some kind of new easier script that would open it?

Link to comment
Share on other sites

@revostriker101 - I see the nif file, and it plays the open animation in nifskope, but there is no animation name on it. So I don't really know how it opens and its been a while since did that quest so I don't remember if the player or the NPC actually initiates opening of it.

Link to comment
Share on other sites

@revostriker101 - I see the nif file, and it plays the open animation in nifskope, but there is no animation name on it. So I don't really know how it opens and its been a while since did that quest so I don't remember if the player or the NPC actually initiates opening of it.

Septimus is the one who opens it. All he does is mix the blood in one spot, turns and walks up to the thing and it opens. It doesn't seem like he makes any movements, it just opens when he walks there.

Link to comment
Share on other sites

  • 2 weeks later...

Hello, I am in need of a script that does the following for my current project.

- a ward spell that will grant the caster 10 health when hit by an enemy spell with a recharge time of 5 seconds on the wards effect.

- If possible i would like the ward to maintain its original mechanics with this just added on.

- if possible the effect should only apply when the ward is fully charged

I have little experience as i have just started learning papyrus. This is Crucial to my project and any help would be greatly appreciated. You will be credited in the mod and i will be using this as a template for other projects as i learn more about Papyrus

Thanks!

Link to comment
Share on other sites

  • 2 weeks later...

Hello it's me again, I am trying to make a simpler script this time and require some assistance in doing so.

What I need is a script that does the following:

  1. Checks the time of day.
  2. Compares that time with user-inputted times to look for.
  3. Disables a linked reference if a certain time is reached.
  4. Enables the same linked reference if the other time is reached.

The script would:

  • Exist on an object.
  • Run all by itself continuously.

Can someone please help me with this?

Here is what I have so far:


Scriptname MODTimeOfDayScript01 extends ObjectReference

{A script intended to enable and disable specific linked references at certain times of the day.}


GlobalVariable property GameHour auto

Int property Time01 auto

Int property Time02 auto

ObjectReference property subject1 auto

ObjectReference property subject2 auto


Event OnCellLoad()

if GameHour.GetValue() >= Time01

  subject1.enable(Fade)

elseif GameHour.GetValue() >= Time01

  subject2.disable(Fade)

elseif GameHour.GetValue() >= Time02

  subject1.disable(Fade)

elseif GameHour.GetValue() >= Time02

  subject2.enable(Fade)

endif

endevent


Oh my god! I tweaked the script a little bit and I actually got it to compile all by myself :D! I am so happy. Thanks for keeping this site up and helping me in the past guys! Thank you so much! If you ever want a logo or sig or anything graphical done for you (within reason) then I am your guy ^^!

Scriptname MODTimeOfDayScript01 extends ObjectReference

{A script intended to enable and disable specific linked references at certain times of the day.}

GlobalVariable property GameHour auto

Int property Time01 auto

Int property Time02 auto

ObjectReference property subject1 auto

ObjectReference property subject2 auto

Event OnCellLoad()

if GameHour.GetValue() >= Time01

  subject1.enable()

elseif GameHour.GetValue() >= Time01

  subject2.disable()

elseif GameHour.GetValue() >= Time02

  subject1.disable()

elseif GameHour.GetValue() >= Time02

  subject2.enable()

endif

endevent

Okay so there is a problem. The objects that the script is attached to are not disabling and enabling when they should. Also, I just realized that this script only happens when the cell is loaded but probably won't refresh while the player is inside the cell. Is there anyway to make it possible for the player to watch the objects switch? Here's the code as it stands now:

criptname MODTimeOfDayScript01 extends ObjectReference

{A script intended to enable and disable specific linked references at certain times of the day.}


GlobalVariable property GameHour auto

Int property Time01 auto

Int property Time02 auto

ObjectReference property subject1 auto

ObjectReference property subject2 auto


Event OnCellLoad()

if GameHour.GetValue() >= Time01

  subject1.enable()

elseif GameHour.GetValue() >= Time02

  subject1.disable()

endif


if GameHour.GetValue() >= Time02

  subject2.enable()

elseif GameHour.GetValue() >= Time01

  subject2.disable()

endif

endevent

Edited by Altrunchen
Link to comment
Share on other sites

'OnLoad' only runs once when the cell is loaded. And it also will not run if your in the cell when you load your game.

'OnInit' will run when the object is initialized (cell load or save game load). But it also only runs once.

You 'could' put a 'while' loop inside the OnInit block to cause it to run continually until the 'when' condition is met.

'OnUpdate' could probably also be used, making sure to set it for an update time.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...