RedChimera / IWD2EE

This is the most recent semiOverhaul mod, containing most of the rebalancing components and a few other tweaks.
155 stars 7 forks source link

Torak Encounter #15

Closed semiticgod closed 6 years ago

semiticgod commented 6 years ago

There is now an option to intimidate Torak's allies. His dialogue needs a command to either make his allies neutral or make them flee the area if the Intimidate attempt is successful.

semiticgod commented 6 years ago

Torak is 20TORAK.cre, in the area AR2100. His dialog is 20TORAK.d, and the intimidate option is at "Whoever wants wants him gone," or "BEGIN TorakIntimidate." His allies are all 20ORCAV.cre and 20ORCWV.cre. As with many such encounters, there are multiple copies of those allies in the .are file.

I think the other orcs turn hostile because of their Team Script, so maybe adding a variable to Team Scripts to deactivate them, variables which dialogs could set, could fix these neutrality issues with Torak and Guthma and the Elder Brain and such. Or, maybe the area script could be tweaked to give them a custom override script or something.

Grammarsalad commented 6 years ago

K. Going to assign these to myself one at a time...

Grammarsalad commented 6 years ago

Are you sure this is area AR2100? The only named creatures I'm seeing are Gaernat Sharptooth, Emma, and Kristian. I see two Torak cre files in AR2001. I see four in AR2000. I've modified the D file to set a global ""RUNTORG" to 1. I believe that all I need to do now is find the right script--preferably an override script, but all I need is the highest order script that his followers use--and put this at the top and it should work:

IF
    Global("RUNTORG","GLOBAL",1)
  THEN
    RESPONSE #100
      EscapeArea()
  END
semiticgod commented 6 years ago

@Grammarsalad: It's AR2001, not AR2100. My mistake. I saw Emma and assumed that it must be the same as Torak's area because Emma Moonblade doesn't show up anywhere else--or so I thought.

That script looks like a brilliant and very simple solution to the problem.

FireStormCrow commented 6 years ago

About Torak fight. Vanilla Emma has exploit, that can do whole map very easy. If one character stays with her, player can сast one coin costed Heals for other party members without delays at any moment regardless of distance. This makes all fights on map very easy. I think this must be fixed somehow.

semiticgod commented 6 years ago

I'd rather nerf it than remove it, because that is very, very clever. A move that smart should be rewarded.

Grammarsalad commented 6 years ago

Excellent. Thanks SG. I'm not familiar with the encounter-- it has been forever since I played the game-- so I'll do this one and move to the next

Ie I'll leave it to SG to sort the Emma exploit

Grammarsalad commented 6 years ago

Okay, I uploaded something that I think might work...

Grammarsalad commented 6 years ago

I'm going to assume for now that this is fixed, and revisit it if it comes up again. Closing for now

semiticgod commented 6 years ago

@Grammarsalad: What have you uploaded? I don't see any changes besides the new variable.

I've tried implementing it myself but it's not working. I created a new script with your code...

IF Global("RUNTORG","GLOBAL",1) THEN RESPONSE #100 EscapeArea() END

...then assigned it to the Override Script of Torak's fellow orcs. Funny thing is, when I choose the intimidate option, Torak flees the area instead of his followers. The other orcs remain neutral but do not run away. Yet Torak does not have that EscapeArea() script assigned to him--only the other orcs have it.

I think the Team Script is responsible somehow, but I don't know how to edit it without creating unintentional side effects, like making Torak run away along with his followers or preventing the other orcs from coming to his aid if the player does NOT choose the intimidate option.

If necessary, I could re-write the dialogue such that Torak and all of his allies flee together, which might make the Team Script easier to deal with, but I still don't know how to get the right creatures to flee.

Grammarsalad commented 6 years ago

...then assigned it to the Override Script of Torak's fellow orcs. Funny thing is, when I choose the intimidate option, Torak flees the area instead of his followers. The other orcs remain neutral but do not run away. Yet Torak does not have that EscapeArea() script assigned to him--only the other orcs have it.

That's weird. My guess is that their behavior is determined by some script that is being executed first, and they never check for RUNTORG...or, they are not using that script at all.

Also, yeah, I didn't realize that Tordek uses that script (I don't know how, but he must). I don't think rewriting the dialog is going to make any difference. We need to find the right script--one that Tordek does not use and his followers do-- to add the above code.

