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

Custom Horse Scripting Options.


myrmaad
 Share

Recommended Posts

In the shouty I asked about scripting custom horses and Jheuloh had some advice:

Jheuloh: Unless your go-home script is sprawled all over the place, I think a follow/wait spell and AI package could be squeezed in along side the go-home script, as long as both packages aren't active at once, of course.

me: I would love a follow wait spell, I'm a little scared.

Jheuloh: I could tell you how.

Jheuloh: I find that follow/wait scripts for creatures tend to have many more lines than necessary.

And so here we are.

I've made my custom horse. He's essential & can corpse check.

He's waiting for me to meet him at IC stables for the moment.

Now how best to manage him so that we become the best of friends?

Let's see what Jheuloh has to say about this follow spell.

Link to comment
Share on other sites

In the shouty I asked about scripting custom horses and Jheuloh had some advice:

Jheuloh: Unless your go-home script is sprawled all over the place, I think a follow/wait spell and AI package could be squeezed in along side the go-home script, as long as both packages aren't active at once, of course.

me: I would love a follow wait spell, I'm a little scared.

Jheuloh: I could tell you how.

Jheuloh: I find that follow/wait scripts for creatures tend to have many more lines than necessary.

And so here we are.

I've made my custom horse. He's essential & can corpse check.

He's waiting for me to meet him at IC stables for the moment.

Now how best to manage him so that we become the best of friends?

Let's see what Jheuloh has to say about this follow spell.

Well, I'm here, ready to answer questions, and guide you through the process, with as little pain as possible! :yes:

Link to comment
Share on other sites

Here it is! :P

First off, we'll want to make a global value that exists only to supply your horse's follow package and follow/wait spell with variables. You can call it whatever you please. I recommend leaving it as a 'short' variable type, with a default value of 0. :D

The follow/wait package will be step 2. Make a new follow package for your horse, and call it whatever you wish; once you've made the package and set its type to follow, open up the target tab, and choose Specific Reference. In the list, choose 'Player' 'Player Ref.' You'll probably want to set the distance value to at least 50 or so, when left at 0, the horse will try to walk right through you.

Once you're done with setting up the target tab, give it a condition which demands the global value you just made to be 1. The reason why we want to set this to 1 is to ensure that the horse doesn't try to follow your newest characters into the starter dungeon, and ensures you'll be able to find it where you put it. :yes:

After you've ironed out the details involving the AI package and the global value, we'll next make our spell that'll be oh-so important to the success of the follow/wait horse script. When making the new script-spell, we'll want its only effect to be 'Script effect.' We'll want to uncheck the hostile tag, for obvious reasons; getting pummeled by pea-brained guards is no fun! :lmao: The visual effect and spell categorization is a purely aesthetic feature, and the range should be 'self' - it'll sound odd, considering what we want the spell to do, but it's what works for me, the self-tag doesn't do anything weird to the scripts I have in place. :D

The ID, script effect name, and spell name can be whatever works for yourself. Once you're done ironing out the basic details of your spell, we can move on to the real meat of the tutorial; the scripts!

Open up whatever script may be applied to your horse, but leave your go-home script as it is. We're here to add on to your horse script, not modify it. The added code should look something like this;

Begin OnLoad

Player.AddSpell HorseFollowSpellID

End

Three whole lines needed to ensure that your player gets the spell when in-game. :D Next up, the real follow/wait script! The script is best categorized as a Magic Effect Script, here is the basic idea of it; We'll assume 0 is the base value of the global, and 1 is the value which the follow package wants.

Scriptname HorseFollowScript

Begin ScriptEffectStart

If HorseFollowGlobal == 0

Set HorseFollowGlobal to 1

HorseRef.EvaluatePackage

Message "Message"

Elseif HorseFollowGlobal == 1

Set HorseFollowGlobal to 0

HorseRef.EvaluatePackage

Message "Message"

Endif

End

Once you're done making the follow/wait magic effect script, open up the menu for your custom spell once more; Open up the script effect menu, and press the arrow next to the first piece of 'NONE' text which you see. Find your Follow/Wait script in the list, and select it.

