#include "wrappers_h"
void main()
{
object oArea = GetObjectByTag("pre200ar_korcari_wilds");
vector vOgreLocation = Vector(921.814f,866.421f,3.8942f);
if (IsObjectValid(oArea))
CreateObject(
OBJECT_TYPE_CREATURE,
R"ogre_boss.utc",
Location(oArea, vOgreLocation, -30.0f)
);
}
this is the only way I have sucessfuly got a creature to apear in game. But this combo of the PRCSCR_<suffix>(.rim file) and script create an endless amount of creatures athe the spacif point.
Tried to use a plot flag
#include "plt_nb78_plotcreaturetest"
#include "wrappers_h"
void main()
{
if (WR_GetPlotFlag(PLT_NB78_PLOTCREATURETEST, NB78_CREATURETEST_FLAG) == TRUE)
return;
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch ( nEventType )
{
case EVENT_TYPE_MODULE_LOAD:
{
object oArea = GetObjectByTag("pre200ar_korcari_wilds");
vector vOgreLocation = Vector(921.814f,866.421f,3.8942f);
CreateObject(
OBJECT_TYPE_CREATURE,
R"ogre_boss.utc",
Location(oArea, vOgreLocation, -30.0f)
);
WR_SetPlotFlag(PLT_NB78_PLOTCREATURETEST, NB78_CREATURETEST_FLAG, TRUE);
break;
}
default:
break;
}
}
and then i get nothing. I have read and looked over this but remained stumped
any help would be great
Thanks yellerlab7876
Help my addin test is not ending
Débuté par
yellerlab7876
, janv. 23 2010 11:27
#1
Posté 23 janvier 2010 - 11:27
#2
Posté 24 janvier 2010 - 12:42
Did you make the default value of your flag Set? Or are you trying to run EVENT_TYPE_MODULE_LOAD in a PRCSCR script or an area script? You shouldn't be running that particular code off the module, if that is what you are doing. Try moving it (minus the event filtering) to a PRCSCR script or use EVENT_TYPE_AREALOAD_PRELOADEXIT in the area script.
Modifié par Craig Graff, 24 janvier 2010 - 12:45 .
#3
Posté 24 janvier 2010 - 04:01
I only tried the even load as a last resort I didn't thing it would work but as I was stuck I was willing to try and give that a shot. But I left my plot flag defaults value Not Set. Do I need to set it to get the script to run? I will remove the Event module load and try with a set plot flag?
#4
Posté 24 janvier 2010 - 09:46
It still sounds like you are using the module script for this. If so, you really don't want to - it will only work some of the time and be extremely inefficient (since your code will be checked every single time a module event fires - which is quite often).
Try using a PRCSCR 2da to trigger your script. For help look here or here.
For the Korcari Wilds your area list name would be "pre02al_korcari_wilds" without the quotes and you would also want to filter for the area tag like so
[dascript]
void main()
{
object oPC = GetHero();
object oArea = GetArea(oPC);
if (!WR_GetPlotFlag(PLT_NB78_PLOTCREATURETEST, NB78_CREATURETEST_FLAG)
&& GetTag(oArea) == "pre200ar_korcari_wilds" )
{
WR_SetPlotFlag(PLT_NB78_PLOTCREATURETEST, NB78_CREATURETEST_FLAG, TRUE);
//add spawn creature code here
}
}
[/dascript]
Try using a PRCSCR 2da to trigger your script. For help look here or here.
For the Korcari Wilds your area list name would be "pre02al_korcari_wilds" without the quotes and you would also want to filter for the area tag like so
[dascript]
void main()
{
object oPC = GetHero();
object oArea = GetArea(oPC);
if (!WR_GetPlotFlag(PLT_NB78_PLOTCREATURETEST, NB78_CREATURETEST_FLAG)
&& GetTag(oArea) == "pre200ar_korcari_wilds" )
{
WR_SetPlotFlag(PLT_NB78_PLOTCREATURETEST, NB78_CREATURETEST_FLAG, TRUE);
//add spawn creature code here
}
}
[/dascript]
Modifié par Craig Graff, 24 janvier 2010 - 09:54 .





Retour en haut






