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

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

Do you mean something like this?


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 OnUpdate(30)

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

By the way, I just found your mod "Leveller's Tower"...holy crud dude! That was mind-blowingly cool!

Link to comment
Share on other sites

  • 3 weeks later...

You cannot give 'OnUpdate' a number. You must register it for update.

http://www.creationk...OnUpdate_-_Form

Alright so the good news is that the AM light (subject01) was activated but it wouldn't switch over to the PM light (subject02) when the game time reached 12:00. I tried fiddling with the if statements but it still hasn't produced the results I'm looking for.

I also changed the times from Int to Float because the Global Variable uses float and not int. Was this a good idea or should I have left them at int?


Scriptname MODTimeOfDayScript01 extends ObjectReference

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


GlobalVariable property GameHour auto

Float property Time01 auto

Float property Time02 auto

Float property Time03 auto

ObjectReference property subject1 auto

ObjectReference property subject2 auto


Function StartChain()

RegisterForSingleUpdate(1)

EndFunction


Event OnUpdate()

if GameHour.GetValue() >= Time01 && GameHour.Getvalue() < Time02

  subject1.enable()

elseif GameHour.GetValue() >= Time02

  subject1.disable()

endif


if GameHour.GetValue() >= Time02 && GameHour.GetValue() < Time03

  subject2.enable()

elseif GameHour.GetValue() == Time03

  subject2.disable()

endif

endevent


It occurs to me that I don't even need all those "elseifs" so I took them out, but it still isn't working, anyone have any ideas why?

Scriptname MODTimeOfDayScript01 extends ObjectReference

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


GlobalVariable property GameHour auto

Float property Time01 auto

Float property Time02 auto

Float property Time03 auto

ObjectReference property subject1 auto

ObjectReference property subject2 auto


Function StartChain()

RegisterForSingleUpdate(1)

EndFunction


Event OnUpdate()

if GameHour.GetValue() >= Time01 && GameHour.Getvalue() < Time02

  subject1.enable(true)

else

  subject1.disable(true)

endif

if GameHour.GetValue() >= Time02 && GameHour.GetValue() < Time03

  subject2.enable(true)

else

  subject2.disable(true)

endif

endevent

Edited by Altrunchen
Link to comment
Share on other sites

RegisterForSingleUpdate only runs one time.

'Single' implies only one time.

Had the hour been night, the one time it ran would have set the night lights instead.

What you probably want is this: (Please read its description for usage)

http://www.creationkit.com/RegisterForUpdate_-_Form

But I wonder how you are executing the function you call 'StartChain'?

I prefer using

Event OnInit()

http://www.creationkit.com/OnInit

Link to comment
Share on other sites

RegisterForSingleUpdate only runs one time.

'Single' implies only one time.

Had the hour been night, the one time it ran would have set the night lights instead.

What you probably want is this: (Please read its description for usage)

http://www.creationk...orUpdate_-_Form

But I wonder how you are executing the function you call 'StartChain'?

I prefer using

Event OnInit()

http://www.creationkit.com/OnInit

Ok so here is what I came up with:


Scriptname MODTimeOfDayScript01 extends ObjectReference

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


GlobalVariable property GameHour auto

Float property Time01 auto

Float property Time02 auto

Float property Time03 auto

ObjectReference property subject1 auto

ObjectReference property subject2 auto


Event OnInit()

RegisterForUpdate(18)

GotoState ("ticking")

EndEvent


State ticking

Event OnUpdate()

if GameHour.GetValue() >= Time01 && GameHour.Getvalue() < Time02

  subject1.enable(true)

else

  subject1.disable(true)

endif


if GameHour.GetValue() >= Time02 && GameHour.GetValue() < Time03

  subject2.enable(true)

else

  subject2.disable(true)

endif


endevent

endstate

