hi i have a question regarding a function i'd like to implement into my mod. The function is that when a plot flag has been set the player should be able to kill an enemy with a single attack or do massive amounts of damage by flanking.
messing with the combat system
Débuté par
gordonbrown82
, mars 14 2010 08:59
#1
Posté 14 mars 2010 - 08:59
#2
Posté 15 mars 2010 - 02:02
I'm not at home at the moment, but with regards to killing enemies in one strike, I would checkout the spawn scripts in creature_core.nss. In one part of it, there is a conditional check for a particular variable that makes enemies die in one hit. It's what they use at the end of the game when you're able to kill all those darkspawn in one hit while storming Fort Drakon.
I'm not sure if simply setting this variable does the trick, or if some functionality has to be run when the enemy spawns, but yeah... There it is...
When I get home from work, I'll be able to have more concrete information.
I'm not sure if simply setting this variable does the trick, or if some functionality has to be run when the enemy spawns, but yeah... There it is...
When I get home from work, I'll be able to have more concrete information.
#3
Posté 15 mars 2010 - 05:53
i don't think that would work because i'd need to get some sort of information regarding where the player is relative to the enemy at the exact moment that the player strikes the enemy. that script would not get any position information so you could just kill the enemy with one hit without flanking him . as far as i can tell the impact event has the correct information but that event is sent to the creature that is hitting, not the creature that is being hit. i could make a script that makes the enemy kill the player by flanking him but i can't with my current knowledge make a script that makes the player kill the enemy with one hit this way unless it's possible to override player.core somehow.
#4
Posté 15 mars 2010 - 07:36
I believe the creatures spawned at the end are set to a creature rank of one-hit kill (from creatureranks.xls).
If your scenario spawns in enemies, you could create 2 sets of creatures - one with a rank of one-hit kill and the other with the regular rank and depending on the plot flag status, spawn the appropriate group in. As you say, this will not take into account flanking.
If the enemy is already present, you will have to intercept the on-hit event (I think this is the one, not sure) and can apply damage equal to the remaining health of the creature (add a buffer for combat regen/healing, etc). This would mean overriding creature-core [you can create your own creature core script and attach it to the creatures in the area where you want this to happen].
You can add in handlers for flanking here.
If your scenario spawns in enemies, you could create 2 sets of creatures - one with a rank of one-hit kill and the other with the regular rank and depending on the plot flag status, spawn the appropriate group in. As you say, this will not take into account flanking.
If the enemy is already present, you will have to intercept the on-hit event (I think this is the one, not sure) and can apply damage equal to the remaining health of the creature (add a buffer for combat regen/healing, etc). This would mean overriding creature-core [you can create your own creature core script and attach it to the creatures in the area where you want this to happen].
You can add in handlers for flanking here.
#5
Posté 15 mars 2010 - 07:39
but the thing is that the impact event is not sent to creature core when the player hits the creature, it is sent to rules_core and i don't know how to change rules_core.
#6
Posté 15 mars 2010 - 07:40
#7
Posté 15 mars 2010 - 09:53
Hmm...you are right. I expected that to be handled in creature_core...sorry!
If you want to override rules_core, you can check it out and change it but I would not recommend it - even ppl within Bioware have to ask Georg or Yaron - that's how critical this script is.
Instead, I suggest overriding EVENT_TYPE_DAMAGED present in creature_core. That way, the engine would have already determined if the attack was a hit and you can add additional damage on top of that. Note: I am not sure if this will even work!!!
Maybe someone who is more experienced in this can offer some suggestions.
Btw, is your script only for a specific monster? Or a specific area? If you can give more details on how the scenario will play out, there can be alternate suggestions.
If you want to override rules_core, you can check it out and change it but I would not recommend it - even ppl within Bioware have to ask Georg or Yaron - that's how critical this script is.
Instead, I suggest overriding EVENT_TYPE_DAMAGED present in creature_core. That way, the engine would have already determined if the attack was a hit and you can add additional damage on top of that. Note: I am not sure if this will even work!!!
Maybe someone who is more experienced in this can offer some suggestions.
Btw, is your script only for a specific monster? Or a specific area? If you can give more details on how the scenario will play out, there can be alternate suggestions.
#8
Posté 15 mars 2010 - 10:19
craig gaff linked to this and i'll give it a go it works in theory:
social.bioware.com/project/1907/.
social.bioware.com/project/1907/.





Retour en haut