After you're done polishing off the new script, spell, AI package, and GlobalValue, you're more or less ready to see if your horse is working! The process of creating a follow/wait script for horses is about as painless as it gets, but it's more than worth the trouble when you're not on horse-back, especially if you're out to pick flowers.

An interesting note regarding the follow/wait stuff;

If your horse's follow package is active, and you fast-travel into a city on horseback, you'll still be on horse back in the city you fast-traveled to. This is because the game tags your horse as a 'follower' which apparently overrides the 'horse' tag. If the follow package is not active, however, the game will try to stable your horse as usual.

Link to comment
Share on other sites

Here it is! :D

First off, we'll want to make a global value that exists only to supply your horse's follow package and follow/wait spell with variables. You can call it whatever you please. I recommend leaving it as a 'short' variable type, with a default value of 0. :yes:

I'm already lost, sorry!

Should I go to the file menu, select Gameplay | Global

Ok I did it, I called it FoloSolemate -- had no idea what to call it.

Step 2, A new Follow Package, so I'm thinking this is a new AI Package:

ID myrHorseFollow

Package Type Follow

(defensive combat checked it was default)

Why does the target give me a cell selection.? (abandoned mine)

Ref: Player Player Ref selected. Distance is 50

I have no clue at all what kind of condition I should make so I just saved until you help me.

(thank you)

Link to comment
Share on other sites

Cell Selection doesn't mean anything in the case of your follow package. You can leave it at abandoned mine, the game seems to equate 'AbandonedMine' to 'Cell independent' (That is, the package will activate wherever the horse happens to be. It wont expect the horse to be in the AbandonedMine.)

Defensive Combat seems to be a redundant tag for horses and other naturally non-aggressive companions, you can either keep it checked or remove the check, whichever suits you best. :D

For Conditions;

After making a new condition, look for 'GetGlobalValue' Under the Condition Function text. This will tell the package to activate only when a Global Value has reached a certain value. To tell your package to use FoloSoleMate as its reference global value, Press the [iNVALID] button under Function Parameters. A menu listing all the global values will pop up, your custom values included. :yes:

After you've selected your FoloSoleMate global value as the package's 'function parameter' you can skip the comparison, we want it to be left at == . The Use Global and the OR/AND tag will harm the script, so we want to leave those unchecked.

Does this explain how to setup the Conditions of your follow/wait package? :D

Edit: In the add spell portion of the horse's script, I changed 'Begin GameMode' to 'Begin OnLoad' This is to basically ensure new characters who pop up in the dungeon don't immediately get hammered with spells that they can't use yet.

Edit: Done with it, far as I know. :lmao: Feel free to ask if the game goes bonkers on you, or if you feel there's a gaping hole in the tutorial somewhere. :D

Link to comment
Share on other sites

EDIT: you should know I'm doing a stream of thought process, so I'm continuing to forrest gump my way through.)

Ok

New Condition:

Condition Function "get global value"

Function Parameters "Global: 'FoloSoulmate' == Value 1.0000

Ok. I have no idea how to add a spell.

I'm guessing File Menu | Gameplay / Magic Effects...

no that's wrong, Ok, I'll add it in the object window.

In the Object Group "Magic" there is the option for a Lesser Power, and I'm thinking it should be a Lesser Power.

I've never looked in here before, did you ever notice like everything is immune to "silence".

Ok, New SPell ID is myrHorseFollow, since I may want to use it again. That's my logic.

Ok gave it a name "Ally with Solemate" want it early.

Checked Script effect always applies.. not sure if that's right.

Effect name: Script Effect: none Magnitude: 0 Area: 0 Duration: 0 Range: Self cost: 0

Magic School: Alteration (for the moment)

This next confuses me:

Open up whatever script may be applied to your horse, but leave your go-home script as it is. We're here to add on to your horse script, not modify it.

I don't know..

Link to comment
Share on other sites

:D Oops.

What I mean by that is;