What is happening is that the first light turns off as it should but the second one doesn't turn on. EDIT: Okay so I figured using states might make things easier and I only now just set one to being an auto state, but I doubt this will work the way I want it to. This script is on a blank trap linker and the purpose is to enable and disable certain lights at certain times of the day, just in case you were wondering what this was for.

Scriptname MODTimeOfDayScript01 extends ObjectReference

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


GlobalVariable property GameHour auto

Float property Time01 auto

Float property Time02 auto

Float property Time03 auto

ObjectReference property subject1 auto

ObjectReference property subject2 auto


Event OnInit()

RegisterForUpdate(18)

GotoState ("check")

EndEvent


auto State check


Event OnUpdate()

if GameHour.GetValue() >= Time01 && GameHour.Getvalue() < Time02

gotostate ("am")

elseif GameHour.GetValue() >= Time02 && GameHour.GetValue() < Time03

gotostate ("pm")

endif

endevent

endstate


State am


Event OnBeginState()

if GameHour.GetValue() >= Time01 && GameHour.Getvalue() < Time02

  subject1.enable()

gotostate ("check")

else

  subject1.disable()

gotostate ("check")

endif

endevent


endstate


State pm


Event OnBeginState()

if GameHour.GetValue() >= Time02 && GameHour.GetValue() < Time03

  subject2.enable()

gotostate ("check")

else

  subject2.disable()

gotostate ("check")

endif

endevent


endstate

IT WORKS :D!!!!!!!!!!!!!!! I'm so happy, thank you so very much yet again WillieSea! Here's the working code:

Scriptname MODTimeOfDayScript01 extends ObjectReference

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


GlobalVariable property GameHour auto

Float property Time01 auto

Float property Time02 auto

Float property Time03 auto

ObjectReference property subject1 auto

ObjectReference property subject2 auto


Event OnInit()

RegisterForUpdate(18)

GotoState ("check")

EndEvent


auto State check

Event OnUpdate()

if GameHour.GetValue() >= Time01 && GameHour.Getvalue() < Time02

gotostate ("am")

elseif GameHour.GetValue() >= Time02 && GameHour.GetValue() < Time03

gotostate ("pm")

endif

endevent

endstate


State am

Event OnBeginState()

if GameHour.GetValue() >= Time01 && GameHour.Getvalue() < Time02

  subject1.enable()

subject2.disable()

  gotostate ("check")

else

  subject1.disable()

gotostate ("check")

endif

endevent

endstate


State pm

Event OnBeginState()

if GameHour.GetValue() >= Time02 && GameHour.GetValue() < Time03

  subject2.enable()

subject1.disable()

  gotostate ("check")

else

  subject2.disable()

gotostate ("check")

endif

endevent

endstate

Edited by Altrunchen
Link to comment
Share on other sites

Problem: Attempting to set up a courier to deliver a note, thus to begin a quest. Followed

<that tutorial, but it's not working.

The situation is as follows: The courier appears, tells me he has a letter for me, but no item is exchanged.

Link to comment
Share on other sites

Hi,

I am fairly new to this, but am trying to set up a quest. I have created a player house, but did not want it to be that easy. I wanted people to have to clear the house of bandits before they could have it.

The house has 9 leveled bandits in it and I want to set up a script that will move to the next stage/objective when all of the are dead.

I have never used papyrus (or any other Fallout/oblivion) type scripts until a few days ago, but know VB/DOS/Powershell, so am not a total noob when it comes to scripting. That means I can (almost) follow the logic through on a script, but do not know the scructure/syntax for doing things that I cannot already find on the web.

I have set up the 9 leveled actors as aliases, and thought that I could attache the following to all of them as as they died the Global Variable would just count up and then when all 9 were dead, it would move on.

Am I going about this the wrong way, or have I just got some tweeks to make?

Script is as follows:

================

Scriptname SpoonLLKillAllHouseEnemies extends ReferenceAlias

Quest Property SpoonLLSCRescueQuest Auto

GlobalVariable Property SpoonLLEnemyDead Auto

