EVENT TYPE TEAM DESTROYED doesnt fire...
#1
Posté 17 décembre 2009 - 02:09
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
Posté 17 décembre 2009 - 02:12
#3
Posté 17 décembre 2009 - 03:50
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
Posté 17 décembre 2009 - 04:46
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
Posté 17 décembre 2009 - 04:50
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
Posté 18 décembre 2009 - 02:20
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
Posté 01 mars 2010 - 10:36
// 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
Posté 01 mars 2010 - 11:21
#9
Posté 01 mars 2010 - 04:58
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
Posté 01 mars 2010 - 05:56
This page gives a good summary of which event type is sent to which resource - http://social.biowar...ory:Event_types
#11
Posté 02 mars 2010 - 06:41
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
Posté 02 mars 2010 - 12:06
#13
Posté 02 mars 2010 - 02:09
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
Posté 02 mars 2010 - 07:21
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
Posté 02 mars 2010 - 08:13
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
Posté 02 mars 2010 - 09:05
Best,
RR
#17
Posté 05 mars 2010 - 08:40
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
Posté 05 mars 2010 - 06:10
I think what you're looking for is in \\Dragon Age\\tools\\Source\\2DA\\AI_TacticsConditions.xls, sheet "CommandTypes".
#19
Posté 05 mars 2010 - 07:39
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
Posté 06 mars 2010 - 12:35
#21
Posté 06 mars 2010 - 08:55
TY





Retour en haut







