Jump to content

Trigger isn't working?


dianacat777

Recommended Posts

So I'm a new modder, still pretty wet around the ears. But I've managed to cobble together some rudimentary quests, dialogue trees, triggers, et cetera, so I'm mildly competent at this point.

 

However, I've got a few things that I can't get to work. Most important at the moment is that my WIP companion works off a series of loyalty/hatred points. Loyalty eventually opens up a quest and perks, and pissing him off enough eventually gets him to leave and attack you (and certain actions are an automatic leave).

 

Except it doesn't.

 

Here's what I have.

 

Begin GameMode

if (AlexRef.IsAngryWithPlayer >= 5)

Set AlexRef.IsFuriousWithPlayer to 1

Endif

End

 

Begin GameMode

if (AlexRef.IsFuriousWithPlayer == 1)

SetEssential FollowerAlex 0

AlexREF.StartConversation Player FollowerAlexAlexHasHadEnough

AlexRef.RemoveFromFaction PlayerFaction

SetFactionReaction AlexMercerFaction PlayerFaction -100

Endif

End

 

The conversation triggered finishes the rest of those pieces, with;

 

ShowMessage AlexMessageFurious

Set AlexREF.Waiting to 0

Set AlexREF.HasBeenHired to 0

Set AlexREF.Hireable to 0

Set AlexREF.L38 to 0

Set AlexREF.IsFollowingDefault to 0

Set AlexREF.IsFollowingLong to 0

AlexREF.SetPlayerTeammate 0

AlexREF.RemovePerk AlexLoyaltyPerk

AlexREF.evp

 

But it doesn't seem like the first trigger is getting hit at all, because no conversation is initiated, even when I do things that would put him into the Furious state. Could a more experienced modder point out any issues in my scripts here?

 

Thanks. :3

Link to comment
Share on other sites

In both your GameMode blocks, whilst they are active they will be continuously running the same bit of code

 

Begin GameMode

if (AlexRef.IsAngryWithPlayer >= 5)

Set AlexRef.IsFuriousWithPlayer to 1

Endif

End

 

This one will continuously set AlexRef.IsFuriousWithPlayer to 1

 

to stop that happening repeatedly put in a condition to only do it when alex isnt furious

 

eg:

if (AlexRef.IsAngryWithPlayer >= 5) && ( AlexRef.IsFuriousWithPlayer == 0 )

 

 

Your next GameMode will constantly try to start the convo (and is probably why its never starting)

 

you can cure it by incrementing AlexRef.IsFuriousWithPlayer at the end so that it invalidates the if statement and stops it running repeatedly

 

thus:

 

Begin GameMode

if (AlexRef.IsFuriousWithPlayer == 1)

SetEssential FollowerAlex 0

AlexREF.StartConversation Player FollowerAlexAlexHasHadEnough

AlexRef.RemoveFromFaction PlayerFaction

SetFactionReaction AlexMercerFaction PlayerFaction -100

set AlexRef.IsFuriousWithPlayer to 2 ;this will stop the startconversation being repeatedly called

Endif

End

 

 

Of course it may not be this and may be an artifact of where these gamemode blocks are.

 

I'll stop rambling now

Link to comment
Share on other sites

I hate to double post, but... curiously enough, I can't get Alex to actually attack the player, even though the rest of the furious script works. He'll attack if attacked, but he won't initiate combat. Can anyone see any problems, or identify what might be a problem?

 

I might add, there's a StartCombat trigger at the end of the Furious dialogue - starts on end.

Link to comment
Share on other sites

I did, and he is aggressive.

 

Result script is this;

 

Begin block;

 

ShowMessage AlexMessageFurious

Set AlexREF.Waiting to 0

Set AlexREF.HasBeenHired to 0

Set AlexREF.Hireable to 0

Set AlexREF.L38 to 0

Set AlexREF.IsFollowingDefault to 0

Set AlexREF.IsFollowingLong to 0

AlexREF.SetPlayerTeammate 0

SetFactionReaction AlexMercerFaction PlayerFaction -100

SetFactionReaction PlayerFaction AlexMercerFaction -100

AlexREF.RemovePerk AlexLoyaltyPerk

AlexREF.evp

 

End Block;

 

AlexRef.StartCombat Player

 

 

He becomes unhireable and ceases to act as a teammate, but he doesn't attack.

Link to comment
Share on other sites

As the end resultscript, try just using

 

resetai

startcombat player

 

The resetai command is useful to make the npc throw away whatever it is they are doing. You also don't need to specify AlerRef, since the appropriate npc is implicity defined as the subject of the conversation (i.e. the one you are talking to)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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