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

:smarty: Smarty says: If your going to request a script, you should be prepared to explain every step you need to happen, down to the smallest details.

Programming requires the minute details in order to do what you want.

And please remember, we are all learning, so we may not know how to do something yet, or it may be impossible to do what you want in script.

Link to comment
Share on other sites

I have more things to do than I have time for. So I am hoping this idea will appeal to someone who has the knowledge to write the script (I don't, yet) and then I can learn from what they write.

I would like to see some automatic clothes swapping done whenever the player enters or exits his home. If it works the way I think it should, it would involve a mannequin, a hidden chest, and the player-enter-exit activator (I forget the exact name). It should be written so it can be enhanced to include the player's follower, if there is one.

When the PC enters the house and the activator fires, the clothing/armor on the PC should go to the hidden chest. The clothing/armor on the mannequin would be worn by the PC, not just placed in inventory. Then the clothing/armor in the chest would be placed on the mannequin.

When the PC exists the house, then the process would reverse itself.

Does this sound doable?

Link to comment
Share on other sites

  • 3 weeks later...

I would like to see an example script for a basic activator that presents choices like:

1) Player activates object

2) Message asks "Would you like to do this?" "yes" "no"

3) If Yes, do something

4) If No, do nothing

If the player chooses yes, the script shouldn't run again if activated later. If they choose no, they should be able to return later and choose yes or no.

Please and thank you. XD

Link to comment
Share on other sites

Hi Rider,

This exact thing is covered in class #1. The 'do once' can be added with a simple variable added to the final script. The class also covers how to create and attach the messages to the script.

int doOnce

EVENT onActivate(objectReference akActionRef)
If ( akActionRef == Game.GetPlayer() && doOnce == 0 )
Button = question.show()
if Button == 0
Yes.show()
doOnce = 1
Game.GetPlayer().AddItem(Gold001, 1000, true)
elseif Button == 1
No.show()
endif
EndIf
endEVENT[/code]

