Jump to content


Photo

SetTrap for thieves?


  • Please log in to reply
17 replies to this topic

#1 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 07 January 2018 - 10:58 PM

Hello!

 

I was wondering: do RR thieves set up traps as part of generic attack routines?

 

Thanks!


Edited by Salk, 07 January 2018 - 10:58 PM.


#2 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 08 January 2018 - 12:33 AM

"Hey you over there, could you say just wait for say 5 minutes over there, while I put this metal -nothing over here and while you are not looking. Now, I just put my 300 gold on this and get a -x- trap. Hmm, what's this, why does this one part say not usable in combat ?"

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#3 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 08 January 2018 - 05:10 AM

Very funny.

 

A player can set up traps during combat and I think it would be cool enough if the AI could do the same in particular situations.

 

An example? Thieves that are hiding in shadow/invisible may attempt to set up traps. It takes one round, after all.


Edited by Salk, 08 January 2018 - 05:11 AM.


#4 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 08 January 2018 - 05:30 AM

You are just forgetting that you are going into a house with a thief in it... a little more backgorund, the in game mechanics allows the player char to detect traps, but while that it true, it only detects no-magic made traps, aka preset ones that the game area has attached to it, while the player set traps are a way for the player to simulate the same thing, it's not as they would come from spells, but HAVE to............. and thus the explanation of in game feature should become clear, aka the set traps are meant for player only ... just like the kits etc are player only Mindflayer/Beholder/Dragon -compensator abilities. They are not meant in the enemy thieves, but for the players to simulate the in game effect.

Thieves that are hiding in shadow/invisible may attempt to set up traps. It takes one round, after all.

And breaks stealth ... while the backstab does the same, but harms the most vulnerable, not the tank that can take any hit like a champ.


Edited by The Imp, 08 January 2018 - 05:32 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#5 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 08 January 2018 - 06:59 PM

I don't know about RR, but I use stuff like this in trapper scripts:

IF
  HaveSpell(4414)
  !GlobalTimerNotExpired("t-cn","LOCALS")
  Range(LastSeenBy(),20)
THEN
  RESPONSE #50
    SetGlobalTimer("t-cn","LOCALS",6)
    Spell(Myself,4414)
    RunAwayFrom(LastSeenBy(),15)
  RESPONSE #50
    Continue()
END

IF
  HaveSpell(4412)
  !GlobalTimerNotExpired("t-cn","LOCALS")
  Range(LastSeenBy(),20)
THEN
  RESPONSE #50
    SetGlobalTimer("t-cn","LOCALS",6)
    Spell(Myself,4412)
    RunAwayFrom(LastSeenBy(),15)
  RESPONSE #50
    Continue()
END

4412 is SET_SNARE_TRAP and 4414 is SET_SPECIAL_SNARE_TRAP. I used numbers because these aren't defined in every spell.ids (and I may or may not have bothered to add them if they're absent).

I think it works, more or less. There's not a 100% chance of the block firing every time so the thieving little gits aren't setting traps all the time (sometimes they'll try to backstab or throw knives instead).
 


Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#6 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 09 January 2018 - 11:00 PM

Hello Miloch! :)

 

Yes, I have thought of something like that myself for spicing up the encounter with Lothander and Marek (using only 4412 which in my IDS is correctly set).

 

That's why I was wondering whether RR had something similar too.

 

It adds nice flavor.

 

One thing though. When I experimented with it I have met two obstacles:

 

1) When the thief sets the trap, it is announced to the player on the message window and with a graphic clue - would it be possible to suppress that?

 

2) I'd rather have the thief not set another trap if there is one already in the same area. Do you think it'd be possible to do that? And by the way, it seems like the setting of traps always fail when in line of sight of an enemy?


Edited by Salk, 10 January 2018 - 03:35 AM.


#7 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 11 January 2018 - 06:36 AM

412 and 414 are just wrappers for the spls with actual effects. You can ~RemoveSpell(4412) SpellNoDec(4411)~ instead, this solve both the message and visibility issues.

As for not setting another trap... I'd just set a random reasonably lengthy timer between, tbh. Less problem, close result.


Retired from modding.


#8 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 11 January 2018 - 07:21 AM

Sounds like great advice, as usual!

 

