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

1. There are probably lots of ways, and some better than what I know to do.

So, does the guard just 'show up' as soon as you have the 4 items, or after you do something with them?

I would probably make an altar workbench activator that assembles the armor into the guard when 'activated'.

2. Enable objects. You need to link the object to the MyObjectREF property.

MyObjectREF.Enable()

Link to comment
Share on other sites

And here's what i've done:

HealthsoundsSkript extends ObjectReference

ITEM property MyArmor auto

SOUND property 75%sound auto

float playersHealth = Game.GetPlayer().GetActorValuePercentage("health")

if (Game.GetPlayer().IsEquipped(MyArmor))

if (playersHealth = 0.75)

int Function Play(75%sound)

End

i dont know is it working cause i can't access CK now :/ but i dont think so. I dont even know are ITEM and SOUND working property types :S

Link to comment
Share on other sites

Look at the Beginners Scripting tutorial.

You will need an 'event'.

My guess here is you probably want a quest script running instead that checks if the player has the armor equipped, and if so, check the health, and if necessary play the sound.

You will also need a delay in the sound playing or it will play the sound every time you set the quest script to run.

Link to comment
Share on other sites

@WillieSea

First off, thank you for responding.

You give the quest giver the four items, then he spawns the guards. But funny you should mention the altar because I have four alters that he sandbox's too. I have no idea how to script this. If you can, please do. Give me your steam id or whatever you like and I'll give you credit on the mod site both nexus and steam. Also I would make the character in game who offers to make guards named after you, or any name you would like.

I'm not sure how to move forward, but I'd be fine with making an altar do the work. I dont care how really, I just want the quest collection items to be able to be turned into someone or something so we can spawn the guards.

Thanks for your help.

PS

I already added a link to this site and credit on my mod site.

Edited by Hannibalektr
Link to comment
Share on other sites

Well, I don't really have time. I have a large family I support, lots of work and stress in my life. I can guide you along and the beginners tutorial will give you what you need to create an activatable 'altar' type of script where you can do things.

If you already have dialog quests setup, you can put scripts in there that checks for the items, and if the player has them, gives the option to 'create a guard' or what-ever. I cannot help with that though since I never have created dialog or much for quests for that matter.

You don't need events in a quest/dialog 'script fragment'. If the dialog option runs, it runs the script which would basically remove the items from the player and spawn the guard.

RemoveItem can be used to remove the parts from the player.

You already have the PlaceActorAtMe to spawn the guard.

As for how to setup the quests or dialog, I could not help there.

Edited by WillieSea
Link to comment
Share on other sites

What is this script placed on?

What portcullis are you talking about?

Please give the object name from the CK for both questions above. :)

I thought this request was deleted. Ok, so the code you see was used for the blackreach dwemer lock (which is an activator). Problem is that the animation for this only plays once. I want the animation to play every time you activate it.

The dwemer lock is going to be attached to a portcullis so this will take the place of a pullchain to activate a door or portcullis.

Link to comment
Share on other sites

**Request**

Hello everyone. I need a hand with another script. This should be an easy one but I can't seem to figure it out on my own. All I want to do is have two sentence appear in a message box on two different lines.

I want it to look this this:

This is the first sentence.

This is the second sentence.

Not like this:

This is the first sentence. This is the second sentence.


Scriptname MessageBoxDescriptionSCR extends ObjectReference

Event onactivate(ObjectReference akActionRef)

Debug.MessageBox("This is the first sentence. This is the second sentence.")

endEvent

Link to comment
Share on other sites

**Request**

Hello everyone. I need a hand with another script. This should be an easy one but I can't seem to figure it out on my own. All I want to do is have two sentence appear in a message box on two different lines.

I want it to look this this:

This is the first sentence.

This is the second sentence.

Not like this:

This is the first sentence. This is the second sentence.


Scriptname MessageBoxDescriptionSCR extends ObjectReference

Event onactivate(ObjectReference akActionRef)

Debug.MessageBox("This is the first sentence. This is the second sentence.")

endEvent

I am pretty sure you can add manual line breaks with

\n

It should work. :)

  • Upvote 1
Link to comment
Share on other sites

  • 5 weeks later...

Hey! I have a script that works, but as I expand my mod, I am realizing that I need to make it more adaptable.

The current script is connected to a Magic Effect so that when the spell is cast it swaps one item for another.

 

Scriptname DragonPriestRobesAbjEffectSCRIPT extends ActiveMagicEffect 

{Swaps cursed robes for the real robes}

 

EVENT OnEffectStart(Actor Target, Actor Caster)

      

       selfRef = game.getPlayer()

      

       if game.getPlayer().IsEquipped(curse1)

             Debug.Trace("The player has a cursed robe equipped")

                    game.getPlayer().RemoveItem(curse1)

                    game.getPlayer().EquipItem(clean1)

   

       