I'm at work now so I can't check...

semiticgod commented 6 years ago

@Grammarsalad: Okay, I just did some tests and found something extremely weird.

So, I look up Torak's creature file. He actually does have that script--which is a custom script; not a vanilla script to which I added your EscapeArea() code--as his override script... even though I never gave it to him.

I then edit his .cre file to remove that script. His Override Script is now blank; he has no such script. I go into the game and this time, nobody flees the area, including Torak--as if the script wasn't there at all.

I go back to Near Infinity and check the .are file. According to the .are file, none of Torak's allies have the script.

I check their .cre files. They don't have the script either, despite the fact that I gave it to them via Near Infinity, and never took it away.

So what happened? When I removed the script from Torak, Near Infinity also removed it from his allies. Likewise, when I first gave the script to his allies, Near Infinity gave it to Torak as well. Near Infinity somehow made unlicensed edits to .cre files.

Now, no one has the script. I give it back to the Orc Archers and check the Orc Warriors. They also have the script, even though I never gave it to them--I only gave it to the archers. This time, Torak does not have the script. So it spread from one file to another, but not to Torak's file.

I then go to the .are file, instead of the individual .cre files. None of Torak's allies have the script, even though I gave it to them via their .cre files. So scripts stored in .cre files don't necessarily translate to their presence in .are files. I assign the script to all of Torak's allies.

I go back into the game. Only a single orc, 20ORCAV4.cre, runs away. This is an orc that I did not give the script via their .cre file.

I then assign it to Torak as well, but make him Chaotic Evil instead of Lawful Evil and add a line to the code that prevents it from firing if the creature is not Lawful Evil. Still, only that one single orc, 20ORCAV4.cre, runs away.

Maybe the script only fires because that orc doesn't have it on their .cre file, but does have it in the .are file. So I remove the script from a different .cre file. Even so, only the single orc runs away.

I even tweaked the script to try to delete all other scripts that might be competing with it somehow:

IF Global("RUNTORG","GLOBAL",1) Alignment(Myself,LAWFUL_EVIL) THEN RESPONSE #100 ChangeAIScript("",SPECIAL_1) ChangeAIScript("",TEAM) ChangeAIScript("",3) ChangeAIScript("",SPECIAL_2) ChangeAIScript("",COMBAT) ChangeAIScript("",SPECIAL_3) ChangeEnemyAlly(Myself,NEUTRAL) EscapeArea() END

So what's going on? It looks like Near Infinity is capable of making unlicensed edits to creature files. As for why that one orc is doing what it's supposed to and no one else is following their own script, regardless of whether it's applied via .cre or .are file... I have no idea.

Torak and the other orcs, except for 20ORCAV4.cre are completely immune to the script when I give it to them. 20ORCAV4, however, the orc to the far left of Torak outside the palisade, responds to it.

semiticgod commented 6 years ago

Even when I delete all the files I edited from the override folder and start from scratch, assigning the script to every orc in Torak's army by .cre file, just that one orc, 20ORCAV4.cre, follows the script it's given.

semiticgod commented 6 years ago

I found the problem!

By setting the orcs' race from Goblin to Orc, the scripts worked perfectly. I have no idea why, but apparently the improved Racial Enemies component for rangers screwed things up somehow.

Grammarsalad commented 6 years ago

"By setting the orcs' race from Goblin to Orc, the scripts worked perfectly. I have no idea why, but apparently the improved Racial Enemies component for rangers screwed things up somehow."

Interesting...and super weird

Grammarsalad commented 6 years ago

That makes me think that that particular component may have other unforeseen affects in game (assuming a lot of monster races (etc.) are being shifted around)...

semiticgod commented 6 years ago

@Grammarsalad: Good news! They don't need to be orcs! They just need to be the same race. As long as ALL of them are goblins, the script works fine. Maybe it's the team scripts or maybe it's something hardcoded, but races need to be consistent in order to work.

The root problem apparently was that some of them didn't get caught by the race changing script, or that one of the changes got overwritten. Maybe I deleted a file from the override folder and it reverted back to orc when all the others were goblins.

Grammarsalad commented 6 years ago

Cool cool. I would double check the favored enemy component, but good to know this is working