Well the title really says it all. I remember in NWN there was an "encounter" setup that allowed you to make an infinantly respawning encounter for you to fight. I see nothing like that in the DA:O toolset. I want to make a dungeon that I can grind through repeatedly but I cannot figure out how to do this. Any help would be greatly appreciated.
Thanks.
How can I make a monster endlessly respawn?
Débuté par
adoado13
, nov. 16 2009 02:01
#1
Posté 16 novembre 2009 - 02:01
#2
Posté 16 novembre 2009 - 02:44
You can likely do this with triggers to spawn the encounters. That way each time you hit the trigger the encounter is spawned.
I would suggest having a plot setup with the dungeon so you can toggle on/off each trigger. This will stop your party from walking and triggering a trigger, then backing it up and triggering it again thus spawning 2 of everything -- which could be bad!
Have the trigger check the toggle, then spawn if the toggle is on, then toggle the plotline for that trigger off so it can't be triggered again until you go back to the first trigger of the dungeon which sets all of the toggles back to on.
I would suggest having a plot setup with the dungeon so you can toggle on/off each trigger. This will stop your party from walking and triggering a trigger, then backing it up and triggering it again thus spawning 2 of everything -- which could be bad!
#3
Posté 16 novembre 2009 - 05:42
Is there a way that you could point me in the right direction as far as which script I would need to use? I'm still pretty lost.
#4
Posté 16 novembre 2009 - 06:46
http://social.biowar...hp/CreateObject
Start here, bioware shows you some code for spawning monsters.
Start here, bioware shows you some code for spawning monsters.
#5
Posté 27 novembre 2009 - 08:08
#6
Guest_Leopard73_*
Posté 05 décembre 2009 - 03:20
Guest_Leopard73_*
A short script to make a creature endlessly respawn.
You have to set a waypoint for it to spawn at I gave mine a tag of teamone, and create a plot script mine was arena with a value called DS_DEAD!
#include "events_h"
//my plot script with value of DS_DEAD to let script know if creature is dead
#include "plt_arena"
#include "wrappers_h"
#include "global_objects_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
int flag_value = WR_GetPlotFlag(PLT_ARENA, DS_DEAD);
//set a waypoint in area so creature has a spawn point. Its tag teamone
object oWaypoint = GetObjectByTag("teamone");
//this sets the creature to the waypoint
location lWaypoint = GetLocation(oWaypoint);
switch(nEventType)
{
case EVENT_TYPE_TEAM_DESTROYED:
{
//pretty straight forward
// spawns the creature everytime it is killed
if(GetEventInteger(ev,0) == 1)
{
WR_SetPlotFlag(PLT_ARENA, DS_DEAD, FALSE);
}
//calls the arena_ds.utc i.e my template creature
object oDarkSpawn = CreateObject(OBJECT_TYPE_CREATURE, R"arena_ds.utc", lWaypoint);
break;
}
}
}
In your area make it's script value call this. Create an initial creature with its team set to 1, when you kill it a new creature will spawn at your waypoint !
just copy and paste this, change my values to yours and.....
Enjoy
You have to set a waypoint for it to spawn at I gave mine a tag of teamone, and create a plot script mine was arena with a value called DS_DEAD!
#include "events_h"
//my plot script with value of DS_DEAD to let script know if creature is dead
#include "plt_arena"
#include "wrappers_h"
#include "global_objects_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
int flag_value = WR_GetPlotFlag(PLT_ARENA, DS_DEAD);
//set a waypoint in area so creature has a spawn point. Its tag teamone
object oWaypoint = GetObjectByTag("teamone");
//this sets the creature to the waypoint
location lWaypoint = GetLocation(oWaypoint);
switch(nEventType)
{
case EVENT_TYPE_TEAM_DESTROYED:
{
//pretty straight forward
// spawns the creature everytime it is killed
if(GetEventInteger(ev,0) == 1)
{
WR_SetPlotFlag(PLT_ARENA, DS_DEAD, FALSE);
}
//calls the arena_ds.utc i.e my template creature
object oDarkSpawn = CreateObject(OBJECT_TYPE_CREATURE, R"arena_ds.utc", lWaypoint);
break;
}
}
}
In your area make it's script value call this. Create an initial creature with its team set to 1, when you kill it a new creature will spawn at your waypoint !
just copy and paste this, change my values to yours and.....
Enjoy
Modifié par Leopard73, 05 décembre 2009 - 03:33 .
#7
Posté 05 décembre 2009 - 06:22
Thanks Leopard73.
I seem to be having to dig deep in to some relatively simply areas like lighting just to get them to work so it may be some time before i am able to get on with the scripting and questing.
In the mean time here is a link to a spot where me and a guild mate of mine started talking about this very issue. I showed him your script, he is pretty good with scripts him selve but is still learning DA script.
http://www.theengine...772
I seem to be having to dig deep in to some relatively simply areas like lighting just to get them to work so it may be some time before i am able to get on with the scripting and questing.
In the mean time here is a link to a spot where me and a guild mate of mine started talking about this very issue. I showed him your script, he is pretty good with scripts him selve but is still learning DA script.
http://www.theengine...772
#8
Guest_Leopard73_*
Posté 05 décembre 2009 - 09:11
Guest_Leopard73_*
and here is another script to spawn by trigger. its very rough and needs some work if people want to contribute then knock yourselves out. My brain is fried gonna take a couple of hours off. I hope I have provided enough info for you all.
#include "events_h"
#include "plt_yours"
#include "wrappers_h"
#include "global_objects_h"
#include "utility_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
object oWaypoint = GetObjectByTag("yours");
location lLoc = GetLocation(oWaypoint);
switch(nEventType)
{
case EVENT_TYPE_ENTER:
{
object oCreature = GetEventCreator(ev);
if (IsPartyMember(oCreature))
{
object oNewObject = CreateObject(OBJECT_TYPE_CREATURE, R"yours.utc", lLoc);
}
break;
}
case EVENT_TYPE_EXIT:
{
object oCreature = GetEventCreator(ev);
break;
}
}
}
#include "events_h"
#include "plt_yours"
#include "wrappers_h"
#include "global_objects_h"
#include "utility_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
object oWaypoint = GetObjectByTag("yours");
location lLoc = GetLocation(oWaypoint);
switch(nEventType)
{
case EVENT_TYPE_ENTER:
{
object oCreature = GetEventCreator(ev);
if (IsPartyMember(oCreature))
{
object oNewObject = CreateObject(OBJECT_TYPE_CREATURE, R"yours.utc", lLoc);
}
break;
}
case EVENT_TYPE_EXIT:
{
object oCreature = GetEventCreator(ev);
break;
}
}
}
#9
Guest_Leopard73_*
Posté 06 décembre 2009 - 03:13
Guest_Leopard73_*
If you want multiple enemies instead of just one try this
if (IsPartyMember(oCreature))
{
int i;
for(i=0; i<3; i++)
{
object oNewObject = CreateObject(OBJECT_TYPE_CREATURE, R"yours.utc", lLoc);
}
}
A simple for loop on that statement will create, in this case four of my template type creatues i.e 0, 1, 2, 3. the counter starting at zero (in programming 0 is 1, the start)
if (IsPartyMember(oCreature))
{
int i;
for(i=0; i<3; i++)
{
object oNewObject = CreateObject(OBJECT_TYPE_CREATURE, R"yours.utc", lLoc);
}
}
A simple for loop on that statement will create, in this case four of my template type creatues i.e 0, 1, 2, 3. the counter starting at zero (in programming 0 is 1, the start)
#10
Guest_Leopard73_*
Posté 07 décembre 2009 - 05:39
Guest_Leopard73_*
Anybody out there know how to reset a trigger after you use destroy command! I keep trying and cant come up with anything! HELP
#11
Posté 07 décembre 2009 - 05:56
If you destroy a trigger it is gone (though if you use the trigger to save the game the game will be saved before the trigger is destroyed, meaning that loading the save causes the trigger to return).
It is generally better to either set a local variable or use SetObjectActive(oTrigger, FALSE) and then check for the variable or if the trigger is enabled in your script before running the code.
It is generally better to either set a local variable or use SetObjectActive(oTrigger, FALSE) and then check for the variable or if the trigger is enabled in your script before running the code.
#12
Posté 07 décembre 2009 - 07:03
Im going to hazzard a guess here and say that this:
object oNewObject = CreateObject(OBJECT_TYPE_CREATURE, R"yours.utc", lLoc);
instantiates a new block in memory. As such doing something like this:
for(i=0; i<3; i++)
{
object oNewObject = CreateObject(OBJECT_TYPE_CREATURE, R"yours.utc", lLoc);
}
could cause a noticeable slowdown (aka Lag spike) when you hit the trigger especially if the number of iterations is high. Thus tipping off the player that something was coming.
As an alternative you might consider PRECREATING the creatures and keeping them in an inaccessible area of the map and then moving them where you want on the trigger event. Just an optimization trick.
object oNewObject = CreateObject(OBJECT_TYPE_CREATURE, R"yours.utc", lLoc);
instantiates a new block in memory. As such doing something like this:
for(i=0; i<3; i++)
{
object oNewObject = CreateObject(OBJECT_TYPE_CREATURE, R"yours.utc", lLoc);
}
could cause a noticeable slowdown (aka Lag spike) when you hit the trigger especially if the number of iterations is high. Thus tipping off the player that something was coming.
As an alternative you might consider PRECREATING the creatures and keeping them in an inaccessible area of the map and then moving them where you want on the trigger event. Just an optimization trick.
#13
Posté 07 décembre 2009 - 08:50
Just a note that it would generally be much better to have the above code as
object oNewObject;
for(i=0; i<3; i++)
{
oNewObject = CreateObject(OBJECT_TYPE_CREATURE, R"yours.utc", lLoc);
}
Also, it is worth noting that if you are going to be creating creatures instead of activating them, it is a good idea to use the CreatePool function.
Modifié par Craig Graff, 07 décembre 2009 - 09:39 .
#14
Posté 07 décembre 2009 - 09:28
Much better if social didn't eat part of your for clause!
The [code] and [/code] tags are your friends!
The [code] and [/code] tags are your friends!
Modifié par Sunjammer, 07 décembre 2009 - 09:30 .
#15
Posté 07 décembre 2009 - 09:40
Nah, we never really seem to get along.
#16
Guest_Leopard73_*
Posté 07 décembre 2009 - 10:34
Guest_Leopard73_*
Thanks for the nudge in right direction. I will be using createpool the above snippet was just for a quik spawn example, and by the way even an inactive trigger is active according to the wiki so the trigger has to test itself http://social.biowar...ex.php/Trigger.
That was where I was going wrong! Your kick up my arse pushed me over the 3 day research finish line.
That was where I was going wrong! Your kick up my arse pushed me over the 3 day research finish line.





Retour en haut






