Jump to content

How to check faction of player?


azzendix

Recommended Posts

Cdcooly, ("You seem to be reaching allot of conclusions with very little information.") - This is not correct Cdcooly has confirmed that he actually downloaded the Mod.

 

Also I do not think it was very good advice for you to suggest he leave a Perk like that on the player when it is totally unnecessary.

 

How do you know how far back he installed this Mod? He may only have to go back a couple of game saves to get rid if it.

 

 

azzendix

Can we see one of these scripts? Why would you have an activator property on your activator? It does not know what it is?

 

1. You would have one Activator base object with one script.

2. You place it in the cell in front of your shadowmarks and then you fill in the script properties of the Activator "ObjectReference" Did you not look at the other activators and triggers?

 

As far as your script this should be all that you need.

You would fill the Shadow Mark Message property with the message for that Mark.

Then if you have a Quest and Stage you want to gate you fill those in. If you do not the event will fire when the player is a member of the Guild.

 

 

This is just an example script I am not at my modding computer.

ScriptName ShadowMarkScript extends ObjectReference

;Source Cdcooly https://forums.nexusmods.com/index.php?/topic/5237750-how-to-check-faction-of-player/ Updated by MoN

Message Property ShadowMark Auto ; Fill this property based on the Shadowmark the activator is placed on. 
Faction Property Thievesguildfaction Auto
Quest Property QST Auto
Int Property GateStage = -1 Auto 

Event OnActivate(ObjectReference akActionRef)
        ShadowMark.Show() ;Give information about valuable items.
EndEvent

Event OnCellAttach()
If (QST && QST.IsStageDone(GateStage)) || GateStage == -1 
If Game.GetPlayer().IsInFaction(thievesguildfaction)
  If IsDisabled()
    Enable()
  EndIf
Else
  If IsDisabled()
  Else
    Disable()
  EndIf
EndIf
EndIf
EndEvent

This is another version.

ScriptName ShadowMarkScript extends ObjectReference

;Source Cdcooly https://forums.nexusmods.com/index.php?/topic/5237750-how-to-check-faction-of-player/ Updated by MoN

Message Property ShadowMark Auto ; Fill this property based on the Shadowmark the activator is placed on. 
Faction Property Thievesguildfaction Auto
Quest Property QST Auto
Int Property GateStage = -1 Auto 

Event OnActivate(ObjectReference akActionRef)
ShadowMark.Show() ;Give information about valuable items.
EndEvent

Event OnCellAttach()
If QST 
  If QST.IsStageDone(GateStage) 
    CheckFaction()
  EndIf
Else
  CheckFaction()
EndIf


Function CheckFaction()
If Game.GetPlayer().IsInFaction(thievesguildfaction)
  If IsDisabled()
    Enable()
  EndIf
Else
  If IsDisabled()
  Else
    Disable()
  EndIf
EndIf
EndEvent
EndFunction
 
Edited by Masterofnet
Link to comment
Share on other sites

 

Cdcooly, You seem to be reaching allot of conclusions with very little information. Also I do not think it was very good advice for you to suggest he leave a Perk like that on the player when it is totally unnecessary.

 

How do you know how far back he installed this Mod? He may only have to go back a couple of game saves to get rid if it.

 

I have plenty of information. The mod in question was already published before this thread was even started and I downloaded it. My script was based on the ones from the existing mod not just the information posted in this thread.

 

There's absolutely nothing wrong with the current implementation of the mod and it does what the creator wanted. The perk implementation is not very resource intensive since it only gets checked when the player places an object in the crosshair and activates it. My concern about updating is for all of the people who have already started playing with the existing version of the mod. Yes it would be possible to alter the scripts and remove the perk from the player but the gains would be very tiny for the work involved. If the mod hadn't already been published it might be worth it, but not now.

 

The mod simply displays descriptions of what the marks mean when the player activates them. If there were some substantial benefit to activating them it might make sense to disable the feature if the player gets kicked out of the guild, but since all it does is display information it really doesn't make sense in this case. Getting kicked out of the guild won't magically make you forget what the various symbols mean.

Link to comment
Share on other sites

 

If there were some substantial benefit to activating them it might make sense to disable the feature if the player gets kicked out of the guild, but since all it does is display information it really doesn't make sense in this case. Getting kicked out of the guild won't magically make you forget what the various symbols mean.

 

I have to disagree, if the player needs to be a member to read the shadow marks then if they are kicked out they must not be able to read them. Anything else would be "generic".

 

It seems I am the one who has a lack of information.

 

Why is he not using just one base activator and one script?

 

What you would do is make an updated version of the Mod that is done properly. Not just leave it the way it is.

Edited by Masterofnet
Link to comment
Share on other sites

This is one of shadow mark activator script. I have 9 activators and 9 scripts for 9 type of shadowmarks.

I attach this script to the shadowmarks with "create trigger" button in CK. Please read this link for more detail.

Scriptname ShadowMarkCache_Script extends ObjectReference  

Message Property ShadowMarkCache_Msg  Auto  

Event OnActivate(ObjectReference akActionRef)
    ShadowMarkCache_Msg.Show()
endEvent 

This is the quest script to add that perk to a player.

Scriptname ReadableShadowmarksAddPerk extends ReferenceAlias  

Perk Property ShadowMark_Perk  Auto  

Event OnInit()
	Utility.Wait(0.1)
	Game.GetPlayer().AddPerk(ShadowMark_Perk)
EndEvent
 

--------------------------------

All discussion here is very useful to me because I plan to re-create this mod again in the future with a good scripting practice from this thread.

I will publish it as a new mod, like Readable Shadowmarks Redone and tell users it's not safe to switch from old mod mid-playthrough.

Edited by azzendix
Link to comment
Share on other sites

This is one of shadow mark activator script. I have 9 activators and 9 scripts for 9 type of shadowmarks.

I attach this script to the shadowmarks with "create trigger" button in CK. Please read this link for more detail.

 

The lever that you used to make your activator. Do you see multiple copies of it's base object in the kit? No, there is only one and that base object is brought into the cells and it's object reference is used.

 

You should be able to use just one base activator and one activator script to accomplish your goal.

 

Please look over my #11 post on this thread.

 

--------------------------------

All discussion here is very useful to me because I plan to re-create this mod again in the future with a good scripting practice from this thread.

I will publish it as a new mod, like Readable Shadowmarks Redone and tell users it's not safe to switch from old mod mid-playthrough.

 

Glad to hear it.

Link to comment
Share on other sites

  • 3 years later...

use function GetFactions(..) from SKSE. That's all you need. This is MY working example:

Event OnEffectStart(Actor akTarget, Actor akCaster)
Debug.Trace(akCaster + " -> " + akTarget)
facts=akTarget.GetFactions(-127,128)
notification(facts)
Debug.Trace(facts )

While (i <= 30) && (lastf != facts) && (facts != "")
strf=strf + " \n" + facts;
lastf = facts
i=i+1
endwhile

debug.MessageBox(strf);
notification(strf)
EndEvent

Thanks for reading after 3 years :smile:

Edited by adenis78
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...