hi all,
pretty much what the title says. i can get this to work for npc’s but not for pc’s. i’ve tried prefacing it with ClearAllActions()
, still no joy.
has this actually worked for anyone?
[1.69 diamond]
thanks
hi all,
pretty much what the title says. i can get this to work for npc’s but not for pc’s. i’ve tried prefacing it with ClearAllActions()
, still no joy.
has this actually worked for anyone?
[1.69 diamond]
thanks
I think you have to call SetCommandable() first to change a player’s action stack.
I’m not sure that does work on PCs, anyway. The similar ActionUseFeat() doesn’t. This is more for NPCs. The PC should choose to do this if he or she wants.
You can simulate it by moving the PC closer to the trap, doing like LOOPING_GET_LOW or whatever animation and then disabling the trap as appropriate. But you need be careful about moving the PC into the trap
You’d want to add all that to the PC’s queue, including a command to set the PC back to commandable, then set the PC uncommandable (not in the queue) to be sure all the actions got done.
Works for me. Don’t know if all feats work but e.g. ActionUseFeat(TURN_UNDEAD) or ActionUseFeat(KNOCK_DOWN) works for the PC. At least in EE.
[edit]ActionUseSkill(SKILL_DISABLE_TRAP) works too - both traps on placeables/doors and on floor (in EE).[/edit]
Maybe that’s something that was fixed in EE. If so, cool! Pretty sure they didn’t work in 1.69. I have not tried recently…
I find it does work in 1.69, for example
AssignCommand(GetFirstPC(), ActionUseSkill(SKILL_DISABLE_TRAP, GetObjectByTag("Test271P")));
as long as the object is trapped and the PC has that skill, of course.
To prevent the PC from interrupting, see Note 3 here.
ahhh… false alarm.
i mis-called GetNearestTrapToObject()
beforehand.
in fact, ActionUseSkill(SKILL_DISABLE_TRAP)
works fine on pc’s, and there’s no need to set the action queue modifiable beforehand [SetCommandable()
] unless other circumstances dictate that it isn’t already.
thanks for the help all, and sorry for the mix-up!