Aller au contenu

Photo

EVENT TYPE TEAM DESTROYED doesnt fire...


20 réponses à ce sujet

#1
bigrickman

bigrickman
  • Members
  • 31 messages
If the team isnt destroyed by the player (or his party)

So for instance if i have two teams fighting each other, unless the player scores the killing blow it wont register that one team has been defeated.

Any way around this?

#2
bigrickman

bigrickman
  • Members
  • 31 messages
also UT_teammove stops if they encounter enemies, they will fight and then return to their start position but not continue on their path, any help here too?

#3
Craig Graff

Craig Graff
  • Members
  • 608 messages

bigrickman wrote...

also UT_teammove stops if they encounter enemies, they will fight and then return to their start position but not continue on their path, any help here too?


You can use specify that a command is static, though you will want to make your own equivalent to team_move for that.. (See PRE_QuickMoveTeam in pre_functions_h for an example, though that function is a bit too specialized for you to likely want to use it directly).

You can also set up a patrol path for your creatures with the ambient system, though you would need to specify a system state of 19 for them to follow it if they are hostile. Be careful not to use this excessively since it is expensive, performance-wise.

#4
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages

bigrickman wrote...

If the team isnt destroyed by the player (or his party)

So for instance if i have two teams fighting each other, unless the player scores the killing blow it wont register that one team has been defeated.

Any way around this?


Are you sure this is the case? That hasn't been my experience. The event is fired by the death script of the creature. There's no check in the code that I can see for who the killer is. There are a number of fights in the main game where the player fights with allies and the team death still fires.

The team destroyed event is sent to the current area. Are you checking for it on the creature's script instead of the area script?

Modifié par DavidSims, 17 décembre 2009 - 04:52 .


#5
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages

bigrickman wrote...

also UT_teammove stops if they encounter enemies, they will fight and then return to their start position but not continue on their path, any help here too?


Try setting the parameter bNewHome to TRUE in the team move call. It should make them walk to their original destination after the fighting ends. If you don't want them to fight at all, they probably shouldn't be in a group that's hostile to the other creatures. If you want them to continue walking even if they see enemies, that's going to be tricky to pull off. I can think of a few possible approaches, the easiest of which is probably to use custom ai.

#6
bigrickman

bigrickman
  • Members
  • 31 messages
I've set newhome to true but it didnt help, i do want them to fight so the rest is ok, i just want them to continue on the path after fighting.



With the EVENT TYPE TEAM DESTROYED i cant be sure thats the problem but i've generally noticed that if i participate in the fight the script with run (it is in the area code) but if i stay out to watch the fight to see if its balanced it tends not to run.

#7
RecklezzRogue

RecklezzRogue
  • Members
  • 193 messages
Folks - on a similar topic, I am trying to get creatures to spawn when a team is destryed, but the followng does not seem to do anythng (it is in the module script). Any advice woud be great.





// Setting up code to spawn new bad guys when team 3 is killed



switch(nEventType)

{

case EVENT_TYPE_TEAM_DESTROYED:

{

int nTeam = GetEventInteger(ev,3); //the team number that was destroyed



object oWaypoint1 = GetObjectByTag("spawn_001");

location lWaypoint1 = GetLocation(oWaypoint1);



// create a creature object at the location

object oOgre_Boss1 = CreateObject(OBJECT_TYPE_CREATURE, R"dmo001_ogre_boss.utc", lWaypoint1);



object oWaypoint2 = GetObjectByTag("spawn_002");

location lWaypoint2 = GetLocation(oWaypoint2);



object oOgre_Boss2 = CreateObject(OBJECT_TYPE_CREATURE, R"dmo001_ogre_boss.utc", lWaypoint2);



object oWaypoint3 = GetObjectByTag("spawn_003");

location lWaypoint3 = GetLocation(oWaypoint3);



object oGenlock_Emissary1 = CreateObject(OBJECT_TYPE_CREATURE, R"dmo001_genlock_emissary_bal.utc", lWaypoint3);





object oWaypoint4 = GetObjectByTag("spawn_004");

location lWaypoint4 = GetLocation(oWaypoint4);



object oGenlock_Emissary2 = CreateObject(OBJECT_TYPE_CREATURE, R"dmo001_genlock_emissary_bal.utc", lWaypoint4);



break;

}





}

#8
Challseus

Challseus
  • Members
  • 1 032 messages
Haven't taken a look at the code, but this should go into the area's core script where this occurs, not the module core script.

