What is required for basic companion?

Post » Wed Jan 13, 2010 6:34 am

So For my mod i need an npc to follow the player for like 15seconds from one room in a house to another, no big deal, nothing requiring all the fancies of modern companion scripts.
I have this warping script from the scripting library mod and i'm not sure if it's in working order because of the no "begin blahblah" part and all, so if someone could tell me how to use it i would be thankful, and also how to set someone as a companion via dialogue/result box? I understand the command "Set companion to 1", but i don't know how to go about connecting that to the below warping script, or what "Set companion to 1" actually does. If anyone could explain i would be so thankful! Any help appreciated, thanks!

Warping script:
float myx float myy float myz float timer if ( GetCurrentAIPackage == 3 ) if ( Player->GetEffect sEffectLevitate == 1 ) AIWander 0 0 0 0 endif if ( GetWeaponDrawn == 1 ) return elseif ( GetDistance Player > 800 ) set timer to timer + GetSecondsPassed if ( timer > 8 ) set timer to 0 set myx to ( Player->GetPos x ) set myy to ( Player->GetPos y ) set myz to ( Player->GetPos z ) SetPos x myx SetPos y myy SetPos z myz endif endif endif endif 

User avatar
des lynam
 
Posts: 3444
Joined: Thu Jul 19, 2007 4:07 pm

Post » Wed Jan 13, 2010 1:48 pm

Not sure exactly what the companion command does. Obviously it sets npc as companion but this seems redundant to me.

That script youve got up there is attached to the npc and will ensure it keeps pace with you :D

All that script needs is a "Begin script_name" at the top and an "End" command at the end.

As for the actual following aspect:

Could arrange it like this:

