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

Hi all

I am looking for a script which will allow a modded custom plant to spawn 2 custom items once per day which can be harvestable, the custom plant was made from a flora with a new nif. If that wouldn't work then a script for a container to do the same thing but not to end up with hundreds of the custom item, just the 2, would work equally well for what I want to do.

I have no knowledge whatsoever of papyrus - apart from reading the tutorial on the creation kit site and deciding I needed to have a pHd so would be very grateful for any help :)

Link to comment
Share on other sites

Hello TES Alliance!

This is my first request for a script, hope it goes well.

Essentially, this is a Sprint Spell, or a Speed Increase Spell.

I need a script that modifies the players run speed [speedmult] upon activating a custom power (Casting an ability? or perhaps different script for activating a power).

The effects of the power last for 30 seconds, so that is how long I would like the speed multiplier to last. Once the 30 seconds has passed, and the power has expired, I also want the players speed to reset to its default, vanilla Skyrim value.

I have never fully scripted before, but I believe the steps would go something like this.

1. Player activates ability

2. ability equal to (custom ability)?

3. if so, then set speedmult to desired value

4. some kind of timer? 30 seconds in game time

5. after 30 seconds has passed, reset speed to default value.

I'm not sure what else needs to happen for this to occur, OR even if this is possible.

I'll keep searching the forums for this same type of request to make sure this info isn't already out there. But if not, then I really appreciate any help at all that anyone has to offer. Thank you very much in advance, and until then, happy modding/scripting.

Link to comment
Share on other sites

@Mitsarugi - What you require is going to take some work by you. I have not looked into timer functions yet so you would need to research how you plan on deciding when you want the respawn to occur.

Its easy to put stuff back in the chest though, I would recommend a leveled list, and use the function 'AddItem'.

If you add the leveled list to the container, it will refill the chest using the rules for the leveled list. All chests use these for random contents.

@Bethra - Timer will be a bit more difficult. In my Leveler's Tower mod, I have harvestable Nirnroot which you can then click the 'roots' to water the plant, and in 5 seconds, it grows back, ready to be harvested again. Its a bit complex but it works for my needs.

As for understanding scripts at a beginner level, look at the first script tutorial in this forum for the real easy beginners guide to how papyrus works on the easy level. :lol:

I have not been successful at getting a 'flora' object to respawn on its own without the whole cell respawning too. So I would be curious if you actually got it working.

Link to comment
Share on other sites

@rakwarrior25 - Without looking, my guess is you make a spell since you can control its duration with the spell.

The script would start with this, where you set the speed mult, probably using SetAV:

http://www.creationkit.com/OnEffectStart_-_ActiveMagicEffect

And when the spell ends (Finish), you can set the speed mult back with in this block type:

http://www.creationkit.com/OnEffectFinish_-_ActiveMagicEffect

Like I said, its my guess this should work.

Link to comment
Share on other sites

Hi all I am looking for a script which will allow a modded custom plant to spawn 2 custom items once per day which can be harvestable, the custom plant was made from a flora with a new nif. If that wouldn't work then a script for a container to do the same thing but not to end up with hundreds of the custom item, just the 2, would work equally well for what I want to do. I have no knowledge whatsoever of papyrus - apart from reading the tutorial on the creation kit site and deciding I needed to have a pHd so would be very grateful for any help :)
Timer will be a bit more difficult. In my Leveler's Tower mod, I have harvestable Nirnroot which you can then click the 'roots' to water the plant, and in 5 seconds, it grows back, ready to be harvested again. Its a bit complex but it works for my needs. As for understanding scripts at a beginner level, look at the first script tutorial in this forum for the real easy beginners guide to how papyrus works on the easy level. :lol: I have not been successful at getting a 'flora' object to respawn on its own without the whole cell respawning too. So I would be curious if you actually got it working.

hmmm...maybe just 24 hours after it is first harvested would be easier than at a certain time?

Link to comment
Share on other sites

I'm revisiting the monster script i'm developing, and thought could use some WillieSea to brighten up my day.

Scripting has gotten much easier for me to understand nowadays, Papyrus anyway. There is two parts to the script I am writing, the first is easy, the second, not so much.

Here is the first part, designed to activate an ObjectReference with a spellcast with a particular magiceffect:

ScriptName TISIdentifyTest01 Extends MagicEffect

{Upon casting of spells with this magic effect, activate ObjectReference}

ObjectReference Property Workbench Auto

Event OnEffectStart()

Workbench.Activate(Game.GetPlayer())

EndEvent

I don't get any compiler errors...

The script is attached to the spell's magic effect, and when I cast the spell, i get a CTD.

I have no clue why...

Link to comment
Share on other sites

Finally got things to work.... sort of.... I'm pointing to the workbench with this script:

ScriptName TISIdentifyTest01 Extends ActiveMagicEffect

import debug

import utility

ObjectReference property Identify auto

Event OnInit()

Craft()

endEvent

function Craft()

Identify.Activate(Game.GetPlayer())

endFunction

This, when fired, opens a crafting menu, and thanks to a custom workbench, a custom crafting menu.

Problem: I can't seem to get the script to fire on scrolls, which is required. Only on spells that are of the lesser power type, with any equip type.

You cannot choose a lesser power type for scrolls, is there a work-around to get this magic effect to successfully run on scrolls?

What happens upon casting the scroll is that it forces me to 3rd person as if it was trying to activate a workbench infront of me, then freezes the character in 3rd person view...