#9
Magic

Magic
  • Members
  • 187 messages
The team destroyed event works for me even if the player does not participate in the combat. So there might be another issue instead.



To continue ambient behavior after combat, ambient behavior needs to be restarted (with Ambient_Start()) because EVENT_TYPE_PERCEPTION_APPEAR calls Ambient_Stop() upon perceiving enemies. By the way, EVENT_TYPE_COMBAT_END in creature_core.nss calls Rubber_GoHome(), so if that behavior is not desired, RUBBER_HOME_ENABLED should be cleared.

#10
TimelordDC

TimelordDC
  • Members
  • 923 messages
As Challseus points out, the code for EVENT_TYPE_TEAM_DESTROYED should go into the area script, not the module script.

This page gives a good summary of which event type is sent to which resource - http://social.biowar...ory:Event_types

#11
RecklezzRogue

RecklezzRogue
  • Members
  • 193 messages
thanks - I did figure out that the script needs to be associated with the area, and I had a syntax error which is now fixed (in my GetEventIneteger line).

Stll - when the condition is met, the creatures do not spawn. I put a set plot flag in to see if the team destroyed event is working - it is, journal upates - no creatures spawn.

#include "events_h"
#include "plt_dmo001_party_plot"
#include "wrappers_h"
void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
    switch(nEventType)
    {
        case EVENT_TYPE_TEAM_DESTROYED:
        {
            if(GetEventInteger(ev,0) == 3) //3 is the team number expected to be destroyed
            {
                WR_SetPlotFlag(PLT_DMO001_PARTY_PLOT, TEAM3_DESTROYED, TRUE); //Trigger Journal Update (debug)
               
                object oWaypoint1 = GetObjectByTag("spawn_001"); //spawn 1st creature at waypoint tag spawn_001
                location lWaypoint1 = GetLocation(oWaypoint1);
                object oOgre_Boss = CreateObject(OBJECT_TYPE_CREATURE, R"DMO001_OGRE_BOSS.UTC", lWaypoint1);
             
                object oWaypoint2 = GetObjectByTag("spawn_002"); //spawn 2nd creature at waypoint tag spawn_002
                location lWaypoint2 = GetLocation(oWaypoint2);               
                object oOgre_Boss2 = CreateObject(OBJECT_TYPE_CREATURE, R"dmo001_ogre_boss.utc", lWaypoint2);

                object oWaypoint3 = GetObjectByTag("spawn_003");//spawn 3rd creature at waypoint tag spawn_003
                location lWaypoint3 = GetLocation(oWaypoint3);               
                object oGenlock_Emissary1 = CreateObject(OBJECT_TYPE_CREATURE, R"dmo001_genlock_emissary_bal.utc", lWaypoint3); 
               
                object oWaypoint4 = GetObjectByTag("spawn_004");//spawn 4th creature at waypoint tag spawn_004
                location lWaypoint4 = GetLocation(oWaypoint4);                               
                object oGenlock_Emissary2 = CreateObject(OBJECT_TYPE_CREATURE, R"dmo001_genlock_emissary_bal.utc", lWaypoint4);

            }  
           break;
        }
    }
      HandleEvent(ev, RESOURCE_SCRIPT_AREA_CORE);
       
}
 


 

Modifié par RecklezzRogue, 02 mars 2010 - 07:45 .


#12
TimelordDC

TimelordDC
  • Members
  • 923 messages
I guess you must have checked this but are the waypoint tags correct? And are they in a walkable location? Try checking in the area editor or use a IsLocationSafe to do that in script.

#13
Challseus

Challseus
  • Members
  • 1 032 messages
Another thing to think of. Perhaps you want to change how you are
actually "spawning" these enemies in? What I mean is, perhaps try
painting them into your area, and set them to inactive. Then, when you
want them to "spawn", set them active by calling the function, (don't
quote me on the name, not at home to verify) SetIsActive().

In fact, you can just make them part of the same team, and then call something like UT_TeamAppear. At least, that is how I have been handling "spawning" in the game.

Hope this helps.

Modifié par Challseus, 02 mars 2010 - 02:10 .


#14
RecklezzRogue

RecklezzRogue
  • Members
  • 193 messages
Thanks for the help - I did get the script working - aside from fixing the association with the area, and my syntax error, I had to place copies of creatures I was trying to spawn in an unused area - I noticed that they did not show up in the window on the left side of the editor. Once I placed them in the map (in a sealed room - thereby adding the resource to the compiled code I gather) - the script worked. Is there another way to load a resource without the overhead of needing a holding area?