Thanks, Ardanis! ;)

 

Can you also confirm me that an attempt of setting traps while in sight is an automatic failure?


Edited by Salk, 11 January 2018 - 07:25 AM.


#9 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 11 January 2018 - 07:34 AM

I can't *confirm*, but your observations and knowing that setting a trap fails if there're hostiles in visual range (blind thieves ftw, yes) lead me to believe the rule may apply to any actor, not just party members.


Retired from modding.


#10 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 12 January 2018 - 09:22 PM

Ardanis (or Miloch?),

 

if you are still reading here may I ask you one more thing, unrelated to the OT?

 

Is there a way to stop a .cre to leave the area he is in when using the RunAwayFrom() action without modifying the .are file itself? Choreographing the battle is a pain with the enemy moving away from the party the way he is supposed to do but then disappearing in the sewers of Baldur's Gate or entering some (closed, ftw) door...



#11 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 12 January 2018 - 10:35 PM

355 RunAwayFromNoLeaveArea(O:Creature*,I:Time*)
This action causes the active creature to run away from the specified creature, for the specified time, without leaving the current area.

Retired from modding.


#12 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 13 January 2018 - 01:03 AM

355 RunAwayFromNoLeaveArea(O:Creature*,I:Time*)
This EE-only action causes the active creature to run away from the specified creature, for the specified time, without leaving the current area.

Fixed that for you. Not that I oppose it, it's just a need to know...


Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#13 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 13 January 2018 - 01:36 AM

I am modding the old engine so that solution, as great as it is, doesn't work for me.



#14 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 13 January 2018 - 02:31 PM

No solution then, at least without editing areas. DavidW had to patch the Gov District to prevent Viconia's would-be-executors from conveniently placing themselves into prison.

 

That said, is there any reason to use RunAwayFrom() in battle scripts? Imo the only thing worse than enemy archers trying to run away from you through a solid wall instead of switching to melee is the enemy AI prioritizing targets based on their immunities.


Edited by GeN1e, 13 January 2018 - 02:32 PM.

Retired from modding.


#15 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 13 January 2018 - 03:03 PM

That said, is there any reason to use RunAwayFrom() in battle scripts?

Them being small goblins and seeing 99 other goblins getting themselves killed against a horror of quenched in their blood. Aka thuem being scared.


Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#16 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 13 January 2018 - 10:05 PM

That said, is there any reason to use RunAwayFrom() in battle scripts? Imo the only thing worse than enemy archers trying to run away from you through a solid wall instead of switching to melee is the enemy AI prioritizing targets based on their immunities.

 

In this particular battle, it's one against all. Lothander wears Boots of Speed (it seems) in the original game so I wanted to take advantage of the fact that he (thinks he) can outrun his enemies. Putting enough distance between them would allow him to use his crossbow and try and hide in shadows when he can.

 

I didn't work any targeting prioritization, I am not writing a new AI mod. I rebuilt/fixed the whole Varci/Tenya/Lothander quest and took the opportunity to do something about it.

 

But if you have any suggestion to make the battle more interesting (at this point, to make him return to open space I "cheat" by moving him between areas when the party follows him inside a house after he stupidly entered one or the sewers - I hate that but it was to remedy the stupidity of the RunAwayFrom() action that would push him into a death trap - it is not a surprise that Beamdog wanted to create RunAwayFromNoLeaveArea()).


Edited by Salk, 13 January 2018 - 10:07 PM.


#17 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 14 January 2018 - 04:02 AM

You're better off editing the area then, especially since it's one encounter and not a general script.

You could also make him run away from area exits and into parts of area clear of PCs, but you can't really mark those without placing more triggers (though maybe invisible actors will do, I forgot if it's possible to have non-flying zero-space critters in vanilla). Plus it would probably involve doing extra AI work - from my experience, customized movement routine can take a while to develop, test and finalize.

 

PS

RandomWalkContinuous() is also an option.


Edited by GeN1e, 14 January 2018 - 04:06 AM.

Retired from modding.


#18 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 14 January 2018 - 06:32 AM

Thanks for the suggestion.


I have actually been considering RandomWalkContinuous() as possibility but the problem with it was that it as often ends up behaving against intention (moving towards the enemy rather than away from them).