Aller au contenu

Photo

Clearing threat, why not use engine function?


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
SuperD-710

SuperD-710
  • Members
  • 130 messages
In various talent/spell implementations, I've seen the implementation for clearing threat is to find the current threat value, *-1 to it, and use the AI_Threat_UpdateCreatureThreat to basically nuliffy current threat. In the case of clearing entire threat table, the script would loop through all targets in table and clear them the same way.

Question is, why not use engine functions ClearEnemyThreat() and ClearThreatTable() for those things? Only time I've seen it used is when creature perception disappeared, or when creature died. Is there a side effect of using these two funcitons on talent/spell implementations that clears threat in any way? Thanks.

#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
I haven't worked with it much, but it seems possible that removing a creature (or all creatures) from the threat table is a very different thing than bringing the threat down to 0. I suspect it's largely a matter of keeping the AI in a consistent state, however, since the combat system lives almost entirely in scripts,



In other words, ask Georg.

#3
SuperD-710

SuperD-710
  • Members
  • 130 messages
Hmm.. I've found an exception in the feign death effect. It makes the character stealth, which effectively means enemy's perception disappear against the character, which uses ClearEnemyThreat() to clear threat in this case.

Not sure what that means, just an interesting observations :)

Modifié par SuperD-710, 31 janvier 2010 - 10:10 .


#4
Craig Graff

Craig Graff
  • Members
  • 608 messages
At a guess, combatants target their enemies from highest threat to lowest threat - including those that are at 0 threat. But ClearEnemyThreat actually removes the creature from the threat table all together so they will never be targeted.

#5
Adaram

Adaram
  • Members
  • 464 messages
So can ClearEnemyThreat() actually turn a hostile situation into a non-hostile situation? If you only had one enemy, and one NPC, and ClearEnemyThreat() fired, what would happen?


#6
Craig Graff

Craig Graff
  • Members
  • 608 messages
Sounds like an easy test to run. B)

#7
Adaram

Adaram
  • Members
  • 464 messages
Yeah it does! /cheeky ;)



I'm still busy learning how to make plots; I haven't had to actually write any scripts yet. Maybe this will be a nice easy one to start :)


#8
SuperD-710

SuperD-710
  • Members
  • 130 messages
That does make sense. When you deactivate feign death you trigger perception of the enemies, so you will be added back to their threat table. In the case of other talents, you're still perceived by the enemy, so if you stop doing anything they will act like you don't exist.

#9
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
It could be the case that the threat assessment process has components that are maintained over time to provide a more realistic computation based on more than one action or combat round. I imagine if that is true, then you wouldn't want to clear the table because it would lose (reset) all that great info built up over the past few rounds or more. Yet you still might want to allow the possibility that the threat levels can be handled in some special way under some special circumstances and need to be ignored or elevated artificially, maybe even only temporarily before returning to "normal" threat.

Just an idea for one reason why it may be done that way...I have no knowledge one way or the other about whether threats are actually figured that way in the OC tho. Even if it doesn't however, that kind of implementation would allow for a custom system that did work that way to be more easily layered on top, and that might have been a concern of the core author when he decided to do it that way.

Modifié par Axe_Murderer, 01 février 2010 - 07:25 .