Open up the menu which allows you to edit the stats of your horse. Below the text which displays the name of the horse, you'll see the Id of whatever script your horse is using. There is a "..." button next to it. Press that, and you'll have easy access to the script which your horse is using.

For making new spells;

Magic Effects defines what skills exists in the game.

The Magic Tab in the Object Window is what you seek for making new spells. Note that creating a new spell under a specific window doesn't mean it'll actually be a disease/lesser power/other spell type. That is controlled in the spell editing menu. Below name and ID of your spell, there is 'type' - you'll want to set this value to lesser power, to ensure the game doesn't try to level the magic school you've associated it with.

Script Effect doesn't appear to be necessary, far as I know. I don't have it checked on my own follow/wait spell, but the script always works. I think 'Script Effect always applies' is only meaningful if the spell can be silenced in-game. For those fancy tags below Name, ID, and type, the only tags that will matter is the 'Immune to Silence' tag. The rest need not be checked. :yes:

Link to comment
Share on other sites

:D Oops.

What I mean by that is;

Open up the menu which allows you to edit the stats of your horse. Below the text which displays the name of the horse, you'll see the Id of whatever script your horse is using. There is a "..." button next to it. Press that, and you'll have easy access to the script which your horse is using.

For making new spells;

Magic Effects defines what skills exists in the game.

The Magic Tab in the Object Window is what you seek for making new spells. Note that creating a new spell under a specific window doesn't mean it'll actually be a disease/lesser power/other spell type. That is controlled in the spell editing menu. Below name and ID of your spell, there is 'type' - you'll want to set this value to lesser power, to ensure the game doesn't try to level the magic school you've associated it with.

Script Effect doesn't appear to be necessary, far as I know. I don't have it checked on my own follow/wait spell, but the script always works. I think 'Script Effect always applies' is only meaningful if the spell can be silenced in-game. For those fancy tags below Name, ID, and type, the only tags that will matter is the 'Immune to Silence' tag. The rest need not be checked. :yes:

Ok. So I temporarily made a HorsePCSolemateScript which pretty much parrots the Shadowmere script for now.

I'm going to try adding this in to that because I'd like to have the my horse go home and I would like to have a note when my horse has returned to home.

Link to comment
Share on other sites

Ok.

I had assumed you had a basic idea of how to weave around the menus. :D I'll have to do more elaborating, it would seem!

You are moving forward much faster than I ever did, for making this follow/wait script for horses. :lmao: Took me days to figure out how to iron out my horse follow/wait script to get it to work like it does now. :D

Edit: It sounds like you're making the horse from near-scratch, rather than just simply modifying a horse already provided by the game or provided by a mod.

I'll have to look into making a test horse which has a non-complex, non-derivative go-home and follow/wait script, if you're trying to make a horse from scratch.

It's too late for me to try and make a go-home horse now, but I can work on a go-home and follow horse tomorrow. :D

Alas, I must disappear for the night. Tomorrow, I can continue working with you in your attempt to complete your horse, and I'll be better prepared as I now have a basic idea of what to elaborate on and the like. :yes:

Link to comment
Share on other sites

I had assumed you had a basic idea of how to weave around the menus. :D I'll have to do more elaborating, it would seem!

You are moving forward much faster than I ever did, for making this follow/wait script for horses. :lmao: Took me days to figure out how to iron out my horse follow/wait script to get it to work like it does now. :D

Edit: It sounds like you're making the horse from near-scratch, rather than just simply modifying a horse already provided by the game or provided by a mod.

I'll have to look into making a test horse which has a non-complex, non-derivative go-home and follow/wait script, if you're trying to make a horse from scratch.

It's too late for me to try and make a go-home horse now, but I can work on a go-home and follow horse tomorrow. :D

Alas, I must disappear for the night. Tomorrow, I can continue working with you in your attempt to complete your horse, and I'll be better prepared as I now have a basic idea of what to elaborate on and the like. :yes:

It's ok, I recognized the script button when you explained it. I don't have a script for my horse, but there are plenty of "go home AI packages" and Shadowmere returns to Fort Farragut, which is a huge spoiler because I still haven't been through the db. but I'm always running across interesting stuff about it in the CS.

