Problems with getting creature companion to follow commands

Post » Fri May 04, 2012 4:00 am

Hi yall, am relatively new to modding. and figured the best place to start was with morrowind. have made property, altered land and made NPC's and am now trying to make a bear companion. I've got the bear and the dialogue but I am unable to get it to follow comands. I just want to be able to tell it to Stay, follow and Return home. Can anyone tell me how to achieve this please.
User avatar
Sabrina Schwarz
 
Posts: 3538
Joined: Fri Jul 14, 2006 10:02 am

Post » Fri May 04, 2012 12:12 am

I did something similar with a http://planetelderscrolls.gamespy.com/View.php?view=Mods.Detail&id=36587&id=8792. I'm linking to the mod in case you wanted to download it and take a look at my dialog. Basically, you have to add the dialog in like you would for an NPC, but you MUST use the creature's ID as the filter. Otherwise the creature will not have access to that dialog. You cannot use a generic filter like a variable because creatures only have access to dialog that is specifically assigned to them. Feel free to use anything from my mod, just give Melian and Grumpy credit if you use the scripts. Thanks.
User avatar
TIhIsmc L Griot
 
Posts: 3405
Joined: Fri Aug 03, 2007 6:59 pm

Post » Fri May 04, 2012 11:06 am

The basic of these functions are handled through the results window in dialogue;

choice "Stay" 1 "Follow" 2 "Go home" 3

Results;

"Stay"

AIwander, 0 0 0 40 30 30 0 0 0 0 0 0 (or whatever the original string was)

"Follow"

AIfollow Player 0 0 0 0

"Go home"

Set home to 1

Begin BearCompShort companionShort Homeset companion to 1if ( home == 1 )     if ( CellChanged == 1 )         PositionCell, float_x, float_y, float_z, float_zRot, "your home cell ID"         AIwander, 0 0 0 40 30 30 0 0 0 0 0 0         set home to 0     else         returnelse      return      endifendifend

This, as said is very basic. I would look at the link Jac has provided for a much more satisfying companion experience. :yes:

[edit]

I forgot to mention the "floats" in the PositionCell are world coordinates of where you want your companion to go; x,y,z on the Cartesian and zRot is angle in minutes (1 deg = 60 min) the bear will face.
User avatar
Tamara Dost
 
Posts: 3445
Joined: Mon Mar 12, 2007 12:20 pm

Post » Fri May 04, 2012 4:35 am

Thank guys. Im pretty sure this is what im looking for.

But I noticed that you've both used scripts. Never tried it before is it hard to do or am I likely to screw up the game / mod. Of coarse then theres the question that after i've writen the script which I presume is done through the pencil tab in the CS is it just accessed through the script lore in the creature details box, or do I have to do something else first.

Jac I have had a realy good look at your mod and think its pretty much the perfect creature companion, but I can't find how to send it home, if im not just an idiot and missing it is it possible to just add Miles_Acraeus script (above) to yours or would this mess up the whole thing. If I can where do I add it. I would love to use these scripts for my Dwarven mountain bear as hes a fairly integral part to my storyline.

I know im a pain in the butt and for that I apologise, but im working on a dwarf stronghold with a quest to;
A) Liberate mines from goblins.
B) Liberate Enslaved dwarves and re establish them within the stronghold as artisans.
C) Establish all the other slaves you can free in the game with their own little comunity (housing, shops, pub etc)
D) Periodic raids on new stronghold & community by slave traders, pirates and the Drens.

I've done quite a bit of work on it so far and I realy dont wona screw it up. Knowing my luck thats exactly what im heading for.

I ask a lot, I am aware of this but it is better to listen to the wise on matters you just don't understand rather than pretend you are wise to impress others.

P.S. how do I add the subscript to my posts like you both have above.
User avatar
celebrity
 
Posts: 3522
Joined: Mon Jul 02, 2007 12:53 pm

Post » Fri May 04, 2012 11:05 am

I didn't add a home option, but a quick script is all that would be needed. Seeing as how you're extremely new to scripting, you may want to read through the http://planetelderscrolls.gamespy.com/View.php?view=Mods.Detail&id=6083 to get an idea as to how scripts are written and the logical process behind them.

As for your scripting question, the easiest way would be to create a script in the result box when you tell the bear to go home:

GoodbyePositionCell, float_x, float_y, float_z, 0, "your home cell ID"AIwander, 0 0 0 40 30 30 0 0 0 0 0 0

Where the float_x, float_y, and float_z are the X, Y, and Z coordinates of where you want the bear to end up in the cell name of "your home cell id" (e.g. "Seyda Neen").

@Miles_Acraeus: you only need to set companion to 1 if you want the player to be able to access the NPC's inventory. If not, it doesn't need to be declared.
User avatar
Amelia Pritchard
 
Posts: 3445
Joined: Mon Jul 24, 2006 2:40 am

Post » Fri May 04, 2012 4:01 am

Thank guys. Im pretty sure this is what im looking for.

But I noticed that you've both used scripts. Never tried it before is it hard to do or am I likely to screw up the game / mod. Of coarse then theres the question that after i've writen the script which I presume is done through the pencil tab in the CS is it just accessed through the script lore in the creature details box, or do I have to do something else first.

Jac I have had a realy good look at your mod and think its pretty much the perfect creature companion, but I can't find how to send it home, if im not just an idiot and missing it is it possible to just add Miles_Acraeus script (above) to yours or would this mess up the whole thing. If I can where do I add it. I would love to use these scripts for my Dwarven mountain bear as hes a fairly integral part to my storyline.

I know im a pain in the butt and for that I apologise, but im working on a dwarf stronghold with a quest to;
A) Liberate mines from goblins.
:cool: Liberate Enslaved dwarves and re establish them within the stronghold as artisans.
C) Establish all the other slaves you can free in the game with their own little comunity (housing, shops, pub etc)
D) Periodic raids on new stronghold & community by slave traders, pirates and the Drens.