auto State waiting

Event OnDeath(Actor killer)

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

If count == 9

SpoonLLSCRescueQuest.SetObjectiveDisplayed(50)

SpoonLLSCRescueQuest.SetStage(50)

Endif

EndEvent

EndState

State inactive

EndState

Link to comment
Share on other sites

Managed to do it in the end:

Scriptname SpoonLLKillHouseStorm extends ReferenceAlias

Quest Property SpoonLLSCRescueQuest Auto

Actor Property E1 Auto

Actor Property E2 Auto

Actor Property E3 Auto

Actor Property E4 Auto

Actor Property E5 Auto

Actor Property E6 Auto

Actor Property E7 Auto

Actor Property E8 Auto

Actor Property E9 Auto

Int Property EnemyDeadCount Auto

Event OnDeath(Actor killer)

If E1.IsDead() == True

EnemyDeadCount = EnemyDeadCount + 1

EndIf

If E2.IsDead() == True

EnemyDeadCount = EnemyDeadCount + 1

EndIf

If E3.IsDead() == True

EnemyDeadCount = EnemyDeadCount + 1

EndIf

If E4.IsDead() == True

EnemyDeadCount = EnemyDeadCount + 1

EndIf

If E5.IsDead() == True

EnemyDeadCount = EnemyDeadCount + 1

EndIf

If E6.IsDead() == True

EnemyDeadCount = EnemyDeadCount + 1

EndIf

If E7.IsDead() == True

EnemyDeadCount = EnemyDeadCount + 1

EndIf

If E8.IsDead() == True

EnemyDeadCount = EnemyDeadCount + 1

EndIf

If E9.IsDead() == True

EnemyDeadCount = EnemyDeadCount + 1

EndIf

If EnemyDeadCount == 9

SpoonLLSCRescueQuest.SetObjectiveDisplayed(50)

SpoonLLSCRescueQuest.SetStage(50)

Endif

EndEvent

Link to comment
Share on other sites

Hello, I am trying to make a staff that does the following:

  • Enable the user to activate something from afar without being within normal activation range.
  • Works when a magic effect is used, fire and forget.

This would work as such:

  1. The player equips the staff.
  2. The player finds something far away to activate using their reticule.
  3. The player uses the staff while it is aimed at the object.
  4. The object is then activated.

My theory is that:

  • A script extending a magic effect could achieve this.
  • Said script would need to somehow receive the information of what the player's reticule is aimed at.
  • Said script would need to be versatile enough so that it could activate both an actor or an object.

What I do not know is:

  • How do I get a script to read the information that corresponds to what the player is aiming at?
  • If I can get said information, how do I set up the script so that said information can be used to activate the target remotely?

Any and all help would be appreciated.

Edited by Altrunchen
Link to comment
Share on other sites

Telekenisis spell.

Telekenisis spell.

That was my first thought as well. But the problem with using the telekinesis spell is that it does not activate both actors and objects alike from afar, it merely picks up certain kinds of objects and either throws them away or adds them to your inventory.

Basically what I am trying to do is make an enchantment that allows the player to activate anything from a door to an item all the way to an actor just like using the 'E' key up close.

Link to comment
Share on other sites

  • 2 weeks later...

i have the impression that my last post lost coz of a mistake of mine, sorry if idid doublepost

in need hel pwith a scripts since im a big noob in scripts about a aoe spells like a custom bat cloak to draw agression from npcs hostile, and ofc nondead

any idea how it should look like? extends magic effects reference to?

and im not sure how it will start

start effect

if

isdead=ignore

else

force actors=hostile=area25

attack actor=companionnamehere

can you help me please? thanks in advance:)

Link to comment
Share on other sites

I've been trying now for a week straight to script a very specific and involved spell. I'm new to scripting in general and very new to papyrus. I've read a dozen tutorials and they all seem to be written for more advanced programmers. Can someone show me a script that lets you when you hit someone, force them into a paired animation?-Normal animations I can do fine, but paired animations are a nightmare.

