A way to detect when actors are in a friendly brawl and not

Post » Wed Jun 20, 2012 8:37 pm

I need a way to detect when actors are in a friendly brawl and not a real fight.

I have a script that kills actors with the fist attack under some circumstances and just discovered that "kill" script command bypasses what ever the normal mechanics are to prevent death in brawls.
User avatar
Kanaoka
 
Posts: 3416
Joined: Fri Jun 16, 2006 2:24 pm

Post » Wed Jun 20, 2012 8:26 pm

Maybe I do not need to do it that way, maybe I just need to take more stamina away along with the health so that the opponent is exhausted before they die?

Anyone know how the fist fighting works? It does SOME damage to health, but also to stamina right?
User avatar
Ian White
 
Posts: 3476
Joined: Thu Jul 19, 2007 8:08 pm

Post » Wed Jun 20, 2012 1:34 pm

Have you read http://www.gamesas.com/topic/1357446-mod-first-day-release-problem-urgent-help-needed/? I think the scripts towards the end are the ones that check for brawling.

This looks like the relevant code:

if (target.IsDead() || ActivationChance <= RandomFloat() || \  (DGIntimidateQuest.IsRunning() && DGIntimidateQuest.GetCurrentStageID() < 100) || \  (target.GetCurrentLocation() == WhiterunJorrvaskrLocation && \  C00JorrvaskrFight.IsRunning() && C00JorrvaskrFight.GetCurrentStageID() < 100))    GoToState(State_Ready)    returnendif
User avatar
Nick Tyler
 
Posts: 3437
Joined: Thu Aug 30, 2007 8:57 am

Post » Wed Jun 20, 2012 2:50 pm

Thanks, that is a good start but it will not work for moded brawls.
That thread was very educational however!


Have you read http://www.gamesas.com/topic/1357446-mod-first-day-release-problem-urgent-help-needed/? I think the scripts towards the end are the ones that check for brawling.

This looks like the relevant code:

if (target.IsDead() || ActivationChance <= RandomFloat() || \  (DGIntimidateQuest.IsRunning() && DGIntimidateQuest.GetCurrentStageID() < 100) || \  (target.GetCurrentLocation() == WhiterunJorrvaskrLocation && \  C00JorrvaskrFight.IsRunning() && C00JorrvaskrFight.GetCurrentStageID() < 100))	GoToState(State_Ready)	returnendif
User avatar
Damien Mulvenna
 
Posts: 3498
Joined: Wed Jun 27, 2007 3:33 pm

Post » Wed Jun 20, 2012 9:17 pm

Hm, you would need either a centralized list of actors currently participating in a brawl or some spell/keyword that tags actors brawling.
Doing so would essentially require the community agreeing on some implementation.

That's my take on it -- I haven't found anything more central to brawls than the code RandomNoob quoted.
User avatar
Tamika Jett
 
Posts: 3301
Joined: Wed Jun 06, 2007 3:44 am

Post » Wed Jun 20, 2012 8:23 pm

If both combatants are set as essential, won't it be better to check against that (i.e. both actor and GetCombatTarget () are essential) rather than checking if those Quests are running? Imagine another mod with another Quest that required a Brawling feature.
User avatar
Guy Pearce
 
Posts: 3499
Joined: Sun May 20, 2007 3:08 pm

Post » Wed Jun 20, 2012 6:23 pm

The aren't essential; any other mod should try to use the DGIntimidateQuest if possible.
User avatar
cassy
 
Posts: 3368
Joined: Mon Mar 05, 2007 12:57 am

Post » Thu Jun 21, 2012 3:36 am

Weird, 'coz Gerdur became IsEssential () when I had to intimidate her for Muscle For Hire Companion Quest. Then she became not essential immediately after that.
User avatar
Laura Cartwright
 
Posts: 3483
Joined: Mon Sep 25, 2006 6:12 pm

Post » Wed Jun 20, 2012 4:57 pm

Hmm... well if they were actually essential, then this topic wouldn't be here in the first place, right? There is both a Kill function and a KillEssential function, so I'm pretty sure that essential actors shouldn't die when using Kill. Maybe that was just something unique to Gerdur.
User avatar
Strawberry
 
Posts: 3446
Joined: Thu Jul 05, 2007 11:08 am

Post » Wed Jun 20, 2012 1:51 pm

The generic brawl quest (DGIntimidateQuest) doesn't set anyone to be essential.

Actually, I found only 6 scripts which call SetEssential(true), gotta wonder how Gerdur became essential.
Spoiler
; Agent Ransack with regex "\.\s*SetEssential\((?!(false|0))" against "psc$".G:\Skyrim\Data\Scripts\Source\DA16MistFill.psc 4.00 KB 2012-02-07 15:32:3781  myActor01.getActorBase().SetEssential(true)87  myActor02.getActorBase().SetEssential(true)93  myActor03.getActorBase().SetEssential(true)99  myActor04.getActorBase().SetEssential(true)G:\Skyrim\Data\Scripts\Source\dunReachwaterRockJyrikBossBattle.psc 6.00 KB 2012-02-07 15:33:3956  Self.GetActorRef().GetActorBase().SetEssential(True)G:\Skyrim\Data\Scripts\Source\dunReachwaterRockMikrulBossBattle.psc 2.00 KB 2012-02-07 15:32:3865  Self.GetActorRef().GetActorBase().SetEssential(True)G:\Skyrim\Data\Scripts\Source\dunReachwaterRockSigdisBossBattle.psc 10.00 KB 2012-02-07 15:34:0587  Self.GetActorRef().GetActorBase().SetEssential(True)G:\Skyrim\Data\Scripts\Source\QF_DA10_00022F08.psc 15.00 KB 2012-02-07 15:33:27484 Alias_Logrolf.GetActorRef().GetActorBase().SetEssential(True)G:\Skyrim\Data\Scripts\Source\QF_MS02EscapeNeposEnding_0006A9A0.psc 2.00 KB 2012-02-07 15:33:0756 Alias_Thonar.GetActorRef().GetActorBase().SetEssential(True)

KillEssential is just a papyrus function that calls SetEssential(false) and then Kill -- so yes, Kill alone is not enough to finish of an essential actor, she could merely go into bleeding state. (BTW: that function isn't used anywhere by BGS)
User avatar
jessica Villacis
 
Posts: 3385
Joined: Tue Jan 23, 2007 2:03 pm

Post » Wed Jun 20, 2012 8:13 pm

Actually, the Essential tag is set at the Alias rather than in the Script. In DGIntimidate, the Aliases Opponent, Player, and OpponentFriend ARE actually tagged as Essential.

So, that's how they control brawling. And the script will just monitor when either loses and Stops () the quest.

Also, I managed to brawl against Gerdur with my sword. Probably a bug in regards to how I passed that quest with it.
User avatar
P PoLlo
 
Posts: 3408
Joined: Wed Oct 31, 2007 10:05 am


Return to V - Skyrim