1. [talking to the npc, for whatever reason they decide to follow you.]
2. In the conditions box at the bottom for THAT end dialogue, simply put in this command AIFollow "player" 0 0 0 0. This will direct that npc to follow the player. I am not 100% sure if they will act as a companion and defend you, etc; but i strongly suspect that they will defend and generally aid you in battle when they are following you.
3. The tricky bit is at the destination. Personally, i would knock up a simple script that only runs ONCE. This script would be attached to an invisible (ingame) marker which would detect when you are within range of it. Basically to detect that you have arrived. This script would also include a check to make sure the relevent journal entry is there, assuming you are doing this all through a quest, which you should. I assume you know about that side of it. Also, this script basically will confirm your distance and immediately update the quest to the next stage and engage the NPC to talk to you. (and then we'll discuss what to do after)

Begin script_name             if ( GetJournalIndex "quest_id" == 10 ) 	                   if ( GetDistance player < 200 ) 		                         Journal "quest_id" 20 		                         NPC->Forcegreeting 	                   endif             endif  End


4. At this stage the NPC should be talking to you. Because the journal has been updated, you can use this as a 'requirement' for the new dialogue options you want. Lets assume you now want the npc to stay at the location. In the condition box for the dialogue, simply put AiWander 0 0 0 0 0 0 0 0 0 0 0 0. This will make the npc stay still and not move around. By changing the numbers at the end, you can configure this in your own time. (i just stick with this generally, stop them wandering off :D )

And there you go.
This is how i manage my "follow" scenarios. I realise this may be slightly different to how most people do it but i do it because it gives me very precise control over when and how npc's follow me, and also because i have no idea how to organise "destinations" or anything more precise than general cells.
This method has never failed me, and i have had no reason to investigate any other way of doing it.


Hope that helps. Not 100% sure i answered what you wanted, but im too tired to check ^_^
User avatar
Britta Gronkowski
 
Posts: 3475
Joined: Mon Apr 09, 2007 3:14 pm

Post » Wed Jan 13, 2010 1:33 pm

psycholex has the right of it, you'll want aifollow, (or perhaps the command effect? hmmmmmm) rather than manually scripting the follow or enabling companion stuff. all "companion" really is is a variable that lets you access the NPC's inventory from dialog. even when companion is enabled, you still have to use ai packages, like aifollow.

that warping script is not what you want. that will plce the NPC at the player's current position every frame. that's something you'd want to run one time (so each command executes once) to get a lagging companion to "bounce back" to the player.

i do as psycholex, though i am more prone to script the behavior rather than use journals.

my own companion scripts are not nearly as complex as some are. perhaps my scripts (and associated dialog) could demonstrate to you what the library scripts are not? most of the companion frameworks i've looked at are hulking multi-script packages. my companions are one script each, and i think i even left the script comments in, they may even match the revision of the script.

i also wrote a mwse script that allows you to escort any NPC of a certain class, and then have the NPC return to their spawn point after three days gametime (to match world respawn) if aifollow on its own isnt enough to do what you're needing to, consider adapting this script. of course, going from one house to another does seem to be handled just fine with aifollow.
User avatar
Hussnein Amin
 
Posts: 3557
Joined: Sun Aug 05, 2007 2:15 am

Post » Wed Jan 13, 2010 11:36 am

You could get the warping script out of Grumpy's http://lovkullen.net/Emma/grumpy.htm code
User avatar
rae.x
 
Posts: 3326
Joined: Wed Jun 14, 2006 2:13 pm

Post » Wed Jan 13, 2010 5:19 am

Not sure exactly what the companion command does. Obviously it sets npc as companion but this seems redundant to me.

That script youve got up there is attached to the npc and will ensure it keeps pace with you :D

All that script needs is a "Begin script_name" at the top and an "End" command at the end.

As for the actual following aspect:

Could arrange it like this:

1. [talking to the npc, for whatever reason they decide to follow you.]
2. In the conditions box at the bottom for THAT end dialogue, simply put in this command ". This will direct that npc to follow the player. I am not 100% sure if they will act as a companion and defend you, etc; but i strongly suspect that they will defend and generally aid you in battle when they are following you.
3. The tricky bit is at the destination. Personally, i would knock up a simple script that only runs ONCE. This script would be attached to an invisible (ingame) marker which would detect when you are within range of it. Basically to detect that you have arrived. This script would also include a check to make sure the relevent journal entry is there, assuming you are doing this all through a quest, which you should. I assume you know about that side of it. Also, this script basically will confirm your distance and immediately update the quest to the next stage and engage the NPC to talk to you. (and then we'll discuss what to do after)

Begin script_name             if ( GetJournalIndex "quest_id" == 10 ) 	                   if ( GetDistance player < 200 ) 		                         Journal "quest_id" 20 		                         NPC->Forcegreeting 	                   endif             endif  End


4. At this stage the NPC should be talking to you. Because the journal has been updated, you can use this as a 'requirement' for the new dialogue options you want. Lets assume you now want the npc to stay at the location. In the condition box for the dialogue, simply put AiWander 0 0 0 0 0 0 0 0 0 0 0 0. This will make the npc stay still and not move around. By changing the numbers at the end, you can configure this in your own time. (i just stick with this generally, stop them wandering off :D )

And there you go.
This is how i manage my "follow" scenarios. I realise this may be slightly different to how most people do it but i do it because it gives me very precise control over when and how npc's follow me, and also because i have no idea how to organise "destinations" or anything more precise than general cells.
This method has never failed me, and i have had no reason to investigate any other way of doing it.


Hope that helps. Not 100% sure i answered what you wanted, but im too tired to check ^_^


This is exactly what i needed, you hit the target right on the money! :D Thanks for the help, i'll be sure to give you credit when i'm finished(:
so all i have to do is:
1. Talk to the npc
2. make a result that has the aifollow command in it
3. make a doonce script and attach it to aon object in the cell i'm going to so she will talk to me when arriving.
4.change the aifollow back so she won't move
This seem's to be exactly all I need, thanks psycholex!

RAkninja- i agree about just using a one script companion, and i doubt i'll even use the warp script since it's only a few feet!

Yacoby- That's where the warping script came from(:
User avatar
Lillian Cawfield
 
Posts: 3387
Joined: Thu Nov 30, 2006 6:22 pm

Post » Wed Jan 13, 2010 5:05 pm

This is exactly what i needed, you hit the target right on the money! :D Thanks for the help, i'll be sure to give you credit when i'm finished(:
so all i have to do is:
1. Talk to the npc
2. make a result that has the aifollow command in it
3. make a doonce script and attach it to aon object in the cell i'm going to so she will talk to me when arriving.
4.change the aifollow back so she won't move
This seem's to be exactly all I need, thanks psycholex!

RAkninja- i agree about just using a one script companion, and i doubt i'll even use the warp script since it's only a few feet!

Yacoby- That's where the warping script came from(:


One last note: If you use "Set companion to 1" all further dialogue boxes will include "companion share" which lets the player access the NPC's inventory and arrange it at will (give/take any items desired). For more companion examples, you can look at the NPC Calvus Horatius (not sure about that last name), who is the hirable merc companion in Tribunal. A good idea is to visit him in game and hire him to see how he works, then look at his entry in the CS - look at the dialogue and his script for a wealth of companion tips.
User avatar
Tanika O'Connell
 
Posts: 3412
Joined: Fri Jan 26, 2007 1:34 am

Post » Wed Jan 13, 2010 10:59 am

This is exactly what i needed, you hit the target right on the money! :D Thanks for the help, i'll be sure to give you credit when i'm finished(:
so all i have to do is:
1. Talk to the npc
2. make a result that has the aifollow command in it
3. make a doonce script and attach it to aon object in the cell i'm going to so she will talk to me when arriving.
4.change the aifollow back so she won't move
This seem's to be exactly all I need, thanks psycholex!


Yep no worries. Yea i forgot about the companion value allowing for inventory access. :facepalm: Not really necessary for basic "follow me" missions.

Some minor things i could mention include using the "Sound" editor box (roundish red thing) as a base for the destination script. This way you can place it very accurately. Make sure you test the distance ingame to make sure its reasonable. Also, because the script checks for a specific journal entry value, there is no need to include a "Doonce" command becuase it immediately changes the journal value and can never run again. (i suspect you realise this, but just incae/for anyone else reading)

Glad to have been of some assistance. ;)
User avatar
Lisa Robb
 
Posts: 3542
Joined: Mon Nov 27, 2006 9:13 pm

Post » Wed Jan 13, 2010 9:26 am

Yep no worries. Yea i forgot about the companion value allowing for inventory access. :facepalm: Not really necessary for basic "follow me" missions.

Some minor things i could mention include using the "Sound" editor box (roundish red thing) as a base for the destination script. This way you can place it very accurately. Make sure you test the distance ingame to make sure its reasonable. Also, because the script checks for a specific journal entry value, there is no need to include a "Doonce" command becuase it immediately changes the journal value and can never run again. (i suspect you realise this, but just incae/for anyone else reading)

Glad to have been of some assistance. ;)

hello, this is still mr. cherrie but on a different account. So i've added the command you said to the result box and the npc doens't move.
This is in the box:
AIFollow "player" 0 0 0 0
Journal "mc_tinali" 250
Goodbye

the journal and goodbye works, but the alfollow doesn't do anything :/ please help me!

And what do you mean by the red thing for accurate placement?
User avatar
Alex [AK]
 
Posts: 3436
Joined: Fri Jun 15, 2007 10:01 pm

Post » Wed Jan 13, 2010 9:47 am

Get rid of the quotes around player. That and I think it's AiFollow, not AIFollow.
User avatar
Kerri Lee
 
Posts: 3404
Joined: Sun Feb 25, 2007 9:37 pm

Post » Wed Jan 13, 2010 1:07 am

Get rid of the quotes around player. That and I think it's AiFollow, not AIFollow.


Awesome, thanks! (:
User avatar
meghan lock
 
Posts: 3451
Joined: Thu Jan 11, 2007 10:26 pm

Post » Wed Jan 13, 2010 2:10 pm

Yea that should do it. Not sure why i posted it wrong here. Sorry bout that.

Also: Its very simple to reconfigure this sort of follow system so that you can make an actual companion. One where you can tell them to follow, stay and follow again as you please (without the need for setting destinations, cos they just follow you till you say wait here). If this sounds useful, just say so and i'll post up the details.

Making companions is alot easier than most people think (especially with the 'standard' warping/companion script most people use these days; and sorry for my ignorance over who made it) and its a shame that most mods that could use one dont have one.

Meh.

ps whats the mod your making just out of interest? ^_^
User avatar
Marine Arrègle
 
Posts: 3423
Joined: Sat Mar 24, 2007 5:19 am

Post » Wed Jan 13, 2010 4:40 am

Yea that should do it. Not sure why i posted it wrong here. Sorry bout that.

Also: Its very simple to reconfigure this sort of follow system so that you can make an actual companion. One where you can tell them to follow, stay and follow again as you please (without the need for setting destinations, cos they just follow you till you say wait here). If this sounds useful, just say so and i'll post up the details.

Making companions is alot easier than most people think (especially with the 'standard' warping/companion script most people use these days; and sorry for my ignorance over who made it) and its a shame that most mods that could use one dont have one.

Meh.

ps whats the mod your making just out of interest? ^_^


I would love for you to post those details, because at the end of my mod i plan on making the main npc into a companion. But the mod itself is about a women named Mistress Tilani that you meet at the House of Earthly Delights, and have.. physical relations with, and you and her move to a cottage near seyda neen, when you discover she is actually a drug-lord and has sorters under the house, and after confronting you, leaves to her headquarters in seyda neen. The player then sets out to find her, and when he does, they make up, and you join the cartel, and she sends you on two item retrieval quest. Then both of you go back to the house near seyda neen, and she tells you to go to her dads bestfriends magic estate (teleport by ring) and you talk to him , Don Macificio, about expanding operations.. <- Thats what i have done so far. I plan to add more quest and keep going, but i just learned dialogue less then two weeks ago, so this is mostly a learning experience, and everyone has been extremely helpful. But, as much as i regret it now that i'm getting so in-depth, the mod is advlt, and i won't be able to really talk about it on here because of that. I would go back and change it, but i don't really want to change a hundred lines of dialogue and journals, and the mod is about drugs anyways, so I was going for a more mature theme. Anyways, if I've said anything inappropriate in this post please tlel me and i will remove it. Thanks for all the help, this community has been amazing!
User avatar
Jah Allen
 
Posts: 3444
Joined: Wed Jan 24, 2007 2:09 am

Post » Wed Jan 13, 2010 3:19 am

Come over to Wolfore (link in my sig). We allow and encourage the development of advlt natured mods, but we still have standards as to what is and is not allowed (no slave six, [censored], etc.). From what you've posted so far, I don't see anything that would be against our rules.
User avatar
helen buchan
 
Posts: 3464
Joined: Wed Sep 13, 2006 7:17 am

Post » Wed Jan 13, 2010 3:52 pm

'have physical relations with'.

lol good luck with that. Cello's mod which deals with that sort of thing was a monster to try and get to work. In years past i tried to get it to work but never could. Obviously that sort of thing in a video game is kind of beneath me i'd like to think (these days at least ;) )

Drugs is not in of itself a "bad" topic for a mod. After all, the game has skooma, and there are plenty of drug-boss and crime mods out there. I think we are all mature enough to discuss hyperthetical situations in a video game without thinking any of it is related to real life drugs.

But yes, the physical relations thing might be pushing it for some of the more sensitive moderators here ;)
User avatar
kiss my weasel
 
Posts: 3221
Joined: Tue Feb 20, 2007 9:08 am

Post » Wed Jan 13, 2010 6:23 am

'have physical relations with'.

lol good luck with that. Cello's mod which deals with that sort of thing was a monster to try and get to work. In years past i tried to get it to work but never could. Obviously that sort of thing in a video game is kind of beneath me i'd like to think (these days at least ;) )

Drugs is not in of itself a "bad" topic for a mod. After all, the game has skooma, and there are plenty of drug-boss and crime mods out there. I think we are all mature enough to discuss hyperthetical situations in a video game without thinking any of it is related to real life drugs.

But yes, the physical relations thing might be pushing it for some of the more sensitive moderators here ;)

Well it's just dialogue based erotica, nothing fancy. Just me relating to my hormonal teenage years haha ;D
User avatar
courtnay
 
Posts: 3412
Joined: Sun Nov 05, 2006 8:49 pm

Post » Wed Jan 13, 2010 1:57 pm

Lololol I'm sure saucy dialogue is nothing new to the Internet. Content aside, dialogue problems are still very relevant for discussion so don't hesitate to ask more.
User avatar
liz barnes
 
Posts: 3387
Joined: Tue Oct 31, 2006 4:10 am

Post » Wed Jan 13, 2010 2:36 am

Lololol I'm sure saucy dialogue is nothing new to the Internet. Content aside, dialogue problems are still very relevant for discussion so don't hesitate to ask more.

haha I shan't :celebration:
User avatar
Anna Kyselova
 
Posts: 3431
Joined: Sun Apr 01, 2007 9:42 am


Return to III - Morrowind