I also have FNIS and SKSE installed, hoping that it will make things a little easier. Paired animations can't be done with just the vanilla CK. FNIS provides infrastructure to trigger paired animations but I can't figure it out.

I want to make a spell that when cast on someone it forces them into an animation (if they have it). In this case it's going to be a decapitation spell.

I'd appreciate any help that can be provided in this quest.

Link to comment
Share on other sites

What i ment is , Lets say we a spesific companion, that have have aoe spells, and want to make her take aggresion of the npcs that are hostile off the player and other companions and attack the <<Tank >>companion instead , basicaly to make the companion a tank,

so...

1:) this can be done by a actor script, or magic effect exept script to her spells?

2:) how the scipt should look like? do i need to tell (with scipt language ofc) when combat starts and combat ends? and inside that to tell what to do when combaty starts?

or this dosent needed?

3:) how the script should start? start event ?

4:) but most importantly i need help abou the part that make that spell (fireballfor example) to force all hostile npcs to attack the companion (that has the aggro spell only ofc)

so how agression is in scipting language? agg ? agg up aggdown ?

thanks in advance i know im a noob in scipts

Link to comment
Share on other sites

I am trying to make a spell that will teleport me and the target i am aiming at to a custom build room in which the target would be placed in shackles and i get to torture and kill them. The idea is to mimic the genjetsu from the naruto anime. has anyone got any idea how to write a script for something like this?

I can make the spell and the room. I just need the script.

Is there a way to make the the spell teleport me back to the place i was when i cast it again (while in the room)? if not maybe make it time based, 1 min for example.

Link to comment
Share on other sites

Greetings!

My mod is on the verge of releasing, and I had a few requests for some essential scripts.

I have no papyrus experience, and minimal java. So I can discern a little of what is going on.

Any help getting these working is greatly appreciated. I am happy to post the scripts once they are completed to promote the bettering of Skyrim's modding community.

The effects I want are as follows:

Script #1:

Description: Empties containers upon striking them.

Player strikes container with weapon.

Container disappears as it's contents are expelled from it (like how the player drops items from his inventory)

A Light is attached to each item upon leaving the container.

Container respawns 168 hours later.

or

Player strikes container with weapon.

Container disappears, as it's contents are added to the player's inventory.

Container respawns 168 hours later.

Also require a similar script but instead of striking the container, just activating it.

Script #2:

Description: Adds object in the place of a teleporting player.

Player casts spell.

Player is teleported to object. (i have all this so far)

Object is created at both the player's old and new location.

Activating one of those objects teleports the player to the same object at the player's old location.

Both objects are removed after arriving back at old location.

Script #3:

Description: Adds a randomized "count" to a LCharacter List.

By default, the "count" is one per marker. You cannot change this value in the CK. I've tried using TesSnip, and the only value I could see was "chance for none", regardless, it seems that you can only choose a single value, and I want many. Any ideas?

Script #4:

Description: Attach the enchanted weapon recharge effect to a dialogue option.

Player engages conversation with NPC

Player selects "Charge my Weapon"

Player's equipped weapon is recharged (unequipped, then reequipped, or however it will work)

Item's maximum enchantment value is decreased by 10%

Script cannot be run for 24 hours.

Script #5:

Description: Follower disables any traps by being told to via dialogue. Instead of just setting it off for you, actually removing the trap's function.

Player engages in conversation with Follower.

Player selects "Disable that Trap", and direct Follower to trap (like you would order a follower)

Follower approaches trap, and interacts with it, without setting off the trap.

Script #6:

Description: Bestow random enchantment with a random enchantment value, with a higher chance of getting a higher quality enchantment depending on how high the player's level is.

Complicated :)

Run script from dialogue choice, or spell.

Prompts you to select specific weapon/armor from menu (These weapons will have a special keyword).

