Aller au contenu

Photo

event type team destroyed


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

#1
Lady Honor

Lady Honor
  • Members
  • 131 messages
is there a way to fire the team destroyed event in an existing area without having to modify the original area script?

#2
MerAnne

MerAnne
  • Members
  • 1 170 messages

I don't know; I don't think so.

 

but I found a work around that lets me identify when the fight is over.  It isn't something that I would use all the time (requires flag checking), but it can work.

 

And like your other question, I will probably have to respond with details over the weekend.  Perhaps someone else will have a solution before then.



#3
Lady Honor

Lady Honor
  • Members
  • 131 messages
I think I found something that works. it won't exactly say the team is destroyed but I used a pcrscr script to only create them if I entered the area with one of the custom followers in the party. there is no way you can miss them and they aren't spread out so one could be left out. all I needed is a flag so that when I went back to camp with them after the fight it would trigger a very angry conversation.

#4
MerAnne

MerAnne
  • Members
  • 1 170 messages

Can you save these questions for Friday night?  Makes it a LITTLE more likely that I'll have time to write up the solution.

 

I had the death of a final member of a party trigger a conversation.  You could just as easily set a flag rather than initiating the conversation. My method was...

 

I duplicated creature_core.nss into a file name specific to my mod; we'll say 'my_creature_core' for the purposes of example.  I used my_creature_core to replace the creature_core script in the AI script in the .utc files for the attackers that I created.  A simple plot file kept track of how many of the attackers had been killed.  So types of files created:

  • my_creature_core.nss
  • my_attacker_status.plo
  • my_attacker1.utc
  • my_attacker2.utc
  • my_attacker3.utc (as many attackers as desired)

In the my_creature_core.nss file, I added the following script in EVENT_TYPE_DEATH

string sTag = GetTag(OBJECT_SELF);

if (sTag == "my_attacker1")
   WR_SetPlotFlag(PLT_ATTACKER_STATUS, MY_ATTACKER1_DEAD, TRUE);
else if (sTag == "my_attacker2")
   WR_SetPlotFlag(PLT_ATTACKER_STATUS, MY_ATTACKER2_DEAD, TRUE);
else if (sTag == "my_attacker3")
   WR_SetPlotFlag(PLT_ATTACKER_STATUS, MY_ATTACKER3_DEAD, TRUE);

This kept track of which NPCs/attackers had been defeated/killed

if ((WR_GetPlotFlag(PLT_ATTACKER_STATUS, MY_ATTACKER1_DEAD)) &&
    (WR_GetPlotFlag(PLT_ATTACKER_STATUS, MY_ATTACKER2_DEAD)) &&
    (WR_GetPlotFlag(PLT_ATTACKER_STATUS, MY_ATTACKER3_DEAD)))
{
    WR_SetPlotFlag(PLT_ATTACKER_STATUS, MY_ATTACKERS_DEAD_ALL, TRUE);
    .
    . // Code to position the NPC who initiates the conversation
    .
    UT_Talk(oNPC, oPC);

}

The point was starting the conversation so I didn't include the multiple lines of code whose only purpose was saying "start conversation here".   This section identifies that all of the attackers have been defeated/killed, sets a flag, moves the NPC to the position where the conversation should start, and then starts the conversation (UT_Talk)

 

Was there a different way to do it?  Probably.  But this is the solution that I found that didn't require me to change any Core/Single Player resources.  It is one of those things that I suggest using in moderation.  If multiple modders, did the same thing in the same general area, there would be issues when the conversation(s) triggered.



#5
MerAnne

MerAnne
  • Members
  • 1 170 messages

Those colors are ANNOYING, but they were the colors that the 'code' option provided - ick.  I suggest highlighting/selecting the sections of code so that the annoying colors go away.



#6
Lady Honor

Lady Honor
  • Members
  • 131 messages
lol take a deep breath and quit obsessing meranne. I know you'll get it to when you and trust me. there is still soooooooo much that has to be done in this, I can work on something else while I'm waiting. right now I'm working on dialog which you know how much I HATE it. it's making me wanna bang my head on my desk, but unfortunately it has to be done. sigh. I know you'll help when you can.

as for the creature core, great idea! I don't actually want the conversation to take place at fight. the fight happens at lake calenhad and I want the conversation to take place when they return to camp. your way helps keep up with all my creatures tho and is way better than just a flag for entering the area.