Here is that script prior to any modification other than the name of the script.

ScriptName HorsePCSolemateScript

Short TellPC

Short Mounted

Begin OnDeath

Set Horses.OwnShadowmere to 0

End

Begin OnPackageEnd HorsePCFarragutGoHome

If TellPC == 0 && Mounted == 1

If GetInCell FortFarragut == 1

Message "Shadowmere has returned to Fort Farragut."

Set TellPC to 1

EndIf

EndIf

End

Begin OnActivate

Set TellPC to 0

Set Mounted to 1

Activate

EvaluatePackage

End

And my proposed changes.

ScriptName HorsePCSolemateScript

Begin onload

Player.AddSpell myrHorseFolo

End

Short TellPC

Short Mounted

;Begin OnDeath

;Set Horses.OwnSolemate to 0

;End

Begin OnPackageEnd HorsePCWeynonGoHome

If TellPC == 0 && Mounted == 1

If GetInCell WeynonPriory == 1

Message "Solemate has returned to Weynon Priory."

Set TellPC to 1

EndIf

EndIf

End

Begin OnActivate

Set TellPC to 0

Set Mounted to 1

Activate

EvaluatePackage

End

Line 12 reference is missing so I semicoloned it out for now.

Link to comment
Share on other sites

No we all have questions when we are unsure or need help :D, its to be expected :P. Hmm I wonder what Jello will say, I may have to play with the Horse AI to see of this idea works.

That would be wonderful IS, because fresh ideas collaborating makes a beautiful thing.

I wonder if we could brainstorm a wish list for horses, so that we could have the ends clearly in mind.

Link to comment
Share on other sites

That would be a good idea :P, what if there was a single menu that held all the commands for the horse?, so say one spell with a command menu that pops up like:

Command Menu:

   Follow

   Wait

   Home

   Set Home Marker

   Close

That is sweet! Especially "set home marker"

That would solve the issue of creating a stable of player owned horses in game, as well as moving to mod house with its own stable.

And what if the horse gets lost and it's not the last horse the PC rode.

This happened to me one time with my first character, with a mod added horse (Dalls Paladin Horse), and the horse was essential and never went home to where I picked him up. So he just wandered around for 3 real life months, and I finally ran into him near leyawiin during a FG quest. That was one of the more amazing adventures I had in Oblivion, but you see the problem, right?

Link to comment
Share on other sites

What you could do is script the horse, as long as its your last ridden horse it will stay outside the city ect, but once you ride another horse it will head to the home marker you set, so for example it would head to your Bruma home if thats where the marker is set.

That would be perfect.

:P

I'm going to take a screen shot of all the horse AI packages there are to select from, because I stuck them all on Solemate temporarily, since he doesn't have a working script yet anyway.

Link to comment
Share on other sites

I have not actually played with Horse AI yet in any form really, especially this. But why not actually force the correct Follow/Wait package on them with the AddScriptPackage function?

Its what I do with the pets in my pet mod and seems to work :)

In the case of my global value dependent scripts, AddScriptPackage wouldn't add on any useful functions.

Edit: I'll have to make a horse with both a go-home and follow/wait script packed into it.

The reason why your script says line 12 is missing a reference is because line 12 in shadowmere's script references not the ownership of the horse, but a variable which sets the ownership of shadowmere. (That is, the horse itself isn't really involved with line 12, a value/variable is.)

Link to comment
Share on other sites

My own personal horse-follow/wait script essentially say;

Begin ScriptEffectStart

If GlobalValue == 0

Set GlobalValue to 1

Actor.EvalutePackage

Message "Confirmation Message"

Elseif GlobalValue == 1

Set GlobalValue to 0

Actor.EvaluatePackage

Message "Confirmation Message"

Endif

End

My AI Package depends on that GlobalValue being 1, else the horse stops following the player.

I could go down from 7 global-value related lines of code to 3 or 4 value/variable modifying lines of code or so?

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