:smarty: [color=#FF0000]Smarty Says:[/color] '==' is a condition check, where '=' sets the left variable name to the value of the right variable name.

Link to comment
Share on other sites

  • 3 weeks later...

I'm trying to get a script working and could really use a hand from someone with a bit more experience. What I need it to do is to keep track of how many of an object has been found but it need to be able to be applied to different objects. I want it to pop up with a message window and say "You have found object 1", "You have found object 2" etc, until the last one is found when it says "Congratulations! You have found the last Object". The script is a modified version of the "hello world" tutorial script, thats how much of a beginner I am. I've tried adding the script to a few different objects and when each is picked up I receive the first message no matter how many I have already picked up. I'm not sure how to make the count keep track when the script is applied to multiple objects and I will also need to figure a way to make the count remain the same if an object is dropped and/or picked back up again. Thanks in advance for any help!

Scriptname ObjectCountScript extends ObjectReference  

{Script to keep track of # of objects discovered}


 int count  ;stores the number of objects discovered


 Event OnActivate(ObjectReference akActionRef)

    count = count + 1


    if count == 1

       Debug.MessageBox("You have discovered your first Hidden Object!")

    elseif count == 2

       Debug.MessageBox("You have discovered your second Hidden Object!")

    else

       Debug.MessageBox("Congratulations! You have found them all!")

    endif

 endEvent

Link to comment
Share on other sites

You're on the right track, but each script has its' own variables (so you'll have 3 different 'count' values).

The easiest way for the 3 items to share the count value is to use a global.

Then add this script to each of your 3 secret objects.


Scriptname ObjectCountScript extends ObjectReference  

{Script to keep track of # of objects discovered}


GlobalVariable Property MyCounter Auto ;You need to create the Global and assign it to this property in the CK


auto State waiting	

	Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)

		if (Game.GetPlayer() == akNewContainer) ; the player has picked up the object

			GoToState("inactive") ; Ensures this only ever happens once

			Int count = Mycounter.Mod(1.0) As Int ; Add 1 and then fetch the total

			if count == 3

				; Woohoo!

			endif

		endif

	EndEvent

EndState


State inactive

EndState

Link to comment
Share on other sites

Hello there I would appreciate some help with a script that doesn't exist and yet still has many other scripts that come close to resembling its function. I have searched high and low for a script that could meet this end, and the closest I could come was a script that would only fire once. I am terrible at programming, but I deeply love making things, especially in the Creation Kit. I am on a mission of mercy here. I am also posting this here because I have a hunch that I'm not the only one who could use a script that would do the following. Please if someone is willing to help, I hope you find this post. I would like it if someone could make a script that:

Activates when:

  • The Player enters a triggerbox.

Plays the special effect:

  • The Eye of Magnus Open Explosion Visual Effect. Or any visual effect of the user's choosing.
  • A sound effect of the user's choosing.

And does this:

  • Every time an actor enters the triggerbox.
  • Or as many times as the user desires.

Link to comment
Share on other sites

Activates when:

  • The Player enters a triggerbox.

Plays the special effect:

  • The Eye of Magnus Open Explosion Visual Effect. Or any visual effect of the user's choosing.
  • A sound effect of the user's choosing.

And does this:

  • Every time an actor enters the triggerbox.
  • Or as many times as the user desires.

Scriptname MyTriggerBoxScript extends ObjectReference  
{Attached to triggerzone}
Sound Property QSTAstrolabeButtonPressX Auto

Event OnTriggerEnter (objectReference activateRef)
if activateRef == Game.GetPlayer()
QSTAstrolabeButtonPressX.Play(Self)
;Depends on what you want to do
endif
endEvent[/code]

This script would be attached to an activator with no mesh. Then create a trigger zone box and attach the activator with the script on it to the trigger zone.

There are Effect Shaders: http://www.creationkit.com/Play_-_EffectShader

And you can use PlaceAtMe if its an 'explosion'.

Link to comment
Share on other sites

Scriptname MyTriggerBoxScript extends ObjectReference  

{Attached to triggerzone}

Sound Property QSTAstrolabeButtonPressX  Auto


Event OnTriggerEnter (objectReference activateRef)

	if activateRef == Game.GetPlayer()

		QSTAstrolabeButtonPressX.Play(Self)

		;Depends on what you want to do

	endif

endEvent
This script would be attached to an activator with no mesh. Then create a trigger zone box and attach the activator with the script on it to the trigger zone. There are Effect Shaders: http://www.creationkit.com/Play_-_EffectShader And you can use PlaceAtMe if its an 'explosion'.
Thank you so very much! I really appreciate it. Let me just see if I understood you though because I'm not entirely sure that I did. Alright so first I need to make a trigger box. Then an activator without a mesh. Which I think means like a primitive that activates itself upon entry. There is, confusingly, a triggerbox that will do this. So I am not sure what you meant exactly. Then I need to place the script you so generously made on the activator box. And "attach" it, I can only assume that means using the option that says "Attach refernce" on the properties window. Is that correct? Then in order to set up the effects that I want I will need to select the sound in the script properties tab, as well as write in a property for the explosion data with [*********.Play.(PlaceAtMe)]. Do I have this correctly understood? Thanks again for helping me this far already. EDIT: Alright so I got it to work perfectly. Thank you so much. Here let me try to copy and paste the script...
Scriptname MODPlayEffectonEnterTrigger extends ObjectReference    

{Attached to triggerzone}


Sound Property QSTAstrolabeButtonPressX  Auto

Explosion Property MGEyeOpenExplosion Auto


Event OnTriggerEnter (objectReference activateRef)

        if activateRef == Game.GetPlayer()

                QSTAstrolabeButtonPressX.Play(Self)

			placeAtMe(MGEyeOpenExplosion)

                ;Depends on what you want to do

        endif

endEvent

Again thank you so much. You're a life-saver. If there's anything you ever need from me, just ask.

Edited by Altrunchen
Link to comment
Share on other sites

I am trying to do a "fists of steel" fix. So far I have an ok armor rating calculator and to continue I would would need two script functions

1 that adds a bonus to unarmed damage for the player equal to some integer set in the script

2 one that removes the above bonus

Any help would be much appreciated

Edited by Bomaz
Link to comment
Share on other sites

I can't seem to figure this stuff out at all. Can anyone help me with creating a script that does this?

When I select or equip a particular item in my inventory I want the player controls to be disabled while the camera perspective changes to third person and the player performs a certain animation. Then after the animation plays for a few seconds it switches back to first person and enabled controls. Sort of like how the pick ax works with mining.

Thanks!

Link to comment
Share on other sites

  • 3 weeks later...

Requests thread is ok.

I need a script (maybe there is another way to do what I want, but I don't know) for npc (1) and for npc's group (2). The 1 simply runs in a straight line (forward), the 2 trying to catch him.

The group consist of 4-5 npc.

And also, the same with npc and group of creatures.

Thanks.

Link to comment
Share on other sites

Hello I could use some help with a script if you don't mind?

You see I am trying to make a script that functions as a sort of combination locking mechanism.

What this script does (in theory) is utilize four input activators that enter in integers of 1, 10, 100, and 1000 respectively upon activation. In addition to the input switches an entry-reset switch would also be involved in the script in case the user made an error in entry. Furthermore, the script would compare the entry with the creator-defined combination and if the combination was correct then it would activate an object reference of the creator's choosing.

I might also add that it would be preferable if the activators, combination, and so forth could be edited outside of the "edit-source" option for the sake of ease-of-use.

I am still quite a noob at this so any and all help would be greatly appreciated!

Here is a copy and paste of what I have attempted so far:

Scriptname MODCombinationLockTest01 extends ObjectReference  

{Test stage script for the combination lock concept.}


ObjectReference Property inputones auto

ObjectReference Property inputtens auto

ObjectReference Property inputhundreds auto

ObjectReference Property inputthousands auto

ObjectReference Property resetactivator auto

ObjectReference Property outputactivator auto

Int Property combination auto

Int entrynumber = 0

Int entry = 0


;What would happen if the object called inputones was activated

Event OnActivate (ObjectReference akActionRef)

	entry = entry + 1

	entrynumber = entrynumber + 1

EndEvent


;What would happen if the object called inputtens was activated

Event OnActivate (ObjectReference akActionRef)

	entry = entry + 10

	entrynumber = entrynumber + 1

EndEvent


;What would happen if the object called inputhundreds was activated

Event OnActivate (ObjectReference akActionRef)

	entry = entry +100

	entrynumber = entrynumber + 1

EndEvent


;What would happen if the object called inputthousands was activated

Event OnActivate (ObjectReference akActionRef)

	entry = entry +1000

	entrynumber = entrynumber + 1

EndEvent


;What would happen if the object called resetactivator was activated

Event OnActivate (ObjectReference akActionRef)

	entry = entry * 0

	entrynumber = entrynumber * 0

EndEvent


;The section that would read the entry and compare it to the combination

if (entry == combination)

	activate.outputactivator()

elseif (entry != combination)

	entry = entry * 0

endif

Here is the copy and paste of the error report:

Starting 1 compile threads for 1 files...

Compiling "MODCombinationLockTest01"...

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(21,0): script event onactivate already defined in the same state

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(27,0): script event onactivate already defined in the same state

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(33,0): script event onactivate already defined in the same state

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(39,0): script event onactivate already defined in the same state

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\MODCombinationLockTest01.psc(45,0): missing EOF at 'if'

No output generated for MODCombinationLockTest01, compilation failed.

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

Failed on MODCombinationLockTest01

Link to comment
Share on other sites

You can only have one 'OnActivate' event in a single script (or as it says, in a 'State') You could proabably put them all inside one OnActivate block.

How do you know which 'button' is being activated? I so no condition checks in your script. You have a comment saying such, but there is no logic to back the comment up.

Link to comment
Share on other sites

You can only have one 'OnActivate' event in a single script (or as it says, in a 'State') You could proabably put them all inside one OnActivate block.

How do you know which 'button' is being activated? I so no condition checks in your script. You have a comment saying such, but there is no logic to back the comment up.

Alright so I combined the if statements into one event, that I understand how to do...I think. But I do not know what exactly you mean by a condition check unfortunately. What exactly do you mean?

Scriptname MODCombinationLockTest01 extends ObjectReference  

{Test stage script for the combination lock concept.}


ObjectReference Property inputones auto

ObjectReference Property inputtens auto

ObjectReference Property inputhundreds auto

ObjectReference Property inputthousands auto

ObjectReference Property resetactivator auto

ObjectReference Property outputactivator auto

Int Property combination auto

Int entrynumber = 0

Int entry = 0



Event OnActivate (ObjectReference akActionRef)


	if activateRef == inputones

        	entry = entry + 1

        	entrynumber = entrynumber + 1

	endif


	if activateRef == inputtens

       		entry = entry + 10

        	entrynumber = entrynumber + 1EndEvent

	endif


	if activateRef == inputhundreds

        	entry = entry +100

        	entrynumber = entrynumber + 1

	endif


	if activateRef == inputthousands

        	entry = entry +1000

        	entrynumber = entrynumber + 1

	endif


	if activateRef == resetactivator

		 entry = entry * 0

        	entrynumber = entrynumber * 0

	endif


EndEvent


if (entry == combination)

        activate.outputactivator()

elseif (entry != combination)

        entry = entry * 0

endif

Link to comment
Share on other sites

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.

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...