Cool Script for Followers

Post » Sat Oct 26, 2013 5:52 pm

Hi Everyone I just finished working on a cool Script for Followers. Wanted to share it :icecream:

Essentially, if they ever get defeated, they will be teleported back to the temple in Balmora.

From there you can talk to them again and get them to rejoin.

Here is the Script... Gharen_Dhen is the ID of my follower, change it to the ID of your Follower(s).

Also FollowerResp is a Restore Health Spell I created that heals the follower.

begin followerrespawn
if ( Gharen_Dhen->GetHealth < 1 )
Gharen_Dhen->Resurrect
Cast Followerresp, Gharen_Dhen
Gharen_Dhen->Disable
Messagebox "Your follower has been defeated, Almsivi teleported him back to the Temple in Balmora"
Gharen_Dhen->StopCombat
Gharen_Dhen->Positioncell 4061.724, 4283.385, 14736.000, 270.0, "Balmora, Temple"
Gharen_Dhen->Enable
endif
end followerrespawn
User avatar
josh evans
 
Posts: 3471
Joined: Mon Jun 04, 2007 1:37 am

Post » Sat Oct 26, 2013 2:54 pm

Just so you know, Resurrect completely resets the NPC/Creature's inventory so companions will lose all the stuff you give them after this script executes. Also, their death will still be tracked if you're using GetDeadCount on them for any reason.

Edit: Might I suggest trying to simulate D&D style resurrection instead? This would entail (simulating) picking up your fallen companion, or planting a magical item on them that would teleport them to the Temple, allowing you to access their inventory before sending them on their way. Also, if you made a mod like this, maybe where you even have to pay the Temple to resurrect them (for balance), I could see it being a popular mod for all companions.

Did you know that if you start a script from within the NPC's script or dialogue, it is automatically targeted to them? This means you can apply the global script to any companion (but only one at a time, and you have to reset and stop the script manually). Any local variables in the targeted global script will only apply to the NPC while the script is running on them, and cannot be referenced outside that script like their local variables can, but it's still a versatile system.

User avatar
Roddy
 
Posts: 3564
Joined: Fri Jun 15, 2007 11:50 pm

Post » Sun Oct 27, 2013 1:15 am

I think a script that teleports your companion BEFORE he dies (when his healt is low) would work better. For example in the mod 'Great House Dagoth', when your health is very very low you are teleported to the Heart Chamber and fully healed.

User avatar
Killah Bee
 
Posts: 3484
Joined: Sat Oct 06, 2007 12:23 pm

Post » Sat Oct 26, 2013 6:47 pm

Thanks for the feed back guyz I really like all of your ideas...

There are issues though...

It would be either the Follower gets healed and Teleported back to the Temple, or you loot the corpse and then drop the item that raises the follower and then give him back his equipment (which could be a nice cost to the whole process,making it challenging in some way as you need to stop in the middle of battle and take care of it).

Great stuff guyz, thanks a lot for the feedback, I'll work on it and update the thread...

Peace! :run:

User avatar
Wane Peters
 
Posts: 3359
Joined: Tue Jul 31, 2007 9:34 pm

Post » Sat Oct 26, 2013 10:22 pm

In the spirit of what Hidronax suggested, how about something along these lines?

Short TeleAwayOnceFloat CurrentHealthRatioFloat FatigueChangeSet CurrentHealthRatio to GetHealthGetRatioIf ( CurrentHealthRatio <= 0.1 ) ;10%    If ( TeleAwayOnce == 0 )        Gharen_Dhen->StopCombat        Gharen_Dhen->Disable        Gharen_Dhen->Positioncell 4061.724, 4283.385, 14736.000, 270.0, "Balmora, Temple"        Messagebox "Your follower has been defeated, Almsivi teleported him back to the Temple in Balmora"        Gharen_Dhen->Enable        Set FatigueChange to ( GetCurrentFatigue - 1000 ) ;Knock him out for a long time        ModCurrentFatigue FatigueChange        AIWander 50 0 0 0 0 ;make him move so he falls down        Set TeleAwayOnce to 1    EndIfEndIf
User avatar
Baby K(:
 
Posts: 3395
Joined: Thu Nov 09, 2006 9:07 pm


Return to III - Morrowind