Aller au contenu

Photo

On death script


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

#1
PJ156

PJ156
  • Members
  • 2 986 messages

I have a group on death script which has been stable until now.

 

The problem I have is that the mage now has access to a persistent fire spell which continues after combat and keep the player in combat mode. Therefore the group on death convo start type activity does not work.

 

Will the line

 

DelayCommand(3.0, ClearAllActions (1));

 

Work to solves this or do I need to find another way to kill that spell effect (incendiary cloud).

 

PJ



#2
PJ156

PJ156
  • Members
  • 2 986 messages
I'm going to try this I got from another thread :)
 
object oHon = GetObjectByTag("Hon");
 
object oArg = GetObjectByTag("Arg"); 
 
AssignCommand(oPC, ClearAllActions(TRUE)); 
 
AssignCommand(oHon, ClearAllActions(TRUE)); 
 
AssignCommand(oArg, ClearAllActions(TRUE));
 
ForceRest(oPC);
 
ForceRest(oHon); 
 
ForceRest(oArg);
 
oPc is called earlier and I will run this before starting the conversation.
 
If I delay ForceRest(oPC) that will delay the whole script? That would be useful as I can then copy/paste just these lines in.
 
PJ


#3
kevL

kevL
  • Members
  • 4 070 messages


I have a group on death script which has been stable until now.
 
The problem I have is that the mage now has access to a persistent fire spell which continues after combat and keep the player in combat mode. Therefore the group on death convo start type activity does not work.
 
Will the line
 
DelayCommand(3.0, ClearAllActions (1));
 
Work to solves this or do I need to find another way to kill that spell effect (incendiary cloud).
 
PJ

it might, but I wouldn't be surprised if someone stumbles into it again ...


object oAoE = GetFirstObjectInArea();
while (GetIsObjectValid(oAoE))
{
    if (GetObjectType(oAoE) == OBJECT_TYPE_AREA_OF_EFFECT
        && (GetAreaOfEffectSpellId(oAoE) == SPELL_INCENDIARY_CLOUD))
//            || !GetFactionEqual(GetAreaOfEffectCreator(oAoE), GetFirstPC())
    {
        DestroyObject(oAoE); // won't be removed until script completes
    }

    oAoE = GetNextObjectInArea();
}


/ponder,


I'm going to try this I got from another thread :)
 
[...]

i'd do both.
 

If I delay ForceRest(oPC) that will delay the whole script?

no, Delaying a command delays only the function called ...

likely, you'll still have to put some thought into getting the timings/ sequence right
  • PJ156 aime ceci

#4
Loki_999

Loki_999
  • Members
  • 430 messages

Kind of a hack... you could change the spell from being flagged as hostile (HostileSetting in spells.2da), that might work, although it might affect how AIs respond to it.

 

However, would need to really understand more about this persistent fire effect (its something on the PC itself? Is it persistently attacking enemies?) and under what conditions this group on-death script fires and what happens (or should happen) to suggest a decent hack.



#5
PJ156

PJ156
  • Members
  • 2 986 messages

Thanks for the responses gents.

 

I with try the cancel AoE as well but if it does not take effect until the script has run might it still not call the convo because an npc is incapacitated.

 

The issues I have seen are:

 

1. When a party is in combat, the mage fires off an incendiary cloud and this persists after everyone is dead. For some reason, while the spell is in effect the characters remain in combat mode and the convo does not fire.

2. This is the major issue that has cropped up twice - If the npc that starts the conversation has died then they do not come back to life (as per stock death script) until the spell has completed. Thus the script fires on death but the convo cannot fire and it does not work. 

 

This only seems to be for the IC spell, for vine mine/entangle/black tentacles etc this does not seem to be the case.

 

I will try KevL suggestions and check the spell 2da to see perhaps if this spell has different settings than the others (that will be an adventure:)

 

PJ



#6
kevL

kevL
  • Members
  • 4 070 messages

this sounds like a job for

CreateIPSpeaker()

- iirc, it resurrects, makes everyone able to have a conversation, etc etc. Tchos is currently the master IPSpeakerer, i believe ....


but i still think you're going to have to get rid of that burning cloud,

preferably from some sort of pre-event, as in before CreateIPSpeaker(). If you're using GroupOnDeathStartConversation (or whatever it is), think about replacing it with GroupOnDeathExecuteCustomScript; this way it might be possible, in that script, to disperse the Cloud -- it should dissipate at the end of the script, hopefully -- and Delay the CreateIPSpeaker() line, in the same script, by your 3 seconds above, by which time the Cloud ought be gone. And then the IPSpeaker will ClearAllActions also ... iirc.



i don't see a benefit here by changing the .2da, and as Loki suggests a fair bit of hazard..



#7
Tchos

Tchos
  • Members
  • 5 072 messages

Well, I don't have anything substantial to add, aside from support for what's been posted.

 

GroupOnDeathStartConversation() actually creates an ipoint speaker using CreateIPSpeaker() through the On Death script which it applies to the creatures (as long as you don't change the DeathScript variable on the creature manually), which is one reason I advocate its use.  However, as you observe, the incendiary cloud is breaking the conversation, so using a custom script that first clears the AoE and then uses CreateIPSpeaker() as kevL suggests should work.



#8
PJ156

PJ156
  • Members
  • 2 986 messages

Okay there's food for thought there.

 

I am actually using a placed I point for all of the conversations, as this reduces risk greatly. By putting a camera and a delay on the first line I am able to wait for the npc's to sort themselves out. I will look at the group on death script but right now i am using a custom on death script. Problem is the spell is pretty long lasting at level 14 - 16.

 

I will look at the stop aoe script and try to incorporate that. If that fails I will try spawning the ipoint.

 

So much to go wrong :)

 

PJ



#9
Tchos

Tchos
  • Members
  • 5 072 messages

If you have a custom On Death script applied to the creature, and that custom script doesn't execute the default death script at the end of it or include the bit that fires the script from the DeathScript variable, then GroupOnDeathStartConversation() can't work.



#10
PJ156

PJ156
  • Members
  • 2 986 messages

It does not at the moment. I will have to create a new script if I go down that road.



#11
Tchos

Tchos
  • Members
  • 5 072 messages

Just put

string sDeathScript = GetLocalString(OBJECT_SELF, "DeathScript");
if (sDeathScript != "")
	ExecuteScript(sDeathScript, OBJECT_SELF);

in your custom On Death script (which is in the default On Death script, and is the part that's required for the function to work), and don't manually put a "DeathScript" local string on your NPCs, and you can use GroupOnDeathStartConversation().



#12
Loki_999

Loki_999
  • Members
  • 430 messages

What options does the convo offer? Couldn't you do the same with a custom GUI? That wouldn't be affected by the combat status.