I've done quite a bit of work on it so far and I realy dont wona screw it up. Knowing my luck thats exactly what im heading for.

I ask a lot, I am aware of this but it is better to listen to the wise on matters you just don't understand rather than pretend you are wise to impress others.

Definitely read through the tutorial and guide MSFD provided by Jac. Start small and simple, build upon that, and ask questions... That's what this forum is for.

Good luck with your project!

P.S. how do I add the subscript to my posts like you both have above.

Use [.code] *text* [/.code] tags (remove the . before and after the forward slash)


I didn't add a home option, but a quick script is all that would be needed. Seeing as how you're extremely new to scripting, you may want to read through the http://planetelderscrolls.gamespy.com/View.php?view=Mods.Detail&id=6083 to get an idea as to how scripts are written and the logical process behind them.

As for your scripting question, the easiest way would be to create a script in the result box when you tell the bear to go home:

GoodbyePositionCell, float_x, float_y, float_z, 0, "your home cell ID"AIwander, 0 0 0 40 30 30 0 0 0 0 0 0

Where the float_x, float_y, and float_z are the X, Y, and Z coordinates of where you want the bear to end up in the cell name of "your home cell id" (e.g. "Seyda Neen").




Alternatively you could work it into the companion script or just run a separate global initiated by the dialogue results for the response;

"Go home"

results;

Goodbye
StartScript, BearComp


Begin BearCompShort Homeif ( MenuMode == 1 )	 returnelseif ( home == 1 )	 if ( CellChanged == 1 )		 PositionCell, float_x, float_y, float_z, float_zRot, "your home cell ID"		 AIwander, 0 0 0 40 30 30 0 0 0 0 0 0		 set home to 0	 else		 returnelse	  return	  endifendifendifStopScript, BearCompend

With this method, the bear just doesn't go "poof" when dialogue is done.

There may be other variables in the companion script that would have to be reset, but I'm unsure until I look at it.



@Miles_Acraeus: you only need to set companion to 1 if you want the player to be able to access the NPC's inventory. If not, it doesn't need to be declared.

I know, that's why I included it. Unless of course companion share is not wanted, then disregard. :tongue:
User avatar
Karen anwyn Green
 
Posts: 3448
Joined: Thu Jun 15, 2006 4:26 pm

Post » Fri May 04, 2012 5:59 am

Thanks again guys. The perfect answer.

The Morrowind scripting for dummies suddenly makes things a little clearer, even after only having a quick glance, so ill have a realy good read over it before I go any further. But I think ill still use your advice and scripts for my mountain bear, as long as you have no objections.

Just as a by the by is the scripting the same for morrowind, oblivion and skyrim or will I have to learn different scripting for each.

Also wondering what the warn status 0% is under my details and its this bit im trying to get on my page

Round and round and round we spin,
With feet of lead and wings of tin..."

http://www.quotationspage.com/quotes/Kurt_Vonnegut
?
As http://www.gamesas.com/user/22412-miles-acraeus/ has but obviously my own, as below.


I ask a lot, I am aware of this but it is better to listen to the wise on matters you just don't understand rather than pretend you are wise to impress others.
User avatar
Antony Holdsworth
 
Posts: 3387
Joined: Tue May 29, 2007 4:50 am

Post » Fri May 04, 2012 12:51 am

Thanks again guys. The perfect answer.

The Morrowind scripting for dummies suddenly makes things a little clearer, even after only having a quick glance, so ill have a realy good read over it before I go any further. But I think ill still use your advice and scripts for my mountain bear, as long as you have no objections.

Just as a by the by is the scripting the same for morrowind, oblivion and skyrim or will I have to learn different scripting for each.

Also wondering what the warn status 0% is under my details and its this bit im trying to get on my page

Round and round and round we spin,
With feet of lead and wings of tin..."

http://www.quotationspage.com/quotes/Kurt_Vonnegut
?
As http://www.gamesas.com/user/22412-miles-acraeus/ has but obviously my own, as below.


I ask a lot, I am aware of this but it is better to listen to the wise on matters you just don't understand rather than pretend you are wise to impress others.

No one is sure about Skyrim scripting just yet until the editor has been released (should be this month), but there is a change from Morrowind to Oblivion, and I suspect that Skyrim will be as trimmed and efficient as its predecessor.

A signature is set in the same page as other profile settings. Drop down on your user name in the upper left of the forum header (of course you need to be logged in) and select My Profile, then select Edit profile (upper right)-> then select signature-> edit signature, enter what you like in the editor, then hit Save Changes.

The warn status bar is for you and forum moderators/admin to know when you're about ready to get the boot from the forums. Violate forum rules and get a warning. Three infractions can get you banned. Of course one infraction could cause the same, depending on the severity.
User avatar
Ricky Rayner
 
Posts: 3339
Joined: Fri Jul 13, 2007 2:13 am

Post » Fri May 04, 2012 10:23 am

Forgot to mention, when using a global script certain functions require a fix since the script is not attached to the calling object, e.g.

"my bear ID"-> PositionCell, float_x, float_y, float_z, float_zRot, "your home cell ID"
"my bear ID"-> AIwander, 0 0 0 40 30 30 0 0 0 0 0 0

And lose the short variable Home.
User avatar
Alyce Argabright
 
Posts: 3403
Joined: Mon Aug 20, 2007 8:11 pm

Post » Fri May 04, 2012 1:31 am

This has also helped me. Thanks guys.
User avatar
IsAiah AkA figgy
 
Posts: 3398
Joined: Tue Oct 09, 2007 7:43 am


Return to III - Morrowind