PS: The magic effect is a fire and forget, the way it is supposed to be, so that is not the situation...

EDIT: I ticked the "Script Effect Always Applies" Box in the scroll's edit menu, and that seemed to fix it.

Edited by TripleSixes
Link to comment
Share on other sites

Hey TES Scripters,

Thank you for your reply to my last request for help. I've made a lot of headway and only one bit of scripting remains to fully complete my desired effect.

The effect gives the player 1 carry point to update the spells effect on Player, so I need the players carry weight to be decreased by 1 to re-update the spells status.

So far this is what I have: Game.GetPlayer().ModActorValue ("carryweight", -1)

The problem is that the negative integer (-1) is not registering with the script somehow, and the players carrying capacity continues to rise by 1 point each time the spell is used.

Is my syntax incorrect? Or am I in need of a more complicated function to let the game know where to deduct a point from? Or perhaps something different altogether.

If anyone has a solution to this problem, I would be most grateful if you would share it with me. Like I said, this is the final barrier to the whole thing working! :D Thanks again

RakWarrior

Link to comment
Share on other sites

I need some script guidance....

This is the effect i have:

Player uses book

Player moves to worldspace

Player's stats are set to certain value.

Player uses book again

Player moves to new location

I need to add a part that gets the player's actor values before they move to the worldspace, then after the player uses the book again, moves them to a location, and returns their stats to the values he/she had before using the book the first time.

I need this to happen, lines in quotes need to be added:

Player uses book

Player moves to worldspace

Player's stats are remembered and then are set to certain value.

Player uses book again

Player moves to new location

Player's stats are set to previous value while newer values are remembered and applied to the player if they use the book again.

Also, i remove all the player's belongings once they use the book, is there a way to dump all their items into a container and retrieve them upon using the book the again?

Any ideas?

Here's my script if you want to analyze the whole thing:



Scriptname TISBookTeleTristram extends ObjectReference  