Instead I want to make a script that is attached to items and when the spell is cast it checks for a keyword.

 

This is what I wrote but its not working yet

 

EVENT OnEffectStart(Actor Target, Actor Caster, MagicEffect akEffect)

       ; selfRef = game.getPlayer()

if akEffect.hasKeyword(Filter) == TRUE <-- keyword is on a spell that when applied to player fulfills this condition.

game.getPlayer().AddItem(NewItem, 1, true)

game.getPlayer().RemoveItem() <-- should be the item that this script is attached to.

endIf

endEVENT 

 

 

Thanks!

Edited by edhelsereg
Link to comment
Share on other sites

I have a request for some advice about scripting. I scripted quite a bit for Oblivion, and yes I know that Skyrim does NOT use the same syntax. This is more about processing limits.

 

I want to build an interior room with 256 objects that all move up ( or down ) at the same time, random distance, random speeds. A global script will trigger when they need to move, and which direction. Each object's script will therefore set the random speed, and of course move the object to which it is attached. I know how to do all of this, but any advice from the pros would be appreciated.

 

My real question is: Will Skyrim handle all the scripts running at once? Will the script handler choke, stutter, spew, smoke or otherwise fail?

 

Yes, yes... the easy answer: Write the code, make the Mod, and find out. But if someone already knows that this effort would be destined to failure, a heads-up would be nice.

 

Aternatively, the NIF of each object could theoretically contain the move as "animation", tho I think this would rule out random speed, and each "random" distance would need to be a different animation, limiting the definition of "random" :)

 

Each object would still run its own script, and randomly select a distance (aka animation) once triggred by the global script, which still decides direction. But the scripts on each object wouldn't need to process a "SetPos Z fPortionOfDistance" each frame, saving some processing. Instead calling PlayAnimation(string asAnimation) and calling one of perhaps 10 possible animations.

 

Thanks for your time, and advice...

-DEJ

Edited by Dejunai
Link to comment
Share on other sites

@edhelsereg - What is 'Filter' and how is it defined?
RemoveItem requires an object reference. The attached script would replace the game.getPlayer() prefix, not what would go in the parenthesis.
 

 

@Dejunai - Scripts run a lot different in Skyrim than they did in the previous game engines.
They do not run once per FPS frame anymore, they sort of run when they can. I have scripts that take 15 seconds to run through once. So keep that in mind when your making scripts.
You also no longer need to use 'animations' to move items, or run loops to move your object a little at a time. We have a new command which takes care of it for you, in any direction, at any speed, and you only call the function once. You can even make the object spin if you whant, while its moving to face a different direction.
I use this command on my clock hands to handle the entire movement sequence with ease.
Check it out: http://www.creationkit.com/SplineTranslateTo_-_ObjectReference

Edited by WillieSea
Link to comment
Share on other sites

@edhelsereg - What is 'Filter' and how is it defined?

RemoveItem requires an object reference. The attached script would replace the game.getPlayer() prefix, not what would go in the parenthesis.

 

Thank you for your response. 'Filter' is a Keyword Property, the idea being if the spell has the keyword, the 'if' condition will be fulfilled.

Is it possible to write a script that tells the item it is attached to to delete/remove itself at the end of the event? How would I write that?

Edited by edhelsereg
Link to comment
Share on other sites

I believe there are issues with scripts running on objects that try to delete themselves. But I have not tested that, its just what I heard about.

If I am not too badly mistaken, there are also issues with equipped stuff. When something is equipped, its now part of the player skeleton and may have issues running.

 

The old scripting language had a 'getSelf' command, but it does not exist in papyrus. There may be work arounds but I am not sure off the top of my head what they would be.

 

If your going to put the script on the armor, then I would add a property to the armor, that points to its base self, so you know right there in the script what type of armor the script needs to remove. You could also have a property for the armor you want it to replace. This way, one script would take care of ALL your different armors your going to place the script on.

Link to comment
Share on other sites

I know this is taking on a bit more, but I have an idea I really want to make happen. I want to make a rune spell with a scripted effect that triggers only when a specific Item is placed on/near the rune. I designed a custom rune spell decal, but I'm not sure how to customize the spell to work the way I want it to.

uOTKSBE.jpg?1

Is it possible to change what triggers/sets off a rune? Can spells actually apply to things like misc items or armor? Are there work-around if not. I still think it is a good idea of using a keyword on the spell or item to meet conditions. The spell should work like so;

A special rune is cast on a surface and when a specific item comes into contact with it, the rune explodes, and the item swaps with a new version of it.

Edited by edhelsereg
Link to comment
Share on other sites

Hi TESA!

 

I am currently trying to make a lightable campfire that over time changes states into being less lit until it is just an ash pile. I already have the activator and models to switch ready in the CK, all I need is the script... but that's where I'm stuck at.

 

What I precisely need is:

 

1. Whenever the campfire is activated, it switches model from whatever state it was previously to state1.