Also - I am going to start playing with the UT_TeamAppear - sounds like a better approach. I am trying all kinds of basic and complex triggers in my first module/area trying to learn the ropes - something tells me that understanding how to trigger 'CreateObject" will come in handy.





Funny part was - I barely made it through team 3, didn't know my script was working, then got clobbered by the bad guys that spwaned....it's a shame when your own module kicks your butt ;-)




#15
Challseus

Challseus
  • Members
  • 1 032 messages

RecklezzRogue wrote...

Thanks for the help - I did get the script working - aside from fixing the association with the area, and my syntax error, I had to place copies of creatures I was trying to spawn in an unused area - I noticed that they did not show up in the window on the left side of the editor. Once I placed them in the map (in a sealed room - thereby adding the resource to the compiled code I gather) - the script worked. Is there another way to load a resource without the overhead of needing a holding area?

Also - I am going to start playing with the UT_TeamAppear - sounds like a better approach. I am trying all kinds of basic and complex triggers in my first module/area trying to learn the ropes - something tells me that understanding how to trigger 'CreateObject" will come in handy.


Funny part was - I barely made it through team 3, didn't know my script was working, then got clobbered by the bad guys that spwaned....it's a shame when your own module kicks your butt ;-)


I would encourage you to go the route I outlined in my last post. Essentially, you're sort of already doing what I suggest. However, instead of putting them in some sealed off room, you can place them exactly where you want them to "spawn", without worrying about waypoints. Then, just set then inactive, and give them all the same team id.

Then, just use the aforementioned UT_TeamAppear function, and you're all set. In terms of overhead, this method has its pros and cons. Since you are pre-placing the enemies, it will take longer for your area to build/export. However, once you call UT_TeamAppear, they will "spawn" faster than if you were using CreateObject. I don't know this for fact, but it would make sense. Someone can correct me if I'm wrong.

The othe pro is that you will be utilizing existing, time tested library functions from utility_h.nss (i.e. UT_TeamAppear). End result is, less code for you to write. Keeps things nice and simple.

Modifié par Challseus, 02 mars 2010 - 08:14 .


#16
RecklezzRogue

RecklezzRogue
  • Members
  • 193 messages
thanks. Taking your advice (UT_TeamAppear).



Best,



RR

#17
RecklezzRogue

RecklezzRogue
  • Members
  • 193 messages
I realize this is largely unrelated to the thread here, but being the newbie to forums that I am...I can't figure out how to pose a new question/thread.



I was investigating 2da's dealing with tactics, and I believe I have a have decent understanding of how it works, however, I could not find an example of setting 'use health polstice' or 'lyrium' outside of the command code for each - what is the subcommand for use health/lyrium? Where is the lookup table or 2da for subcommands?



Generally - I am trying to get Followers to spawn with fully loaded tactics, including self healing stuff (use item), and, set them to defender or ranged or custom, etc.. That way, if they fight before I pick them up, they'll have a chance, and when they are picked up, it's done - just keep playing...as in tactics the I want them (for my module), and stance properly set (defender/ranged/aggresive, etc).





If I should ask this somewhere else - just point me in the right direction...thanks..........


#18
Magic

Magic
  • Members
  • 187 messages
If you leave the thread at the top of the page by pressing "Toolset Scripting", doesn't a "Post New Topic" button appear for you?

I think what you're looking for is in \\Dragon Age\\tools\\Source\\2DA\\AI_TacticsConditions.xls, sheet "CommandTypes".

#19
RecklezzRogue

RecklezzRogue
  • Members
  • 193 messages
oh I am such a noob............thanks for the info on posting a new topic.... :-/



Yes - the command types get's me the command codes, but I cannot seem to find a lookup for the subcommands for each command type...there must be a 2da somewhere that has all the subcommands neatly organized...or perhaps I can reverse engineer a savefile....



Will do some more homework and post this as a new topic if needed...thanks for the guidance.






#20
Magic

Magic
  • Members
  • 187 messages
For spells and talents, the "subcommand" is the ability ID from ABI_base.xls. For the 4 potion using commands, the last parameter is not used. If you're modifying a gda, you need to restart the game, by the way. Maybe that's causing the problem?

#21
RecklezzRogue

RecklezzRogue
  • Members
  • 193 messages
ok - so no entry in subcommand? I was trying "****" with some odd results. Trying it now.....(blank subcommand)



TY