{This script teleports the player to Tristram, Unless the player is in one of Tristram's Dungeons}


;----------------------------------

;PROPERTIES

;----------------------------------

Message Property QuestionTristram Auto

Message Property YesTristram Auto

Message Property NoTristram Auto

Message Property ChooseSkillSet Auto

Message Property Warrior Auto

Message Property Rogue Auto

Message Property Sorcerer Auto

Message Property Hardcore Auto


ObjectReference Property TeleDest1 Auto


ObjectReference Property Dungeon01 Auto

ObjectReference Property Dungeon02 Auto

ObjectReference Property Dungeon03 Auto

ObjectReference Property Dungeon04 Auto

ObjectReference Property Dungeon05 Auto

ObjectReference Property Dungeon06 Auto

ObjectReference Property Dungeon07 Auto

ObjectReference Property Dungeon08 Auto

ObjectReference Property Dungeon09 Auto

ObjectReference Property Dungeon10 Auto

ObjectReference Property Dungeon11 Auto

ObjectReference Property Dungeon12 Auto

ObjectReference Property Dungeon13 Auto

ObjectReference Property Dungeon14 Auto

ObjectReference Property Dungeon15 Auto

ObjectReference Property Dungeon16 Auto

ObjectReference Property PoisonWater Auto

ObjectReference Property LeoricTomb Auto

ObjectReference Property ChamberBone Auto

ObjectReference Property HallBlind Auto

ObjectReference Property CowLevel Auto


Actor Property Player Auto


Book Property TheBook Auto


Weapon Property ShortSword Auto

Weapon Property ShortBow Auto

Ammo Property Arrows Auto

Weapon Property ShortStaffChargedBolt Auto

Weapon Property Club Auto


Armor Property Buckler Auto


MiscObject Property Gold Auto


Potion Property PotionOfHealing Auto

Potion Property PotionOfMana Auto

Potion Property PotionOfStamina Auto


Spell Property Firebolt Auto

Spell Property Healing Auto

Spell Property Flames Auto


Outfit Property WarriorOutfit Auto

Outfit Property RogueOutfit Auto

Outfit Property SorcererOutfit Auto


WorldSpace Property Tristram Auto


;----------------------------------

;VARIABLES

;----------------------------------

Int ReadBook

Int SkillSet


;----------------------------------

;THE GOOD STUFF

;----------------------------------

Event onRead()


if (Dungeon01.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #1")

ElseIf (Dungeon02.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #2")

ElseIf (Dungeon03.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #3")

ElseIf (Dungeon04.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #4")

ElseIf (Dungeon05.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #5")

ElseIf (Dungeon06.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #6")

ElseIf (Dungeon07.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #7")

ElseIf (Dungeon08.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #8")

ElseIf (Dungeon09.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #9")

ElseIf (Dungeon10.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #10")

ElseIf (Dungeon11.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #11")

ElseIf (Dungeon12.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #12")

ElseIf (Dungeon13.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #13")

ElseIf (Dungeon14.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #14")

ElseIf (Dungeon15.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #15")

ElseIf (Dungeon16.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #16")

ElseIf (PoisonWater.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently in Tristram's Water Supply Chamber")

ElseIf (LeoricTomb.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently in King Leoric's Tomb")

ElseIf (ChamberBone.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently in The Chamber of Bone")

ElseIf (HallBlind.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently in The Hall of the Blind")

ElseIf (CowLevel.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("There is a Cow Level")


ElseIf Game.GetPlayer().GetWorldSpace() != Tristram

Debug.Trace("You're In Skyrim")

ReadBook = QuestionTristram.show()

if ReadBook == 0

YesTristram.show()


Game.GetPlayer().MoveTo(TeleDest1)

Game.GetPlayer().RemoveAllItems(abRemoveQuestItems = true)

Game.GetPlayer().RemoveSpell(Healing)

Game.GetPlayer().RemoveSpell(Flames)


if (Game.GetPlayer().GetItemCount(TheBook) == 0)

Debug.Trace("Player doesn't have the book yet, fix that")

Game.GetPlayer().Additem(TheBook)

endIf


SkillSet = ChooseSkillSet.show()

if SkillSet == 0;Choose to be a Warrior.

Warrior.show()

Game.GetPlayer().SetActorValue("health", 100)

Game.GetPlayer().SetActorValue("magicka", 14)

Game.GetPlayer().SetActorValue("stamina", 55)

Game.GetPlayer().SetActorValue("onehanded", 43)

Game.GetPlayer().SetActorValue("twohanded", 43)

Game.GetPlayer().SetActorValue("marksman", 29)

Game.GetPlayer().SetActorValue("block", 43)

Game.GetPlayer().SetActorValue("smithing", 43)

Game.GetPlayer().SetActorValue("heavyarmor", 36)

Game.GetPlayer().SetActorValue("lightarmor", 36)

Game.GetPlayer().SetActorValue("pickpocket", 29)

Game.GetPlayer().SetActorValue("lockpicking", 29)

Game.GetPlayer().SetActorValue("sneak", 29)

Game.GetPlayer().SetActorValue("alchemy", 14)

Game.GetPlayer().SetActorValue("speechcraft", 29)

Game.GetPlayer().SetActorValue("alteration", 14)

Game.GetPlayer().SetActorValue("conjuration", 14)

Game.GetPlayer().SetActorValue("destruction", 14)

Game.GetPlayer().SetActorValue("illusion", 14)

Game.GetPlayer().SetActorValue("restoration", 14)

Game.GetPlayer().SetActorValue("enchanting", 14)


Player.SetOutfit(WarriorOutfit)


Game.GetPlayer().Additem(ShortSword)

Game.GetPlayer().Additem(Club)

Game.GetPlayer().Additem(Buckler)

Game.GetPlayer().Additem(Gold, 100)

Game.GetPlayer().Additem(PotionOfHealing, 2)


ElseIf SkillSet == 1;Choose to be a Rogue.

Rogue.show()

Game.GetPlayer().SetActorValue("health", 64)

Game.GetPlayer().SetActorValue("magicka", 31)

Game.GetPlayer().SetActorValue("stamina", 100)

Game.GetPlayer().SetActorValue("onehanded", 29)

Game.GetPlayer().SetActorValue("twohanded", 29)

Game.GetPlayer().SetActorValue("marksman", 43)

Game.GetPlayer().SetActorValue("block", 29)

Game.GetPlayer().SetActorValue("smithing", 29)

Game.GetPlayer().SetActorValue("heavyarmor", 29)

Game.GetPlayer().SetActorValue("lightarmor", 29)

Game.GetPlayer().SetActorValue("pickpocket", 43)

Game.GetPlayer().SetActorValue("lockpicking", 43)

Game.GetPlayer().SetActorValue("sneak", 43)

Game.GetPlayer().SetActorValue("alchemy", 21)

Game.GetPlayer().SetActorValue("speechcraft", 43)

Game.GetPlayer().SetActorValue("alteration", 21)

Game.GetPlayer().SetActorValue("conjuration", 21)

Game.GetPlayer().SetActorValue("destruction", 21)

Game.GetPlayer().SetActorValue("illusion", 21)

Game.GetPlayer().SetActorValue("restoration", 21)

Game.GetPlayer().SetActorValue("enchanting", 21)


Player.SetOutfit(RogueOutfit)


Game.GetPlayer().Additem(ShortBow)

Game.GetPlayer().Additem(Arrows, 50)

Game.GetPlayer().Additem(Gold, 100)

Game.GetPlayer().Additem(PotionOfStamina, 2)


ElseIf SkillSet == 2;Choose to be a Sorcerer.

Sorcerer.show()

Game.GetPlayer().SetActorValue("health", 43)

Game.GetPlayer().SetActorValue("magicka", 100)

Game.GetPlayer().SetActorValue("stamina", 14)

Game.GetPlayer().SetActorValue("onehanded", 21)

Game.GetPlayer().SetActorValue("twohanded", 21)

Game.GetPlayer().SetActorValue("marksman", 21)

Game.GetPlayer().SetActorValue("block", 21)

Game.GetPlayer().SetActorValue("smithing", 21)

Game.GetPlayer().SetActorValue("heavyarmor", 29)

Game.GetPlayer().SetActorValue("lightarmor", 29)

Game.GetPlayer().SetActorValue("pickpocket", 21)

Game.GetPlayer().SetActorValue("lockpicking", 21)

Game.GetPlayer().SetActorValue("sneak", 21)

Game.GetPlayer().SetActorValue("alchemy", 50)

Game.GetPlayer().SetActorValue("speechcraft", 21)

Game.GetPlayer().SetActorValue("alteration", 50)

Game.GetPlayer().SetActorValue("conjuration", 50)

Game.GetPlayer().SetActorValue("destruction", 50)

Game.GetPlayer().SetActorValue("illusion", 50)

Game.GetPlayer().SetActorValue("restoration", 50)

Game.GetPlayer().SetActorValue("enchanting", 50)


Player.SetOutfit(SorcererOutfit)


Game.GetPlayer().Additem(ShortStaffChargedBolt)

Game.GetPlayer().Additem(Gold, 100)

Game.GetPlayer().Additem(PotionOfMana, 2)

Game.GetPlayer().AddSpell(Firebolt)


ElseIf SkillSet == 3;Choose to play Hardcore Mode.

Hardcore.show()

Game.GetPlayer().SetActorValue("health", 50)

Game.GetPlayer().SetActorValue("magicka", 50)

Game.GetPlayer().SetActorValue("stamina", 50)

Game.GetPlayer().SetActorValue("onehanded", 10)

Game.GetPlayer().SetActorValue("twohanded", 10)

Game.GetPlayer().SetActorValue("marksman", 10)

Game.GetPlayer().SetActorValue("block", 10)

Game.GetPlayer().SetActorValue("smithing", 10)

Game.GetPlayer().SetActorValue("heavyarmor", 10)

Game.GetPlayer().SetActorValue("lightarmor", 10)

Game.GetPlayer().SetActorValue("pickpocket", 10)

Game.GetPlayer().SetActorValue("lockpicking", 10)

Game.GetPlayer().SetActorValue("sneak", 10)

Game.GetPlayer().SetActorValue("alchemy", 10)

Game.GetPlayer().SetActorValue("speechcraft", 10)

Game.GetPlayer().SetActorValue("alteration", 10)

Game.GetPlayer().SetActorValue("conjuration", 10)

Game.GetPlayer().SetActorValue("illusion", 10)

Game.GetPlayer().SetActorValue("destruction", 10)

Game.GetPlayer().SetActorValue("restoration", 10)

Game.GetPlayer().SetActorValue("enchanting", 10)


EndIf

Debug.MessageBox("You can reference back to the book if you'd like to leave, or if you wish to track your progress")

elseif ReadBook == 1

NoTristram.show()

endif

endif

endEVENT

Edited by TripleSixes
Link to comment
Share on other sites

The scripting WIKI is your friend. Its what I used to find commands per your questions.

Store all your actor values into variables:

int myHealth = Game.GetPlayer().GetActorValue(Health)

To remove player inventory and dump it all into a chest called 'MyHoldingChestREF', you would do this:

Game.GetPlayer().RemoveAllItems(akTransferTo = MyHoldingChestREF, abRemoveQuestItems = true)

To move it all back to the player:

MyHoldingChestREF.RemoveAllItems(akTransferTo = Game.GetPlayer(), abRemoveQuestItems = true)

Edited by WillieSea
Link to comment
Share on other sites

When i use these variables:

int StartHealth = Game.GetPlayer().GetActorValue(Health)

etc.

I says they are undefined.

I put them before i set the actor values

How do I define these variables?

(probably a stupid question, but I haven't really used variables before).

And then when the player wants the values back, i would use

Game.GetPlayer().SetActorValue(Health)

Right?

You're my hero Willie

Edited by TripleSixes
Link to comment
Share on other sites

Having issues with restoring the Starting actor values:

When i call them them in a different script, they return as 0.

The areas I added to save the AVs and restore the AVs are in codeboxes within the spoilers (don't wanna explode the post now)

The first script:

Scriptname TISBookTeleTristram extends ObjectReference

{This script teleports the player to Tristram, Unless the player is in one of Tristram's Dungeons}

;----------------------------------

;PROPERTIES

;----------------------------------

Actor Property Player Auto

Ammo Property Arrows Auto

Armor Property Buckler Auto

Book Property TheBook Auto

Message Property QuestionTristram Auto

Message Property YesTristram Auto

Message Property NoTristram Auto

Message Property ChooseSkillSet Auto

Message Property Warrior Auto

Message Property Rogue Auto

Message Property Sorcerer Auto

Message Property Hardcore Auto

MiscObject Property Gold Auto

ObjectReference Property SkyrimPlayerStorage Auto

ObjectReference Property TristramPlayerStorage Auto

ObjectReference Property TeleDest1 Auto

ObjectReference Property Dungeon01 Auto

ObjectReference Property Dungeon02 Auto

ObjectReference Property Dungeon03 Auto

ObjectReference Property Dungeon04 Auto

ObjectReference Property Dungeon05 Auto

ObjectReference Property Dungeon06 Auto

ObjectReference Property Dungeon07 Auto

ObjectReference Property Dungeon08 Auto

ObjectReference Property Dungeon09 Auto

ObjectReference Property Dungeon10 Auto

ObjectReference Property Dungeon11 Auto

ObjectReference Property Dungeon12 Auto

ObjectReference Property Dungeon13 Auto

ObjectReference Property Dungeon14 Auto

ObjectReference Property Dungeon15 Auto

ObjectReference Property Dungeon16 Auto

ObjectReference Property PoisonWater Auto

ObjectReference Property LeoricTomb Auto

ObjectReference Property ChamberBone Auto

ObjectReference Property HallBlind Auto

ObjectReference Property CowLevel Auto

Outfit Property WarriorOutfit Auto

Outfit Property RogueOutfit Auto

Outfit Property SorcererOutfit Auto

Potion Property PotionOfHealing Auto

Potion Property PotionOfMana Auto

Potion Property PotionOfStamina Auto

Spell Property FullHeal Auto

Spell Property Firebolt Auto

Spell Property Healing Auto

Spell Property Flames Auto

Weapon Property ShortSword Auto

Weapon Property ShortBow Auto

Weapon Property ShortStaffChargedBolt Auto

Weapon Property Club Auto

WorldSpace Property Tristram Auto

;----------------------------------

;VARIABLES

;----------------------------------

Int ReadBook

Int ReadBookAgain

Int SkillSet

;----------------------------------

;THE GOOD STUFF

;----------------------------------

Event onRead()

if (Dungeon01.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #1")

ElseIf (Dungeon02.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #2")

ElseIf (Dungeon03.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #3")

ElseIf (Dungeon04.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #4")

ElseIf (Dungeon05.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #5")

ElseIf (Dungeon06.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #6")

ElseIf (Dungeon07.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #7")

ElseIf (Dungeon08.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #8")

ElseIf (Dungeon09.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #9")

ElseIf (Dungeon10.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #10")

ElseIf (Dungeon11.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #11")

ElseIf (Dungeon12.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #12")

ElseIf (Dungeon13.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #13")

ElseIf (Dungeon14.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #14")

ElseIf (Dungeon15.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #15")

ElseIf (Dungeon16.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #16")

ElseIf (PoisonWater.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently in Tristram's Water Supply Chamber")

ElseIf (LeoricTomb.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently in King Leoric's Tomb")

ElseIf (ChamberBone.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently in The Chamber of Bone")

ElseIf (HallBlind.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently in The Hall of the Blind")

ElseIf (CowLevel.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("There is a Cow Level")

ElseIf Game.GetPlayer().GetWorldSpace() != Tristram

Debug.Trace("You're In Skyrim"); Player is not in Tristram

ReadBook = QuestionTristram.show()

if ReadBook == 0

YesTristram.show()

Game.GetPlayer().MoveTo(TeleDest1); Teleport to Tristram

Game.GetPlayer().RemoveAllItems(akTransferTo = SkyrimPlayerStorage, abRemoveQuestItems = true); Move Skyrim items to temporary container.

TristramPlayerStorage.RemoveAllItems(akTransferTo = Game.GetPlayer(), abRemoveQuestItems = true); Return Tristram items.

Game.GetPlayer().RemoveSpell(Healing); Remove healing spell

Game.GetPlayer().RemoveSpell(Flames); Remove flames spell

if (Game.GetPlayer().GetItemCount(TheBook) == 0)

Debug.Trace("Player doesn't have the book yet, fix that")

Game.GetPlayer().Additem(TheBook); Add book to Player's Inventory

endIf


;Save These Stats, they will be restored later

int StartHealth = Game.GetPlayer().GetAV("health") as int

int StartMagicka = Game.GetPlayer().GetAV("magicka") as int

int StartStamina = Game.GetPlayer().GetAV("stamina") as int

int StartOnehanded = Game.GetPlayer().GetAV("onehanded") as int

int StartTwohanded = Game.GetPlayer().GetAV("twohanded") as int

int StartMarksman = Game.GetPlayer().GetAV("marksman") as int

int StartBlock = Game.GetPlayer().GetAV("block") as int

int StartSmithing = Game.GetPlayer().GetAV("smithing") as int

int StartHeavyArmor = Game.GetPlayer().GetAV("heavyarmor") as int

int StartLightArmor = Game.GetPlayer().GetAV("lightarmor") as int

int StartPickpocket = Game.GetPlayer().GetAV("pickpocket") as int

int StartLockpicking = Game.GetPlayer().GetAV("lockpicking") as int

int StartSneak = Game.GetPlayer().GetAV("sneak") as int

int StartAlchemy = Game.GetPlayer().GetAV("alchemy") as int

int StartSpeechcraft = Game.GetPlayer().GetAV("speechcraft") as int

int StartAlteration = Game.GetPlayer().GetAV("alteration") as int

int StartConjuration = Game.GetPlayer().GetAV("conjuration") as int

int StartDestruction = Game.GetPlayer().GetAV("destruction") as int

int StartIllusion = Game.GetPlayer().GetAV("illusion") as int

int StartRestoration = Game.GetPlayer().GetAV("restoration") as int

int StartEnchanting = Game.GetPlayer().GetAV("enchanting") as int

SkillSet = ChooseSkillSet.show();Choose your Character if SkillSet == 0;Choose to be a Warrior. Warrior.show() Game.GetPlayer().SetActorValue("health", 100) Game.GetPlayer().SetActorValue("magicka", 14) Game.GetPlayer().SetActorValue("stamina", 55) Game.GetPlayer().SetActorValue("onehanded", 43) Game.GetPlayer().SetActorValue("twohanded", 43) Game.GetPlayer().SetActorValue("marksman", 29) Game.GetPlayer().SetActorValue("block", 43) Game.GetPlayer().SetActorValue("smithing", 43) Game.GetPlayer().SetActorValue("heavyarmor", 36) Game.GetPlayer().SetActorValue("lightarmor", 36) Game.GetPlayer().SetActorValue("pickpocket", 29) Game.GetPlayer().SetActorValue("lockpicking", 29) Game.GetPlayer().SetActorValue("sneak", 29) Game.GetPlayer().SetActorValue("alchemy", 14) Game.GetPlayer().SetActorValue("speechcraft", 29) Game.GetPlayer().SetActorValue("alteration", 14) Game.GetPlayer().SetActorValue("conjuration", 14) Game.GetPlayer().SetActorValue("destruction", 14) Game.GetPlayer().SetActorValue("illusion", 14) Game.GetPlayer().SetActorValue("restoration", 14) Game.GetPlayer().SetActorValue("enchanting", 14) ;Outfit Player.SetOutfit(WarriorOutfit) ;Items Game.GetPlayer().Additem(ShortSword) Game.GetPlayer().Additem(Club) Game.GetPlayer().Additem(Buckler) Game.GetPlayer().Additem(Gold, 100) Game.GetPlayer().Additem(PotionOfHealing, 2) FullHeal.Cast(Game.GetPlayer());Preparation ElseIf SkillSet == 1;Choose to be a Rogue. Rogue.show() Game.GetPlayer().SetActorValue("health", 64) Game.GetPlayer().SetActorValue("magicka", 31) Game.GetPlayer().SetActorValue("stamina", 100) Game.GetPlayer().SetActorValue("onehanded", 29) Game.GetPlayer().SetActorValue("twohanded", 29) Game.GetPlayer().SetActorValue("marksman", 43) Game.GetPlayer().SetActorValue("block", 29) Game.GetPlayer().SetActorValue("smithing", 29) Game.GetPlayer().SetActorValue("heavyarmor", 29) Game.GetPlayer().SetActorValue("lightarmor", 29) Game.GetPlayer().SetActorValue("pickpocket", 43) Game.GetPlayer().SetActorValue("lockpicking", 43) Game.GetPlayer().SetActorValue("sneak", 43) Game.GetPlayer().SetActorValue("alchemy", 21) Game.GetPlayer().SetActorValue("speechcraft", 43) Game.GetPlayer().SetActorValue("alteration", 21) Game.GetPlayer().SetActorValue("conjuration", 21) Game.GetPlayer().SetActorValue("destruction", 21) Game.GetPlayer().SetActorValue("illusion", 21) Game.GetPlayer().SetActorValue("restoration", 21) Game.GetPlayer().SetActorValue("enchanting", 21) ;Outfit Player.SetOutfit(RogueOutfit) ;Items Game.GetPlayer().Additem(ShortBow) Game.GetPlayer().Additem(Arrows, 50) Game.GetPlayer().Additem(Gold, 100) Game.GetPlayer().Additem(PotionOfStamina, 2) FullHeal.Cast(Game.GetPlayer());Preparation ElseIf SkillSet == 2;Choose to be a Sorcerer. Sorcerer.show() Game.GetPlayer().SetActorValue("health", 43) Game.GetPlayer().SetActorValue("magicka", 100) Game.GetPlayer().SetActorValue("stamina", 14) Game.GetPlayer().SetActorValue("onehanded", 21) Game.GetPlayer().SetActorValue("twohanded", 21) Game.GetPlayer().SetActorValue("marksman", 21) Game.GetPlayer().SetActorValue("block", 21) Game.GetPlayer().SetActorValue("smithing", 21) Game.GetPlayer().SetActorValue("heavyarmor", 29) Game.GetPlayer().SetActorValue("lightarmor", 29) Game.GetPlayer().SetActorValue("pickpocket", 21) Game.GetPlayer().SetActorValue("lockpicking", 21) Game.GetPlayer().SetActorValue("sneak", 21) Game.GetPlayer().SetActorValue("alchemy", 50) Game.GetPlayer().SetActorValue("speechcraft", 21) Game.GetPlayer().SetActorValue("alteration", 50) Game.GetPlayer().SetActorValue("conjuration", 50) Game.GetPlayer().SetActorValue("destruction", 50) Game.GetPlayer().SetActorValue("illusion", 50) Game.GetPlayer().SetActorValue("restoration", 50) Game.GetPlayer().SetActorValue("enchanting", 50) ;Outfit Player.SetOutfit(SorcererOutfit) ;Items Game.GetPlayer().Additem(ShortStaffChargedBolt) Game.GetPlayer().Additem(Gold, 100) Game.GetPlayer().Additem(PotionOfMana, 2) Game.GetPlayer().AddSpell(Firebolt) FullHeal.Cast(Game.GetPlayer());Preparation ElseIf SkillSet == 3;Choose to play Hardcore Mode. Hardcore.show() Game.GetPlayer().SetActorValue("health", 50) Game.GetPlayer().SetActorValue("magicka", 50) Game.GetPlayer().SetActorValue("stamina", 50) Game.GetPlayer().SetActorValue("onehanded", 10) Game.GetPlayer().SetActorValue("twohanded", 10) Game.GetPlayer().SetActorValue("marksman", 10) Game.GetPlayer().SetActorValue("block", 10) Game.GetPlayer().SetActorValue("smithing", 10) Game.GetPlayer().SetActorValue("heavyarmor", 10) Game.GetPlayer().SetActorValue("lightarmor", 10) Game.GetPlayer().SetActorValue("pickpocket", 10) Game.GetPlayer().SetActorValue("lockpicking", 10) Game.GetPlayer().SetActorValue("sneak", 10) Game.GetPlayer().SetActorValue("alchemy", 10) Game.GetPlayer().SetActorValue("speechcraft", 10) Game.GetPlayer().SetActorValue("alteration", 10) Game.GetPlayer().SetActorValue("conjuration", 10) Game.GetPlayer().SetActorValue("illusion", 10) Game.GetPlayer().SetActorValue("destruction", 10) Game.GetPlayer().SetActorValue("restoration", 10) Game.GetPlayer().SetActorValue("enchanting", 10) ;Outfit ;Items FullHeal.Cast(Game.GetPlayer());Preparartion EndIf Debug.MessageBox("You can reference back to the book if you'd like to leave, or if you wish to track your progress") elseif ReadBook == 1 NoTristram.show();Just read book... endif endif EndEvent
The second script:
Scriptname TISBookTeleSkyrim extends ObjectReference {This script teleports the player to Skyrim, from Tristram.} Import TISBookTeleTristram ;;;;;;;;;;;; ;PROPERTIES; ;;;;;;;;;;;; Book Property TheBook Auto Message Property QuestionReturn Auto Message Property YesReturn Auto Message Property NoReturn Auto ObjectReference Property SkyrimPlayerStorage Auto ObjectReference Property TristramPlayerStorage Auto ObjectReference Property SleepingGiant1 Auto ObjectReference Property BannerMare2 Auto ObjectReference Property Frostfruit3 Auto ObjectReference Property DrunkenHuntsman4 Auto ObjectReference Property DeadMansDrink5 Auto ObjectReference Property Braidwood6 Auto ObjectReference Property BeeBarb7 Auto ObjectReference Property VilemyrInn8 Auto ObjectReference Property NewGnisis9 Auto ObjectReference Property SilverBlood10 Auto ObjectReference Property OldHroldan11 Auto ObjectReference Property WinkingSkeever12 Auto ObjectReference Property FourShields13 Auto ObjectReference Property Moorside14 Auto ObjectReference Property Windpeak15 Auto ObjectReference Property Nightgate16 Auto ObjectReference Property FrozenHearth17 Auto ObjectReference Property Candlehearth18 Auto Spell Property FullHeal Auto WorldSpace Property Tristram Auto ;;;;;;;;;;; ;VARIABLES; ;;;;;;;;;;; Int ReadBookAgain ;;;;;;;;;;;;;;;; ;THE GOOD STUFF; ;;;;;;;;;;;;;;;; Event onRead() if Game.GetPlayer().GetWorldSpace() == Tristram Debug.Trace("You're In Tristram") ReadBookAgain = QuestionReturn.show() Debug.Trace("Want to Leave?") if ReadBookAgain == 0;Player chooses to leave YesReturn.show() Game.GetPlayer().RemoveAllItems(akTransferTo = TristramPlayerStorage, abRemoveQuestItems = true); Move TIS items to temporary container SkyrimPlayerStorage.RemoveAllItems(akTransferTo = Game.GetPlayer(), abRemoveQuestItems = true);Return Skyrim items.

Int StartHealth

Int StartMagicka

Int StartStamina

Int StartOnehanded

Int StartTwohanded

Int StartMarksman

Int StartBlock

Int StartSmithing

Int StartHeavyArmor

Int StartLightArmor

Int StartPickpocket

Int StartLockpicking

Int StartSneak

Int StartAlchemy

Int StartSpeechcraft

Int StartAlteration

Int StartConjuration

Int StartDestruction

Int StartIllusion

Int StartRestoration

Int StartEnchanting

Game.GetPlayer().SetAV("health", StartHealth)

Game.GetPlayer().SetAV("magicka", StartMagicka)

Game.GetPlayer().SetAV("stamina", StartStamina)

Game.GetPlayer().SetAV("onehanded", StartOnehanded)

Game.GetPlayer().SetAV("twohanded", StartTwohanded)

Game.GetPlayer().SetAV("marksman", StartMarksman)

Game.GetPlayer().SetAV("block", StartBlock)

Game.GetPlayer().SetAV("smithing", StartSmithing)

Game.GetPlayer().SetAV("heavyarmor", StartHeavyArmor)

Game.GetPlayer().SetAV("lightarmor", StartLightArmor)

Game.GetPlayer().SetAV("pickpocket", StartPickpocket)

Game.GetPlayer().SetAV("lockpicking", StartLockpicking)

Game.GetPlayer().SetAV("sneak", StartSneak)

Game.GetPlayer().SetAV("alchemy", StartAlchemy)

Game.GetPlayer().SetAV("speechcraft", StartSpeechcraft)

Game.GetPlayer().SetAV("alteration", StartAlteration)

Game.GetPlayer().SetAV("conjuration", StartConjuration)

Game.GetPlayer().SetAV("destruction", StartDestruction)

Game.GetPlayer().SetAV("illusion", StartIllusion)

Game.GetPlayer().SetAV("restoration", StartRestoration)

Game.GetPlayer().SetAV("enchanting", StartEnchanting)

FullHeal.Cast(Game.GetPlayer())

Int RandomExit = Utility.RandomInt(0, 18) ;Assigning the random number to the variable "Random".

;The random number minimum and maximum.

if RandomExit == 1

Game.GetPlayer().MoveTo(SleepingGiant1)

Debug.MessageBox("You find yourself at The Sleeping Giant Inn")

elseif RandomExit == 2

Game.GetPlayer().MoveTo(BannerMare2)

Debug.MessageBox("You find yourself at The Bannered Mare")

elseif RandomExit == 3

Game.GetPlayer().MoveTo(Frostfruit3)

Debug.MessageBox("You find yourself at Frostfruit Inn")

elseif RandomExit == 4

Game.GetPlayer().MoveTo(DrunkenHuntsman4)

Debug.MessageBox("You find yourself at The Drunken Huntsman")

elseif RandomExit == 5

Game.GetPlayer().MoveTo(DeadMansDrink5)

Debug.MessageBox("You find yourself at Dead Man's Drink")

elseif RandomExit == 6

Game.GetPlayer().MoveTo(Braidwood6)

Debug.MessageBox("You find yourself at Braidwood Inn")

elseif RandomExit == 7

Game.GetPlayer().MoveTo(BeeBarb7)

Debug.MessageBox("You find yourself at The Bee and Barb")

elseif RandomExit == 8

Game.GetPlayer().MoveTo(VilemyrInn8)

Debug.MessageBox("You find yourself at Vilemyr Inn")

elseif RandomExit == 9

Game.GetPlayer().MoveTo(NewGnisis9)

Debug.MessageBox("You find yourself at New Gnisis Cornerclub")

elseif RandomExit == 10

Game.GetPlayer().MoveTo(SilverBlood10)

Debug.MessageBox("You find yourself at The Silver-Blood Inn")

elseif RandomExit == 11

Game.GetPlayer().MoveTo(OldHroldan11)

Debug.MessageBox("You find yourself at Old Hroldan Inn")

elseif RandomExit == 12

Game.GetPlayer().MoveTo(WinkingSkeever12)

Debug.MessageBox("You find yourself at The Winking Skeever")

elseif RandomExit == 13

Game.GetPlayer().MoveTo(FourShields13)

Debug.MessageBox("You find yourself at Four Shields Tavern")

elseif RandomExit == 14

Game.GetPlayer().MoveTo(Moorside14)

Debug.MessageBox("You find yourself at Moorside Inn")

elseif RandomExit == 15

Game.GetPlayer().MoveTo(Windpeak15)

Debug.MessageBox("You find yourself at Windpeak Inn")

elseif RandomExit == 16

Game.GetPlayer().MoveTo(Nightgate16)

Debug.MessageBox("You find yourself at Nightgate Inn")

elseif RandomExit == 17

Game.GetPlayer().MoveTo(FrozenHearth17)

Debug.MessageBox("You find yourself at The Frozen Hearth")

elseif RandomExit == 18

Game.GetPlayer().MoveTo(Candlehearth18)

Debug.MessageBox("You find yourself at Candlehearth Hall")

EndIf

elseif ReadBookAgain == 1

NoReturn.show()

endif

endif

endEVENT

Edited by TripleSixes
Link to comment
Share on other sites

You could use global objects. In the one script, you set the global variables. In the second script, you get the value in the global object and can use it to set the values back.

Using global variable is rather simple to setup and use.

1. Create >Miscellaneous >Global object. Like 'myInputGlobalName'.

2. Attach property of 'global' to your script using the name you gave the global for the auto-fill to work.

3. get your global variable with:

float myVal = myInputGlobalName.GetValue()

Now the local variable 'myVal' will contain your global value.

4. set your global variable with:

myInputGlobalName.SetValue(1)

Link to comment
Share on other sites

Hello i have no scripting experience. but i have a small script request. It basicly spawn a actor which is ready to use ai packages.

so, it will be a small script attached to for example Dwemer button, when player clicks it it has 2 options : yes or no

yes spawn him to example xmarker

no does nothing

and you can only do this once. when you press yes, the button disappears or just stands static and does nothing

hopefully you understand my awful english.. and thanks in advance ! :P

Link to comment
Share on other sites

Having a script will not help you much if you do not know how to get it working in your game.

Take the first script tutorial here, as it has a lot of what your asking for, as well as setting it up in your game to actually work.

I don't really 'write' scripts for people, I help you learn to do it yourself.

Link to comment
Share on other sites

Willie teaches us how to fish XD

Speaking of which Willie, I got the global variable situation to work, thank you very much for your instructions!

I've got another one for ya ;)

There are two scripts, the first is attached to a magic effect, the second to an activator.

This is script number one



ScriptName TIStownportal Extends ActiveMagicEffect

{When the Magic Effect fires, sets the player's location as a reference, teleport to another reference}


Import Game ; i'm lazy

ObjectReference Property Tristram Auto ; the set-in-stone reference that the player moves to

ObjectReference Property RecallRef Auto ; the reference that moves to player's initial location before teleport, used in second script.


Event OnInit()

Tristram.Enable() ;enable teleport destination

RecallRef.Enable() ;enable recall ObjectReference

GetPlayer().PlaceAtMe(RecallRef) ; place recall ObjectReference at player's initial Location

GetPlayer().MoveTo(Tristram) ; move player to teleport destination

EndEvent ;the fun's over

This is script two


ScriptName TIStownportalreturn Extends ObjectReference


Import Game ; lazy!

ObjectReference Property Tristram Auto ; the ObjectReference the player must Activate

ObjectReference Property RecallRef Auto ; the ObjectReference that was placed in the first script


Event OnActivate(ObjectReference Tristram) ; player activates ObjectReference...

GetPlayer().MoveTo(RecallRef) ;BOOM! move to player's initial location at the time of the first script

Disable(Tristram) ;disable ObjectReference for recycling of script sequence

Disable(RecallRef) ;disable ObjectReference for recycling of script sequence

EndEvent ;the fun's over

They compile correctly, and are attached correctly... and the activators(objrefs) are initially disabled, and are waiting to be enabled with the first script...but when the player casts the spell, and moves to the Tristram objectreference, neither of the object references are enabled. Which means that I cannot activate the "Tristram" activator to teleport to the "RecallRef" activator. Any idea why they will not enable? :[

Edited by TripleSixes
Link to comment
Share on other sites

  • 3 weeks later...

Hey there TESAians

I've come with another humble script request.

I wish for a script that fires when the player's health is damaged, reduces all damage to 66% of it's initial power, and then get the difference between the start health and end health, and subtracting it from magicka instead. Any ideas?

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