#7
DarthParametric

DarthParametric
  • Members
  • 1 409 messages

Those colors are ANNOYING, but they were the colors that the 'code' option provided - ick.  I suggest highlighting/selecting the sections of code so that the annoying colors go away.


It's simple enough to fix. You too can go from this:
if (sTag == "my_attacker1")
   WR_SetPlotFlag(PLT_ATTACKER_STATUS, MY_ATTACKER1_DEAD, TRUE);
else if (sTag == "my_attacker2")
To this:
if (sTag == "my_attacker1")
   WR_SetPlotFlag(PLT_ATTACKER_STATUS, MY_ATTACKER1_DEAD, TRUE);
else if (sTag == "my_attacker2")
In one easy step!

When you create your code tags, change the code=auto:0 to code=xml:0. If you are just typing it all out manually, do a preview first to generate the full tags.

Bonus round! If you change the tag to code=xml:1, you get line numbers, like so:
if (sTag == "my_attacker1")
   WR_SetPlotFlag(PLT_ATTACKER_STATUS, MY_ATTACKER1_DEAD, TRUE);
else if (sTag == "my_attacker2")

  • MerAnne aime ceci

#8
Lady Honor

Lady Honor
  • Members
  • 131 messages
lol well there ya go. two birds with one stone. you helped me and learned how to change your colors to boot. since I have to do all this forum stuff on my cell phone...well I don't actually have to anymore...I can use my phone's WiFi with my laptop, but most of the time it requires too much effort. lol but I digress....on my cell it's all in black and white.

#9
MerAnne

MerAnne
  • Members
  • 1 170 messages

When you create your code tags, change the code=auto:0 to code=xml:0. If you are just typing it all out manually, do a preview first to generate the full tags.

Bonus round! If you change the tag to code=xml:1, you get line numbers, like so:

Thanks!

 

I'll probably forget before the next time I enter code, but at least now I have something to forget! :D


  • Lady Honor aime ceci

#10
MerAnne

MerAnne
  • Members
  • 1 170 messages

HA!  I knew there was a way to leverage another script rather than copy the whole thing....

 

HandleEvent(ev, RESOURCE_SCRIPT_AREA_CORE);

 

This example comes from cam000ar_all_camps.nss  If I understand it correctly, it basically says "handle any other events using area_core.nss"  Yes, I could have and possibly should have used this statement instead of copying the entire creature_core, but I wanted to get something to work before I tried to do anything fancy.   :D 

 

And I couldn't remember the statement when I was working on my_creature_core ;)



#11
Lady Honor

Lady Honor
  • Members
  • 131 messages
I used your method without copying the enitre script. I added at the end to reference the creature core but dang gf! that's even better! all you have to do is capture the team destroyed and do it like normal!

#12
Lady Honor

Lady Honor
  • Members
  • 131 messages
grrrr nope. still have to have something call the team destroyed event. the custom creature core works well enough to let you know they're all dead. the only problem now is getting them to wait before they start attacking everyone. by the time i get to them the Templars have half of the dead. in this instance I can take care of it with having the team go hostile after I talk to the templar. in other cases I would want a trigger. I saw a post about creating a custom placeable (trap) with an aoe that would handle that. so that's where I'm heading now. :)

#13
MerAnne

MerAnne
  • Members
  • 1 170 messages

'team destroyed' - I have not used the team concept because it is not entirely clear (to me anyway) that the teams are specific to one area and there is no list of the teams that exist in the vanilla version of the game.  It would have definitely been easier for me to use the 'team destroyed' approach in the Companion Nightmares, but I was afraid of duplicating a team id.  That's why I checked to see if each creature in the team had been killed.  I can't say that it IS a problem, just that I thought it was less risk if I didn't use team_destroyed.



#14
Lady Honor

Lady Honor
  • Members
  • 131 messages
I agree and honestly I think I like the creature core better. I seriously believe I'm going to have tone this quest down a bit. it's got 2 bloodmages, two nukers, one is a pyromaniac lol, two warriors, and two rogues and they are tearing my party's butts up. and that's with halfway decent armor and weapons. it wouldn't be so bad I guess if I wasn't testing everything with a mage. the Templars are making it worse popping that cleanse crap on em every 5 seconds. then again I'm playing it on nightmare too. I don't like things too easy but I don't like Iimpossible either. lol