Oblivion

File information

Last updated

Original upload

Created by

Duke Patrick

Uploaded by

sca

Virus scan

Safe to use

Tags for this mod

About this mod

give this ring to the companion, it will produces a sound effect that cannot be heard. Then a simple OBSE fuzzy logic detection command will detect it in the NPC inventory. Because of the way the command works any other mod can participate in this system without using a duke Patrick master mod or any other direct connection to any other mod.

Permissions and credits
Duke Patricks - Friendship Ring For Companion Detection
OBSE 18 or better needed.

Rev 1.8
I guarantee now you will not get that “repeated message” when the companion scripts move their inventory around.

REV 1.6 If any other mod forcibly removes the ring (such as with remove all inventory commands) it is returned to the NPC soon after now. And now the script checks to be sure the NPC only has 1 ring not more.


Rev 1.1 Add a touch spell to the players inventory once the player goes in to their inventory menu for 7 seconds. This spell will give the ring to an NPC companion that does not have the standard share feature.



WHAT THIS MOD CAN DO!
--------------------------
Detecting companions has been a nightmare to try to do.

You can check to see if the NPC is "following" the player but that is only somewhat reliable as there are many reasons to follow the player and yet not be a companion. But I recently had I an idea, a companion friendship ring that will allow my mods and other mods to see that an NPC is your companion to exclude them as necessary from any effects that they should be excluded from.


Known mods that use this system as of this writing:

- Duke Patricks - Near Miss Magic And Arrow Shots Alert The Target

- Duke Patricks - Street Performer

- Duke Patrick's Dont Be A Soch

- Duke Patricks Fresh Kills Now Alert The NPCs

Here was my crazy idea, give a ring to the npc that produces a sound effect that cannot be heard. Then use the fuzzy logic detection command to detect if that silent sound is coming from the NPC.

Because of the way the command works any other mod can participate in this system without using a Duke Patrick master mod or any other direct connection to any other mod.

All the modder must do is add this simple OBSE line to their script:


if ( me.GetSoundPlaying "DPFriendShipRing" ) > 0
;do or don’t do stuff
endif

That is it, no more than that!
"ME" can be any NPC reference.

And it will not matter if the player does not use any
companion mod or even if they do not use this Duke Patricks - Friendship Ring For Companion Detection or not. Your mod will run just the same even if they are not using companions.


The only mod that needs the few lines of code shown above are mods that effect NPC but should not effect the companions. For example say you make a cool "put all the NPC around you to sleep spell" mod but you do not want to force sleep the companions.

Then the mod maker that makes this "sleep spell" mod would use the code I provided (shown above) in his or her script to filter out the companions. And even if NO PLAYER loads a companion mod AND NO player loads my friendship ring mod, the force sleep mod will run just fine in everyone's game!

This is because the code shown above in the spell mod is ignored in the game unless there is a companion mod loaded and my Friendship Ring mod loaded.

DO NOT be confused by thinking this is intended for the modders that make companion mods. That is NOT the case. This system is intended to be used by modders that make mods that should NOT effect NPC that are considered by the PLAYER as their companions.



Pseudo code example of how to use my code in your mods:


CODE
Scriptname YourKillSpell


Scripteffect start
if ( GetSoundPlaying "DPFriendShipRing" ) > 0
dispel ThisKillSpell
endif


Scripteffect update

if getdead == 0
Kill
endif

end


That is all you do, you the modder NEVER have to downloaded my mod EVER! All you did was put in the code shown above. So now say a player uses your mod but never heard of my companion detection mod. The game IGNORES my code and your spell will kill everyone in the area of effect.

But lets say now they complain..er I mean request...that your mod is cool but they want you to change it so that their dear loved companions do not also get killed in the AOE. All you tell them to do is to use my mod to give the ring to their companions and now the companions are safe from the kill spell.

All modders may use theses lines of code in their scripts without first getting permission from me (as long as they do not knowingly use it in a way that would conflict with my mod). Now with all the mods that are "Friendship Ring enabled" have the ability to filterer out or detected companions as you desire.

I would appreciate it if you did email me to let me know your mod is "Friendship Ring enabled" so I can list it as such but that it not a prerequisite to using my detection code shown above in your mods.


It will take a little creative use of the code but nothing the modders cannot handle.

Ah yes!...I love finding creative answers to complex problems....


You will get the touch spell to give the ring to your friends to once you are in your inventory menu for 7 seconds.



---------------------------------------
I got this Email:

QUOTE (con-tur-eh @ Dec 31 2008, 12:07 PM)
Why does the ring need to play a sound? Can't you just add it into their inventory and use getitemcount to see if they have it?


My reply:

At first one would think so, but then this is why it has not been done before.
This is one of those esoteric aspects of modding this game:

GetItemCount requires an explicit ID.

My way uses fuzzy logic to sample a "possible" ID

This way a modder can put the few lines of code I offer in their mod and
yet NEVER have downloaded my mod and it will work. (Work as it would have before my mod came along.)

BUT ALSO...their players need never have even heard of my mod, but their mod will work normally anyway (work as it would have before my mod came along) even if they are not using a companion mod and even if they are not using my mod.

However IF THEN those same players want to run their SAME companion mod with "companion detection", then that is when they will need to use my mod.

It all works with the same ONE mod, no patches, no master esp no merged mods needed whats so ever.

Keeps everything nicely independent that way!
-------------------------------------------------



This mod may be bashed or merged BY THE PLAYER with no problems to help reduce slot usage in the load order.

Permission is not given to modders to merge my mod into your own mod. If you want players to use my companion detection system please tell your players to download my mod.

If there is an extremely compelling reason that you need to merge my companion detection mod into your mod email me and I will consider it. But at this time I cannot think of any compelling reason possible.


Legal
.................
I worked very hard on this mod. But this mod is a product more of creativity, sweat and tears than script writing talent. You are completely welcome to use the line of script [ if ( me.GetSoundPlaying "DPFriendShipRing" ) == 1 ] in your mods. But only if you tell your players to download and use my mod so that it works. And please Email me at either Spookyfx in the www.bethsoft.com/bgsforums or SCA on the www.tesnexus.com where you downloaded this mod. (The only place you can find this mod legally uploaded.)




THANKS TO
-----------------

The OBSE team, they make it possible for me to make my mods possible for you!

And of course Bethesda for allowing all of us to shape and personalize our own virtual playgrounds! Please do not let the ignorant and uninformed people at the games ratings board influence your choice to provide tools and permissions to mod your game code!



For the most advanced SCA combat with sword and shield:
http://www.spookyfx.com/book/tromp.html