Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Oct 2017
Location: NH, USA
R
apprentice
OP Offline
apprentice
R
Joined: Oct 2017
Location: NH, USA
Hi everyone, I was trying (failing) to do a simple little trap test: a generic PUZZLE Spiked Floor trap that would apply poison status (indefinitely) on hit as well as the damage. However, I'm new to the scripting, and I cannot get the thing to poison the test dummy. It uses the trigger event AttackedByObject. My code is:

IF
AttackedByObject(_Defender, _AttackerOwner, <my Full GUIDSTRING>, _Damage, _Source)
THEN
ApplyStatus(_Defender, "POISONED",-1.0,2)

However, it does not seem to work. My dummy character is hit and suffers bleeding from the trap, but not poisoned.

Maybe the community can shed some light on my misfortune. I think it may have to do with the ordering of the scripts.


Projects: Tomb of Horrors: Tomb of Horrors
Joined: Oct 2017
Location: NH, USA
R
apprentice
OP Offline
apprentice
R
Joined: Oct 2017
Location: NH, USA
After some testing, it seems to be in the AttackedByObject call. My code executes when the event is changed to CharacterReceivedDamage(_Defender) but not when I use the catch-all AttackedByObject(_Defender, _AttackerOwner, _Attacker,_DamageType, _Source)

Any ideas?


Projects: Tomb of Horrors: Tomb of Horrors
Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
AttackedByObject is only thrown in response to active attacks where the attacker can be identified: plain attacks, casting a spell, etc. How are you applying the damage?

CharacterReceivedDamage is indeed triggered whenever anyone receives damage for whatever reason.

Joined: Oct 2017
Location: NH, USA
R
apprentice
OP Offline
apprentice
R
Joined: Oct 2017
Location: NH, USA
Well, I was using the default Puzzle Spiked Floor Trap. It uses the scripts inherited through the base game. It has the default stats, and (to me) appears to attack the player walking above it, but it might be a different action/script. It does apply bleeding status.

I think a work around would be to make a new set of stats inheriting the spike trap template, but also apply poison status indefinitely.


Projects: Tomb of Horrors: Tomb of Horrors
Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
That script calls ExplodeAt() to cause an explosion-style skill to go off at its own position whenever it is triggered. This API does not specify a damage source, so it does not get associated with any item/character as an attacker.

You could indeed trigger a different skill that would set an indefinite poison status instead.

Last edited by Tinkerer; 28/10/17 08:18 AM.
Joined: Oct 2017
Location: NH, USA
R
apprentice
OP Offline
apprentice
R
Joined: Oct 2017
Location: NH, USA
Thanks! It all makes sense now.


Projects: Tomb of Horrors: Tomb of Horrors

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5