2. After 2 hours, switches model to state2. After 2 hours, to state3. After 2 hours, to state4.

3. The campfire can be activated any time during states 2-4. If campfire is activated during state1, a message appears.

 

Of course I want there to be a requirement if the player has enough firewood in their inventory, but I can add that myself.

 

Thanks for the help, I'm really stuck here!

Link to comment
Share on other sites

Tonycubed2 has not been around in quite a while. I personally don't have time to write scripts for everyone as its very time consuming. I am willing to help you out should you get stuck though.

 

@edhelsereg - You need to do some research. Check the rune spell, see what magic effect it uses. Then check the magic effects, see what its doing. There may be a script or a formlist of what will setoff a rune, but I am guessing its a script checking for 'actors' distance.

 

@bleakraven - You need to use the time functions. As to how you get it to update, your best bet may be to make a quest script so its running when necessary, and that is not exactly an easy thing to do.

You will then need some global variables in your script:

GlobalVariable Property GameHour  Auto
GlobalVariable Property GameDay  Auto
GlobalVariable Property GameDaysPassed  Auto

 

You use GetValue to get the information from these globals.

float myDay = GameDay.GetValue()

 

You then use math calculations to determine how much time has passed. Remember, past midnight the hour becomes less, so you have to take into account the changing of the day as well.

 

You can then enable and disable the fireplace pieces based on your calculations.

Edited by WillieSea
Link to comment
Share on other sites

How can I link it to a quest script and still have it hidden from the log? :s
 
I currently have this script and it works, but I understand I made it in a very dodgy way... It works as intended except that I can't interrupt the ongoing FadingAway() stage when the player re-activates the campfire... Is there a way to interrupt/stop/restart a function?

Scriptname aBleakCampfireScript extends ObjectReference  
{Script for the custom campfire}

ObjectReference Property stage1 Auto ;Fully Lit
ObjectReference Property stage2 Auto ;Going down
ObjectReference Property stage3 Auto ;Embers
ObjectReference Property stage4 Auto ;Ash

GlobalVariable property NumberOfWood Auto
MiscObject Property ItemToRemove Auto

Message property NotEnoughWoodMessage Auto


Event OnActivate(ObjectReference akActionRef)
		if (Game.GetPlayer().GetItemCount(ItemToRemove) == 2)
			Game.GetPlayer().RemoveItem(ItemToRemove, 2)
			stage2.Disable()
			stage3.Disable()
			stage4.Disable()
			stage1.Enable()
			StartFading()
			float currentStage = 1
			float timeofactivation = Utility.GetCurrentGameTime()
		Else
			NotEnoughWoodMessage.Show()
		EndIf
EndEvent

Function StartFading()
	Utility.WaitGameTime(2)
	stage2.Enable()
	stage3.Disable()
	stage4.Disable()
	stage1.Disable()
	Utility.WaitGameTime(2)
	stage2.Disable()
	stage3.Enable()
	stage4.Disable()
	stage1.Disable()
	Utility.WaitGameTime(2)
	stage2.Disable()
	stage3.Disable()
	stage4.Enable()
	stage1.Disable()
EndFunction
[/spoiler]

Edited by bleakraven
Link to comment
Share on other sites

Why would you have a log with a quest script?

 

I would guess you cannot interrupt a 'WaitGameTime' function. That is why I suggested the quest script and checking the time yourself. You can then interrupt it any time you want because your not relying on a hard-coded function to keep track of the time for you.

Link to comment
Share on other sites

I need a script that adds a kill order from the Thalmor like they put on the player for the character (Norine Gludersdottir, The escaped Thalmor prisoner.)

 

A plus would be that she attacks any Thalmor escorting other prisoners on site.

 

Thank you in advance for any assistance or advice you may give. 

Link to comment
Share on other sites

I don't know who 'Norine Gludersdottir' is so am not familiar with what a 'kill order' is in this context.

 

Attacking would be controlled by factions on the NPC.

I am sorry if I was unclear. :Norine Gludersdottir' is another of my standalone mods, not yet released. 

 

After the quest 'Diplomatic Immunity' is finished the Thalmor send Justiciars to kill the Dragonborn. They have a note saying he is well armed and dangerous. I would like this to happen to the character in my mod as well as the Dragonborn. The other request, was for my mod character to automatically attack Thalmor escorting prisoners. This part is not really necessary, and on reflection, may be game breaking. So I do not need any script to attack the Thalmor.

 

Thank you for any help or advise you may give. 

Link to comment
Share on other sites

You can just create a regular note for your NPC, since it never changes.

 

If you look at the wanted notes, you will see it contains bracketed information, which is replaced with the 'in-game' value of the name. There are other bracketed texts for 'him/her' gender names as well if you need it. I remember seeing that and other replacers on the wiki a while ago. Can't remember where though.

  • Upvote 1
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...