Bestow random enchantment with random value, the enchantment and value are effected by keywords associated with the items.

I think that's all of them :D For now

Link to comment
Share on other sites

@Demojen - I have no clue about 'paired animations'.

@razien - I would probably use a magic effect tied to an enchantment in an 'explosion' object. Perhaps check if they are in combat with the player, and if so, make them in combat with your 'tank'.

Or you could just make your 'tank' more agressive, and they will start combat first, which will make the enemies also initiate combat with the tank.

As for the particulars, the language is still new and we are all still learning, so I could not say what can be done... And cant.

@nmo1990 - You could make a projectile with an magic effect that points to a script. The script would teleport the target of the magic and the player. As for 'forcing' then into the shackles, I supose there are probably animations you play on them to force that. As for returning, you can place a XMarkerHeading at the player location before you teleport, and then you can teleport back to it when your done.

@TripleSixes - I am not sure how you would go about the first script, it would be a rather difficult task since scripts would not sun unless they are loaded with the cell.

For script 2, not sure I follow you. Is this like a Mark and Recall spell?

For script 3, I dont follow you. There are random number generators that work for any number. If your taking about a leveled character list, I don't think you can change those properties on the fly.

For script 4, there is not function to change the enchantment level of items. You might be able to recharge by force equipping an added soulgem. Any timer funtions would have to be added by the script before it does the recharging.

For 'dialog' 5, no clue. Perhaps like you can tell followers to unlock doors and stuff... I don't dabble in dialog.

For script 6, enchantment like on a weapon? I dont know if you can add enchantments via script to weapons.

Edited by WillieSea
Link to comment
Share on other sites

@TripleSixes - I am not sure how you would go about the first script, it would be a rather difficult task since scripts would not sun unless they are loaded with the cell.

For script 2, not sure I follow you. Is this like a Mark and Recall spell?

For script 3, I dont follow you. There are random number generators that work for any number. If your taking about a leveled character list, I don't think you can change those properties on the fly.

For script 4, there is not function to change the enchantment level of items. You might be able to recharge by force equipping an added soulgem. Any timer funtions would have to be added by the script before it does the recharging.

For 'dialog' 5, no clue. Perhaps like you can tell followers to unlock doors and stuff... I don't dabble in dialog.

For script 6, enchantment like on a weapon? I dont know if you can add enchantments via script to weapons.

Looks like i've got some myths to bust :noway:

If bethesda made it happen using an arcane enchanter, we can make it happen via script.... hopefully

Link to comment
Share on other sites

Working on script #1 above, starting to make headway.

The object disappears, but I am not using the right reference. I need to use the objectreference's baseobject. Let me show you:

Scriptname OnHitLootDrop extends ObjectReference

{Player strikes object, object disappears, sound and visual fx play, loot drops}

ObjectReference Property SmashCont Auto ;Smashable Object

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \

bool abBashAttack, bool abHitBlocked) ;Player hits object with virtually anything...

SmashCont.Disable() ;BOOM! Object Is Destroyed/Disabled

EndEvent

Havent added the fx yet, as I need to figure a way to attach the script to the baseobject first, so it affects all of the objectreferences. Right now, the script(attached to the base) only affects the objref i chose with the property. I think the answer is hidden in here:

http://www.creationkit.com/GetBaseObject_-_ObjectReference

However, I cannot seem to get it working. Any ideas?

Link to comment
Share on other sites

  • 3 weeks later...

I would like to request a script too please :)

i would like a chest that contains items to have them respawn after a certain amount of time ,

one day passes and it respawns its content (if it's empty) (i'd like to have a random content with random numbers of items respawn from a list of items i made),

and/or a switch which determinates if it respawns or not (if activated it'll respawn even if not empty) (i'll use this after a quest is completed , i'll be activated after a quest).

so basically a chest which respawns if a day passes or a switch is activated with the options i wrote above :)

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